![]() Write frame to next position in trajectory fileĬoords – A list or numpy array of ( ntap,3) containing the system coordinates Write_next ( coords = None, molecule = None, cell =, conect = None ) ¶ Read – If set to False the cursor will move to the next frame without reading Molecule – Molecule object in which the new data needs to be stored Reads coordinates and lattice info from the current position of the cursor and returns it Read_next ( molecule = None, read = True ) ¶ Specifies wether the file to be read from or written to is little endian or big endianīyteorder – Can be either ‘’, denoting native endian, little endian, or big endian Ntap – If the file is in write mode, the number of atoms needs to be passed here Mode – The mode in which to open the DCD file (‘rb’ or ‘wb’)įileobject – Optionally, a file object can be passed instead (filename needs to be set to None) write_next ( coords = crd, cell = cell ) _init_ ( filename = None, mode = 'rb', fileobject = None, ntap = None ) ¶ ntap ) > for crd, cell in dcd : > dcdout. > dcd = DCDTrajectoryFile ( 'old.dcd' ) > dcdout = DCDTrajectoryFile ( 'new.dcd', mode = 'wb', ntap = dcd. Reading and writing to and from the files can be done as follows: The amount of information stored in memory is kept to a minimum, as only information from the current frame The cursor to any frame in the file and reads from there. If the file is in read mode, an additional method read_frame() can be used that moves That read and write from/to the position of the cursor in the file_object attribute. It has read and write methods ( read_next() and write_next()) Ntap – The number of atoms in the molecular system (needs to be constant throughout)Īn DCDTrajectoryFile object behaves very similar to a regular file object. Mode – Designates whether the file is in read or write mode (‘rb’ or ‘wb’) Position – The frame to which the cursor is currently pointing in the DCD file ![]() class DCDTrajectoryFile ( filename = None, mode = 'rb', fileobject = None, ntap = None ) ¶Ĭlass representing a DCD file containing a molecular trajectoryĪn instance of this class has the following attributes:įile_object – A Python file object, referring to the actual DCD file VMD can read a DCD file in combination with any single frame file (XYZ, PDB), So for visualization it needs to be combined with another file. It only stores the coordinates and lattice vectors, Which is very advantages considering the large size of MD trajectories. The DCD file is the most compact trajectory file format,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |