Functions

Topology

Loading

This function should be avoided by the user if there is not a clear reason. When a new object of class msystem is initialized this function is called implicitly by construction.

msystem.load_topol(name_file)
Parameters:name_file (str) – Name of input file with topology
Returns:None

See topology formats for additional info.

Top_Par defined by user

AquaLab gives with this function the posibility to include user defined topologies and parameters. A python script as the one found in Aqua/top_par/top_par_template.py needs to be included in the working directory to be read with:

add_user_topol(file_topol=None, verbose=False)
Parameters:
  • file_topol (str) – Name of input file with top_par defined by the user.
  • verbose (bool) – Prints out general information.
Returns:

None

Prints out:

General information if verbose=True.

Selection

msystem.selection(condition=None[, traj=0, frame='ALL', pbc=True])
Parameters:
  • condition (str) – Logical sentence with selection.
  • traj (int) – Index of trajectory to analyse if a condition over coordinates needs to be evaluated.
  • frame (list, int or str) – Index of frame to analyse if a condition over coordinates needs to be evaluated.
  • pbc (bool) – Periodic Boundary Conditions if a condition over coordinates needs to be evaluated.
Returns:

list of atom indexes.

Return type:

list of integers.

Syntaxis

The syntaxis used by the function msystem.selection() is given by the classes atom, resid and chain. In addition, boolean operations can be done using the words: “AND”, “OR”, “NOT”, “IN”, “WITHIN”, “OF”; no matter if are written in capital or lower case, and the characters: “[”, “]”, “(”, ”)” and ”,”.

Some special words can be used although they have an easy translation:

  • “backbone”: ‘(atom.name N CA C O)’
  • “sidechain”: ‘(resid.type Protein and not atom.name N CA C O H1 H2)’
  • “protein”: ‘(resid.type Protein)’
  • “water”: ‘(resid.type Water)’

Find some examples in section Tutorial-Syntaxis.

Donors and Acceptors

msystem.add_donors(select=None, verbose=False)
Parameters:
  • select (int, list[int], string.) – List or selection of atoms
  • verbose (bool) – Prints out general information.
Returns:

None

Prints out:

General information if verbose=True.

msystem.add_acceptors(select=None, verbose=False)
Parameters:
  • select (int, list[int], string.) – List or selection of atoms
  • verbose (bool) – Prints out general information.
Returns:

None

Prints out:

General information if verbose=True.

Info

msystem.info()
Returns:None
Prints out:General information of the molecular system.

Writting pdb files

xxx


Trajectories

Load Trajectory

msystem.load_traj(file_input=None[, frame=None, begin=None, end=None, increment=1, units='frames', verbose=False])
Parameters:
  • file_input (str) – Name of trajectory file in the following formats: pdb, gro, xtc, trr, dcd.
  • frame (int or list.) – Index of frames to be loaded.
  • begin (int.) – Frame to start the loading process.
  • end (int.) – Frame to finish the loading process.
  • increment (int.) – Interval to load frames.
  • units (str.) – Units for “begin”, “end” and “increment”. [only units=’frames’ available]
  • verbose (bool) – Prints out general information.
Returns:

None

Prints out:

general information if verbose=True.

Info Trajectories

msystem.info_trajs()
Returns:None
Prints out:General information of the whole set of trajectories loaded.

Delete Trajectory

msystem.delete_traj(index='ALL')
Parameters:
  • index – index of trajectory to be deleted in the list msystem.traj
  • index – int or ‘ALL’
Returns:

None

Load Frames

To append a new frame to the list traj.frame:

traj.upload_frame(frame='next'[, begin=None, end=None, increment=1, units=None])
Parameters:
  • frame (int or list or ‘next’ or ‘all’.) – Index of frames to be loaded.
  • begin (int.) – Frame to start the loading process.
  • end (int.) – Frame to finish the loading process.
  • increment (int.) – Interval to load frames.
  • units (str.) – Units for “begin”, “end” and “increment”. [only units=’frames’ available]
Returns:

None

To rewrite an old frame of the traj.frame list with a new frame:

traj.reload_frame(frame='next', old=0)
Parameters:
  • frame (int or ‘next’.) – Index of frames to be loaded.
  • old (int) – Index of frame in the list traj.frame to be rewritten.

Info Frames

traj.info()
Returns:None
Prints out:General information of the whole set of the trajectory.

Delete Frames

