Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. # @molecular-knot.txt
  2.  
  3. # Put this script into your PyMOL working directory.
  4. # Run this script by typing @molecular-knot.txt into the PyMOL command line.
  5.  
  6. # This load command assumes that your file is named molecular-knot.pdb
  7.  
  8. load molecular-knot.pdb
  9.  
  10. # extract some atoms
  11. # I extracted these atoms so that I can remove them from the final movie.
  12.  
  13. extract mol1, name F6CA+F6FA+F19+F7DA+F7DA+F113+P3CA
  14. extract mol2, name O2
  15. extract mol3, name P0FA+F7EA+F3EA+F1AA+F7CA+F1EA+F1AA
  16. extract mol4, name P1+F58+F57+F1CA+F8DA+F58+F4CA+F0AA
  17. extract mol5, name F6DA+F9CA+F6BA+F8EA+F0BA+F3+P39
  18. extract Cl, name Cl2
  19. extract cluster, name H203+H204+H20A+H20B+H20C+H20D+H20E+H20F+H20G+H20H+H20I+H20J+H20K+H20L+C200+C201+C202+C203+C204+C205+C206+C207
  20.  
  21. disable mol1 and mol2 and mol3 and mol4 and mol5 and cluster
  22.  
  23.  
  24. # These viewport settings are for Instagram
  25.  
  26. viewport 640, 640
  27.  
  28. # create the ball and stick display
  29. # I recreated this format from a picture I saw on the PyMOLwiki.
  30.  
  31. create molball, molecular-knot
  32. color lightblue, molball
  33. show spheres, molball
  34. set sphere_scale, 0.25
  35.  
  36. show spheres, Cl
  37.  
  38. create molstick, molecular-knot
  39. color skyblue, molstick
  40. show sticks, molstick
  41. set stick_transparency, 0.3
  42. set stick_radius, 0.15
  43.  
  44. set valence, on
  45. hide everything, molecular-knot
  46. hide lines
  47. hide lines, molball
  48.  
  49. color hydrogen, elem H and molball
  50. color wheat, elem C and molball
  51. color salmon, elem O and molball
  52. color orange, elem Fe and molball
  53. color lime, elem Cl
  54. color lightblue, elem N and molball
  55.  
  56. # grey background gradient
  57.  
  58. set bg_gradient
  59. set bg_rgb_top, grey55
  60. set bg_rgb_bottom, grey05
  61.  
  62.  
  63. # lighting
  64.  
  65. set specular, 0.25
  66. set spec_power, 300
  67. set spec_reflect, 0.5
  68. util.ray_shadows("soft")
  69.  
  70. # higher quality ray tracing
  71.  
  72. set antialias, 1
  73.  
  74. # set up the view
  75.  
  76. viewport 640, 640
  77. set orthoscopic, off
  78. set field_of_view, 30
  79. orient
  80.  
  81. # move the molecule a bit
  82.  
  83. rotate z, 51
  84. zoom complete=1
  85. translate [0,-0.4,0], state=0
  86.  
  87. # make a movie
  88.  
  89. mset 1 x120
  90. movie.nutate(1,120,angle=30)
  91.  
  92. # If you want to view the movie in pymol, set ray_trace_frames=0, or it takes a long time for each frame.
  93.  
  94. set ray_trace_frames=1
  95. set cache_frames=0
  96. mclear
  97.  
  98. # move into a new directory where you want to save the png files. These directories should already exist.
  99.  
  100. cd ../1-movies/molecular-knot-2
  101.  
  102. # save the movie frames
  103. # uncomment the line below to actually write the files. Remember to set ray_trace_frames=1 before writing the frames to disk.
  104.  
  105. # mpng molecular-knot-2
  106.  
  107. # Here are my ffmpeg settings:
  108.  
  109. # ffmpeg
  110. # -framerate 30 # input frame rate
  111. # -i image%03d.png # image names (image000.png, ..., image999.png)
  112. # -s:v 640x640 # video size
  113. # -c:v libx264 # encoder
  114. # -profile:v main # H.264 profile for video
  115. # -crf 12 # constant rate factor (0 to 23, 0 is lossless)
  116. # -pix_fmt yuv420p # pixel format- changes the rgb from the pngs to yuv
  117. # -preset veryslow # encoding speed (slow but higher quality per file size)
  118. # -tune stillimage # tunes the encoding settings for images
  119. # -r 30 # output frame rate
  120. # output_file.mp4 # movie file name
  121.  
  122. # move into the directory that contains your png files before running the ffmpeg command.
  123. # all together:
  124. # ffmpeg -framerate 30 -pattern_type glob -i '*.png' -s:v 640x640 -c:v libx264 -profile:v main -crf 12 -tune stillimage -pix_fmt yuv420p -preset veryslow -r 30 molecular-knot-2.mp4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement