sith.g09_stretching package

Subpackages

Submodules

sith.g09_stretching.change_dofs.change_def(new_i, element, atoms, file)[source]

Changes the definition of a given DOF and updates the comfile including the value of the DOFs.

Parameters:
  • new_i (list) – list of four indexes (1-based) defining the distance (between the first two indices), angle (between the first three indices) and dihedral (the four indices) you want to define.

  • element (str) – element of the atom you want to define. E.g. ‘C’, ‘H’, ‘O’, etc.

  • atoms (ase.Atoms) – atoms of a given configuration.

  • file (str) – gaussian input comfile that you want to modify. Be sure to back up the original file.

Returns:

  • (None) However, it changes the comfile. Be sure to back up the original

  • file.

sith.g09_stretching.change_dofs.change_prolines_dofs(comfile, molecule, pdb_template, option)[source]

Changes the definition of the degrees of freedom in prolines such that the missed bond is always different.

Parameters:
  • comfile (str) – gaussian input comfile that you want to modify.

  • molecule (str) – xyz file representing the molecule.

  • pdb_template (str) – pdb with the peptide information.

  • option (str) – ‘1’ misses Cgamma Cdelta. ‘2’ misses Cbeta Cgamma. ‘3’ misses Calpha Cbeta. ‘4’ misses Cdelta N.

Returns:

  • (None) However, it changes the comfile. Be sure to back up the original

  • file.

Note

This function only works when the prolines are not next to capping groups.

sith.g09_stretching.change_dofs.def_line(indexes, element)[source]

Creates a line defining an atom in a gaussian input comfile.

Parameters:
  • indexes (list) – list of four indexes (1-based) defining the distance (between the first two indices), angle (between the first three indices) and dihedral (the four indices).

  • element (str) – element of the atom you want to define. E.g. ‘C’, ‘H’, ‘O’, etc.

Return type:

(str) line defining the atom in a gaussian input comfile.

sith.g09_stretching.change_dofs.extract_dofs(indexes, atoms)[source]

Extracts the distance, angle and dihedral defined by the given indexes.

Parameters:
  • indexes (list) – list of four indexes (1-based) defining the distance (between the first two indices), angle (between the first three indices) and dihedral (the four indices) you want to compute.

  • atoms (ase.Atoms) – atoms of a given configuration.

Return type:

(tuple) distance, angle and dihedral defined by the given indexes.

sith.g09_stretching.change_dofs.extract_proline_atoms(pep_set, i_pro)[source]
sith.g09_stretching.change_dofs.permute_atoms(atoms, indexes)[source]

Permutes two atoms in an Atoms object.

Parameters:
  • atoms (ase.Atoms) – atoms object to be permuted.

  • indexes (list) – list of two indexes to be permuted (1-based).

Return type:

(ase.Atoms) permuted atoms object.

sith.g09_stretching.change_dofs.reorder_prolines_atoms(comfile, molecule, pdb_template, option)[source]

Changes the definition of the degrees of freedom in prolines such that the missed bond is always different.

Parameters:
  • comfile (str) – gaussian input comfile that you want to modify.

  • molecule (str) – xyz file representing the molecule.

  • pdb_template (str) – pdb with the peptide information.

  • option (str) – ‘1’ misses Cgamma Cdelta. ‘2’ misses Cbeta Cgamma. ‘3’ misses Calpha Cbeta. ‘4’ misses Cdelta N.

Returns:

  • (None) However, it changes the comfile. Be sure to back up the original

  • file.

sith.g09_stretching.change_dofs.set1(N_i, Cd_i, Cg_i, Cb_i, Ca_i, C_i, O_i, HB1_i, HB2_i, HG1_i, HG2_i, HD1_i, HD2_i, atoms, comfile)[source]
sith.g09_stretching.change_dofs.set2(N_i, Cd_i, Cg_i, Cb_i, Ca_i, C_i, O_i, HB1_i, HB2_i, HG1_i, HG2_i, HD1_i, HD2_i, atoms, comfile)[source]
sith.g09_stretching.change_dofs.set3(N_i, Cd_i, Cg_i, Cb_i, Ca_i, C_i, O_i, HB1_i, HB2_i, HG1_i, HG2_i, HD1_i, HD2_i, atoms, comfile)[source]
sith.g09_stretching.change_dofs.set4(Cd_i, Cg_i, Cb_i, Ca_i, C_i, O_i, HB1_i, HB2_i, HG1_i, HG2_i, HD1_i, HD2_i, atoms, comfile)[source]
sith.g09_stretching.change_dofs.set_backbone(N_i, Ca_i, HA_i, C_i, O_i, previous, atoms, comfile, starting)[source]
sith.g09_stretching.change_dofs.swaps_to_transform(initial, final)[source]

Return a list of swaps (i, j) that transform initial into final. Each swap is applied to initial in sequence.

sith.g09_stretching.change_dofs.test_dofs(atoms, index, file)[source]

” Tests that the distance, angle and dihedral defined by the given indexes correspond to those in the given file.

Parameters:
  • atoms (ase.Atoms) – atoms of a given configuration.

  • indexes (list) – Indexes (1-based) of an atom in the z-matrix that contains the distance, angle and dihedral.

  • file (str) – file where the distance, angle and dihedral are stored.

Returns:

  • (bool) True if the test passes. It raises an assertion error if the values

  • do not

sith.g09_stretching.g09_xyz.log2xyz(finput, foutput=None, indexes=None)[source]

Extract the configuration of minumum energy from a .log gaussian file of an optimization process in a xyz file.

Parameters:
  • finput (str) – path to the log file.

  • foutput (str. Default=None # TODO: check default value) – name of the output file without extension.

Returns:

  • # TODO (add return information)

  • Note (if foutput is not given, the name output will be the same than the)

  • input but with xyz extension.

sith.g09_stretching.g09_xyz.log2xyz2(finput, foutput=None, indexes=None, frame=-1)[source]
class sith.g09_stretching.protonate.Protonize(pdb)[source]

Bases: object

Protonize charged amino acids to make them more stable in QM.

Parameters:

pdb (str.) – pdb file of the peptide.

arg()[source]

In case of ARG

Return type:

(ase.Atoms) atoms to be added.

asp()[source]

In case ASP

Return type:

(ase.Atoms) atoms to be added.

create_atoms()[source]

Add the atoms.

Return type:

(None)

glu()[source]

In case of GLU

Return type:

(ase.Atoms) atoms to be added.

lys()[source]

In case LYS

Return type:

(ase.Atoms) atoms to be added.

sith.g09_stretching.protonate.protonate(pdb, output)[source]

Add or remove the H atoms neccessary to neutralize charges in the atoms charged amino acids.

Parameters:
  • pdb (str) – name of the pdb file with the amino acids.

  • output – name of the output file.

Return type:

(ase.Atoms) new structures.

sith.g09_stretching.sith_tools.gen_randpep(n)[source]

Function that returns the command line to run JEDI analysis using for a random peptide

Parameters:

n (int) – number of peptides to be picked randomly.

Return type:

(str) Chain of n aminoacis.

sith.g09_stretching.sith_tools.proline_state(pdb, state, outputwoext=None)[source]

Changes the state of all prolines to endo or exo. There is also de option to set it randomly but always the final state of one proline will be one of those.

Parameters:
  • pdb (str) – path to the pdb file that contains the prolines to be modified.

  • state (str) – state to set up the prolines. It could be ‘endo’, ‘exo’ or ‘random’.

  • outputwoext (str. Default=None) – name of the output without extension. If None, this argument will be set as pdv argument (without the extension).

Returns:

  • (list) [#prolines(str)] list of proline states. In between it creates

  • <outputwoext>modpro.pdb.

Module contents

stretching

[script] sith/g09_stretching/stretching.sh

This tool obtains the stretched configurations of a molecule by increasing the
distance between two atoms, constraining and optimizing at every step.

-b <number_of_breakages=1> The simulation will run until get this number of
ruptures.
-c Use this flag to run in a cluster. When -p is not defined, and you run in
a slurm job manager system, the of processors is equal to the number of
cores asked in the submission of the job.
-e <extend_method=0> index of stretching method. To see the options, use
‘sith change_distance -h’ to see the order.
carbons of the capping groups
-i <index1,index2> indexes of the atoms to use for increasing the distance.
If this flag is not used and ‘molecule’ (flag -m) is a pdb, indexes 1 and
2 will correspond to the CH3 atoms in ACE and NME residues defined in the
pdb if they exist.
-l <xc,base=bmk,6-31+g> evel of DFT theory.
-m <molecule> molecule name. In this directory, a file called
<molecule>-stretched00.pdb must exist.
-p <processors=1> number of processors per gaussian job.
-r restart stretching. In this case, this code must be executed from
the molecule’s directory.
-s <size[A]=0.2> Size of the step that increases the distances at each step.

-v verbose
-h prints this message.

swap_atoms_in_com

[script] sith/g09_stretching/swap_atoms_in_com.sh

Permutes the incides of two atoms in com file where the molecule is defined as
a z-matrix.

-a <atom1> index of one of the atoms to be permuted. 1-based numbering.
-b <atom2> index of the other atom to be permuted. 1-based numbering.
-f <file.com> input gaussian file with the z-matrix already defined.

-v verbose.
-h prints this message.

create_peptide

[script] sith/g09_stretching/create_peptide.sh

This tool creates a peptide as a change of amino acids. It adds ACE and NME
capping groups in the ends. The output is a pdb file with the name of the
peptide saved in a directory with the same name.

-d <reference document=00-aminos.txt> file containing the existing peptides
to avoid repetition. Mainly used for generation of random peptides.
-e <endo> or <exo> states for initial state of proline. Default ‘random’.
-n <options> Pepgen options (use " for this)
-p <peptide> Chains of aminoacids to be evaluated. For example, “AAA”
would analyse a trialanine peptide.
-R random pepeptide. Give the number of amino acids with this argument.

-v verbose.
-h prints this message.

Note
—-

This tools requires pepgen already installed.

extract_forces

[script] sith/g09_stretching/extract_forces.sh

Extract the forces and indexes of the DOFs from a log file (gaussian) and fchk
file (or chk) when it exists. The output is a set of files called
<pep>-forces<n_stretching>.fchk containing the information in fchk gaussian
format.

-f <file.log> log file created by gaussian, chk file of this file should
have the same name but different extension.

-v verbose.
-h prints this message.

proline_mod

[script] sith/g09_stretching/proline_mod.sh

Changes the state of the proline to endo, exo or random.

-f <path> pdb file.
-o <path> output pdb file.
-l <path> log file of the gromacs outputs. Default /dev/null
-s <state> proline state. So far, random, endo and exo are accepted.

-v verbose.
-h prints this message.

find_forces

[script] sith/g09_stretching/find_forces.sh

This tool computes the forces from a chk files that contains a given structure
and saves them in a directory called ‘forces’ that has to be previously
created.

-c run in cluster.
-f <file> chk file or com file to compute the forces from. In case of com
file, it is assumed that it contains the right keywords to compute
forces. In case of chk file, a com file is created with the right
keywords to compute forces and replacing <pattern> with the word
‘forces’.
-n <n_processors=1> number of processors to be used in the gaussian job.
-p <pattern> pattern present in the chk files that will be replaced with the
word ‘forces’.

-v verbose.
-h prints this message.

Note
—-
Take care with the files that already exist in the directory ‘forces’. They
may be overwritten.

workflow

[script] sith/g09_stretching/workflow.sh

This tool creates all the stretched structures for a molecule and computes the
needed quantities for sith. You can use this code to submit a Job in cluster or
to execute it locally. Consider the next options:

-b <number of breakages=1> The simulation will run until getting this number
of ruptures in the bonds.
-c run in cluster (see the documentation of the installation of sith
-execute ‘sith doc’ in your terminal-)
-i <index1,index2> indexes of the atoms to use for increasing the distance.
If this flag is not used and ‘molecule’ (flag -m) is a pdb, indexes 1 and
2 will correspond to the CH3 atoms in ACE and NME residues defined in the
pdb if they exist.
-l <xc,base=bmk,6-31+g> evel of DFT theory.
-m <molecule> definition of the molecule (xyz, pdb, …).
-M <method=0> Index of stretching method. To see the options, use
‘sith change_distance -h’ to see the order.
-n <n_processors=1> number of processors per gaussian job.
-r restart. In this case, run from the directory of the pre-created
stretched molecule.
-s <size[A]=0.2> of the step that increases the distances.
-S <job_options=’’> options for submitting a new job. This flag only makes
sense in slurm cluster. Please, do not include a name and add the options
as in the next example: “–partition=cpu –nice”.

-v verbose.
-h prints this message.

simplify_path

[script] sith/g09_stretching/simplify_path.sh

Takes all log files with certain pattern, extracts the last configuration,
extract the dofs and removes the steps corresponding to oscillations or the
system stacked in a configuration.

-p <pattern> pattern of the log files to be considered

-v verbose.
-h prints this message.

restart_g09

[script] sith/g09_stretching/restart_g09.sh

creates the com file to restart a gaussian09 job from an existing
.chk file assuming that the com file of the process exists. I basically
uses the same com file but replacing the geometry by the one in the .chk file.

-c run un a cluster.
-d <directory=./> directory where to find the .chk and .com files.
-n <name> name (without extension) of the .chk and .com files.

-v verbose.
-h prints this message.