File IO

File IO

class sasmol.file_io.Files(filename, flag)[source]

Bases: sasmol.pdb_io.PDB, sasmol.dcd_io.DCD

check_error(error)
check_for_all_zero_columns(coor, frame=0)

Make sure there are no two all zero columns in coordinates This is needed for the alignment module

close_dcd_read(dcd_file)

This method closes a dcd file.

close_dcd_write(filepointer)

This method closes a dcd file.

create_conect_pdb_lines()

Output stored conect information in PDB record format. Indices are converted from those read in - original_index - to those used in output. Format of CONECT line: Record name CONECT followed by list of atom indexes in 6 character columns. First is the base atom, following atoms are those connected to it.

element_filter()

This function filters the PDB file to sraighten out various things (add to this as you go along).

Filter element list…

get_element(name, resname)

Get elment from charmm27 atom name list plus extras from periodic table and resolve name conflicts

get_resnames()

This method holds names of residues to use to set moltype. Based on Charmm 27 naming.

initialize_children()

This initializes the following “children” with their masks already defined to the “parent” molecule

names() : names_mask() resnames() : resnames_mask() resids() : resids_mask() chains() : chains_mask() segnames() : segnames_mask() occupancies() : occupancies_mask() betas() : betas_mask() elements() : elements_mask()

The objects on the left contain the unique values and the objects on the right contain the masks that have the indices to extract the information for each unique value from the parent molecule.

open_dcd_read(filename)

This method opens a file to read in the Charmm/Xplor data format. by calling a pre-compiled C module (dcdio).

open_dcd_write(filename)

This method opens a file and writes the headerfile in the Charmm/Xplor data format. by calling a pre-compiled C module (dcdio).

This function will OVERWRITE a file with the same name without prompting.

open_file()[source]
print_error(name, my_message)
read_dcd(filename)

This method reads data in the Charmm/Xplor data format.

read_dcd_step(dcdfile, frame, **kwargs)

This method reads a single dcd step in the Charmm/Xplor data format.

read_pdb(filename, **kwargs)

This method reads a PDB file.

read_single_dcd_step(filename, frame)

This method reads a single dcd step in the Charmm/Xplor data format.

The method simply reads all frames up until frame and then assigns coordinates to the last frame (no seek option is utilizied)

write_dcd(filename)

This method writes data in the Charmm/Xplor data format. by calling a pre-compiled C module (dcdio).

write_dcd_frames(filename, start, end)

This method writes a single step or multiple frames in the Charmm/Xplor data format. by calling a pre-compiled C module (dcdio).

write_dcd_header(filepointer, nset)

This method writes the headerfile in the Charmm/Xplor data format. by calling a pre-compiled C module (dcdio).

write_dcd_step(filepointer, frame, step)

This method writes a single step in the Charmm/Xplor data format. by calling a pre-compiled C module (dcdio).

write_pdb(filename, frame, flag, **kwargs)

This method writes the PDB file