calc_com

This class caluclates the center of mass of proteins from [dcd,pdb]-files.

Editer:Mogu
environment:Pyton >= 3.5.1
requirement:Numpy >= 1.11
  • example
class cafepy.core.calc_com.CalcCOM(inputfile, *args, **kargs)[source]

Calculating the center of mass from [dcd,pdb]-files

  • Examples:
tmp = CalcCom("filename") # both dcd-format and pdb-format are ok
tmp.run()
tmp.writeFile("outfile") or  tmp.writeShow()

In Terminal.

pycafe.py com -f [dcd,pdb]-infile [optional: -o outfile, -nf index.file or -n int-value] 
read(filename)

read [pdb, dcd, index] files. This function define reading type from files suffix. you need to set a proper suffix with filename.

Inputs:filename(str)
Returns:class [DCD, PDB, Index]
run(atom_idx=[], unit_idx=[], traj_idx=[])[source]

Calculates the Center of mass from DCD-file or PDB-file.

Args:

atom_idx (list), traj_idx (list)

atom_idx:You can select Atoms for calculating COM with idx[.ndx,.ninfo]-file [ from 0 to ~]
unit_idx:You can select Units in pdb format. [from 1 to ~]
traj_idx:You can extract trajectories for calculating COM.