traj.delete_frame(frame='ALL'[, begin=None, end=None, increment=1, units=None])
Parameters:
  • frame (int or list or ‘ALL’.) – Index of frame in the list traj.frame to be deleted.
  • begin (int.) – Frame to start the deleting process. [not available yet]
  • end (int.) – Frame to finish the deleting process. [not available yet]
  • increment (int.) – Interval to delete frames. [not available yet]
  • units (str.) – Units for “begin”, “end” and “increment”. [only units=’frames’ available]
Returns:

None

See also

.

Writting dcd files

traj.write(file_name=None, frame='ALL', begin=None, end=None, increment=1, units=None, action=None)
Parameters:
  • file_name (str) – Name of new trajectory file.
  • frame (int or list or ‘ALL’) – Indexes of frames to be written in the new trajectory file.
  • begin (int.) – Frame to start the deleting process. [not available yet]
  • end (int.) – Frame to finish the deleting process. [not available yet]
  • increment (int.) – Interval to delete frames. [not available yet]
  • units (str.) – Units for “begin”, “end” and “increment”. [only units=’frames’ available]
  • action (str.) – “OPEN” or “CLOSE” to open or close a file without writting, None to writte frames in the opened new trajectory file.
Returns:

None


Analysis

Distances

msystem.distance(sel1='ALL', sel2=None, traj=0, frame='ALL', legend=False, pbc=True)
Parameters:
  • sel1 (int, list[int], string.) – List or selection of atoms
  • sel2 (int, list[int], string.) – List or selection of atoms
  • traj (int) – Index of trajectory to be analysed.
  • frame (int, list[int] or ‘ALL’) – List of frame indexes.
  • legend (bool) – Key of distances as output if True.
  • pbc (bool) – With periodic boundary conditions if True.
Returns:

distances, keys1 [if legend], keys2 [if legend]

Return type:

  • distances:
    • numpy.array[num_frames,atoms_sel1,atoms_sel2]
    • numpy.array[atoms_sel1,atoms_sel2] (if num_frames=1)
  • keys1:
    • list[atoms_sel1]
  • keys2:
    • list[atoms_sel2]

Ramachandran Map

The function computes the pairs of angles phi-psi for any list of residues and frames. Since each dihedral angle is computed with atoms from 2 different residues, the relationship between angle and residue is given by the atom ‘CA’.

msystem.ramachandran_map(resid='ALL', traj=0, frame='ALL', pdb_index=False, legend=False)
Parameters:
  • resid (int, list[int] or ‘ALL’) – List of residue indexes or pdb indexes.
  • traj (int) – Index of trajectory to be analysed.
  • frame (int, list[int] or ‘ALL’) – List of frame indexes.
  • pdb_index (bool) – Residues in input and output are identified by the pdb indexes if True.
  • legend (bool) – Key of angles in output if True.
Returns:

angles, keys [if legend]; List of pairs phi-psi (radians) for the corresponding residues and frames, and key legend if choosen.

Return type:

  • angles:
    • numpy.array[num_frames,num_resids,2].
    • numpy.array[num_resids,2] (if num_frames=1)
    • numpy.array[num_frames,2] (if num_resids=1)
    • numpy.array[2] (if num_frames=num_resids=1)
  • keys:
    • list[num_resids][2]
    • list[num_resids][2] (if num_resids=1)

See also

Ramachandran Map

Note

Depending on how this method is used, it can result with a low performance. Check msystem.dihedral_angle() for a better performance.

Covalent chains

msystem.selection_covalent_chains(chain=None, select='protein')
Parameters:
  • chain (list[str]) – List of atom names to find as covalently bonded chains in “select”.
  • select (str) – Selection or set of atoms where the method looks for covalent chains. (see: msystem.selection())
Returns:

chains; List of chains found. Each chain is a list of the corresponding atom indexes.

Return type:

  • chains:
    • list[num_chains][atom_indexes]

Dihedral Angles

The method computes the value of any list of 4 atoms defining a dihedral angle. The output

msystem.dihedral_angle(covalent_chain=None, traj=0, frame='ALL')
Parameters:
  • covalent_chain (list[int] or list[list[int]]) – List of 4 atoms defining the dihedral angle, or list of lists. (see: msystem.selection_covalent_chains())
  • traj (int) – Index of traj to be analysed.
  • frame (int, list[int] or ‘ALL’) – List of frame indexes.
Returns:

angles; List of angle values (radians) in the same order found in input parameter covalent_chain.

Return type:

  • angles:
    • numpy.array[num_frames,num_angs].
    • numpy.array[num_angs] (if num_frames=1)
    • numpy.array[num_frames] (if num_angs=1)
    • float (if num_angs=1 and num_frames=1)