Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # @molecular-knot.txt
- # Put this script into your PyMOL working directory.
- # Run this script by typing @molecular-knot.txt into the PyMOL command line.
- # This load command assumes that your file is named molecular-knot.pdb
- load molecular-knot.pdb
- # extract some atoms
- # I extracted these atoms so that I can remove them from the final movie.
- extract mol1, name F6CA+F6FA+F19+F7DA+F7DA+F113+P3CA
- extract mol2, name O2
- extract mol3, name P0FA+F7EA+F3EA+F1AA+F7CA+F1EA+F1AA
- extract mol4, name P1+F58+F57+F1CA+F8DA+F58+F4CA+F0AA
- extract mol5, name F6DA+F9CA+F6BA+F8EA+F0BA+F3+P39
- extract Cl, name Cl2
- 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
- disable mol1 and mol2 and mol3 and mol4 and mol5 and cluster
- # These viewport settings are for Instagram
- viewport 640, 640
- # create the ball and stick display
- # I recreated this format from a picture I saw on the PyMOLwiki.
- create molball, molecular-knot
- color lightblue, molball
- show spheres, molball
- set sphere_scale, 0.25
- show spheres, Cl
- create molstick, molecular-knot
- color skyblue, molstick
- show sticks, molstick
- set stick_transparency, 0.3
- set stick_radius, 0.15
- set valence, on
- hide everything, molecular-knot
- hide lines
- hide lines, molball
- color hydrogen, elem H and molball
- color wheat, elem C and molball
- color salmon, elem O and molball
- color orange, elem Fe and molball
- color lime, elem Cl
- color lightblue, elem N and molball
- # grey background gradient
- set bg_gradient
- set bg_rgb_top, grey55
- set bg_rgb_bottom, grey05
- # lighting
- set specular, 0.25
- set spec_power, 300
- set spec_reflect, 0.5
- util.ray_shadows("soft")
- # higher quality ray tracing
- set antialias, 1
- # set up the view
- viewport 640, 640
- set orthoscopic, off
- set field_of_view, 30
- orient
- # move the molecule a bit
- rotate z, 51
- zoom complete=1
- translate [0,-0.4,0], state=0
- # make a movie
- mset 1 x120
- movie.nutate(1,120,angle=30)
- # If you want to view the movie in pymol, set ray_trace_frames=0, or it takes a long time for each frame.
- set ray_trace_frames=1
- set cache_frames=0
- mclear
- # move into a new directory where you want to save the png files. These directories should already exist.
- cd ../1-movies/molecular-knot-2
- # save the movie frames
- # uncomment the line below to actually write the files. Remember to set ray_trace_frames=1 before writing the frames to disk.
- # mpng molecular-knot-2
- # Here are my ffmpeg settings:
- # ffmpeg
- # -framerate 30 # input frame rate
- # -i image%03d.png # image names (image000.png, ..., image999.png)
- # -s:v 640x640 # video size
- # -c:v libx264 # encoder
- # -profile:v main # H.264 profile for video
- # -crf 12 # constant rate factor (0 to 23, 0 is lossless)
- # -pix_fmt yuv420p # pixel format- changes the rgb from the pngs to yuv
- # -preset veryslow # encoding speed (slow but higher quality per file size)
- # -tune stillimage # tunes the encoding settings for images
- # -r 30 # output frame rate
- # output_file.mp4 # movie file name
- # move into the directory that contains your png files before running the ffmpeg command.
- # all together:
- # 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