You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`pygen-structures` (pigeon structures) is a Python utility which allows for the generation of 3 dimensional molecular structures which can be used in molecular dynamics or Monte Carlo simulations. Molecules are generated from a list of residues and patches in the format of the CHARMM forcefield, and can be written out as valid PSF and PDB files.
The package can be installed using pip (`pip install pygen-structures`), but relies upon _RDKit_, which must be installed using the [conda package manager](https://docs.conda.io/projects/conda/en/latest/) (`conda install -c rdkit rdkit`). _numpy_ is an additional dependency, and both _pytest_ and _OpenMM_ are required to run all the tests. Python 3.6 and 3.7 are supported.
5
+
`pygen-structures` (pigeon structures) is a Python utility which allows for the generation of 3 dimensional molecular structures which can be used in molecular dynamics or Monte Carlo simulations. Molecules are generated from a list of residues and patches in the format of the CHARMM forcefield, and can be written out as valid PSF and PDB files. The package can be used as a command line utility, or as a Python library.
6
+
7
+
`pygen-structures` can be installed using pip (`pip install pygen-structures`), but relies upon _RDKit_, which must be installed using the [conda package manager](https://docs.conda.io/projects/conda/en/latest/). For installation instructions, see the 'Installation' section of the readme. Python 3.6 and 3.7 are supported.
6
8
7
9
In essence, `pygen-structures` aims (eventually) to be a complete [psfgen](https://www.ks.uiuc.edu/Research/vmd/plugins/psfgen/) replacement with more autonomous functionality and without the necessity for an initial 3D structure. This should make it significantly easier to perform combinatorial searches on particular sequence lengths and linkages, requiring no manual intervention provided the molecules of interest are reasonably small and the residue/patch definitions already exist in the forcefield.
8
10
9
-
The package can be used as a command line utility, or as a Python library.
11
+
## Installation
12
+
13
+
1.[Install the `conda` package manager](https://docs.anaconda.com/anaconda/install/).
14
+
2. Set up a `conda` environment with the relevant dependencies (or install them in your base distribuion). This can be done with the following command: `conda create -n pygen-structures -c rdkit -c omnia 'python>=3.6' 'rdkit>=2018.3' numpy 'openmm>=7.4' pytest`.
15
+
3. Activate the `conda` environment: `conda activate pygen-structures`
16
+
4. Use `pip` to install `pygen-structures` in this environment: `pip install pygen-structures`.
17
+
5. Installation complete! You will have to activate this environment using `conda activate pygen-structures` each time you want to use it.
18
+
6. Test the installation using `pytest --pyargs pygen_structures`
10
19
11
20
## Command line usage
12
21
@@ -16,18 +25,62 @@ Command line usage for peptides is simple, and takes the following form:
16
25
pygen-structures SEQUENCE -o OUTPUT_PREFIX
17
26
```
18
27
19
-
Sequences are specified using the one letter protein code, and terminal patches can be supplied by using hyphens as delimiters (e.g. `NNEU-AFK-CT2`, note that both termini must be supplied). OUTPUT_PREFIX.psf and OUTPUT_PREFIX.pdb are created. If the output prefix is not specified, the PDB file is written to stdout and no PSF file is generated. D-amino acids need only be preceded by a lowercase 'd'. The histidine form used can be set using `--histidine`, and defaults to HSE. Patches can be supplied using `--patches`, the name of the patch, and the 0-based indices the patch is to be applied to (or 'FIRST'/'LAST').
28
+
Sequences are specified using the one letter protein code, and terminal patches can be supplied by using hyphens as delimiters (e.g. `NNEU-AFK-CT2`, note that both termini must be supplied). D-amino acids need only be preceded by a lowercase 'd'.
29
+
30
+
OUTPUT_PREFIX.psf and OUTPUT_PREFIX.pdb are created. If `-o` is not specified, the PDB file is written to stdout and no PSF file is generated.
31
+
32
+
The histidine form used can be set using `--histidine`, and defaults to HSE.
33
+
34
+
Patches can be supplied using `--patches`, the name of the patch, and the 0-based indices the patch is to be applied to (or 'FIRST'/'LAST').
35
+
36
+
To generate more complex structures, such as sugars, the residue names should be supplied (hyphen delimited) and the `-u`/`--use-charmm-names` option selected. Some example usage is given below.
37
+
38
+
`--name` and `--segid` control the names given in the COMPND record and the segment id respectively.
39
+
40
+
### Examples
20
41
21
-
To generate more complex structures, such as sugars, the residue names should be supplied (hyphen delimited) and the `-u`/`--use-charmm-names` option selected. `--name` and `--segid` control the names given in the COMPND record and the segment id respectively. For the trisaccharide raffinose, the following command would be used:
42
+
To produce a simple peptide sequence, the one letter code can be used. To produce the peptide HIS-GLU-TYR, creating `HEY.psf`and `HEY.pdb`:
Supposing we think histidine should be protonated, we can change the protonation state of histidine by specifying a different histidine form:
49
+
50
+
```
51
+
pygen-structures HEY -o HEY --histidine HSP
52
+
```
28
53
29
-
Information about classes and functions for usage as a library can be found on [the project's ReadtheDocs page](https://pygen-structures.readthedocs.io/en/latest/). At present this is limited to an API reference, but there are plans for expansion.
54
+
Or we could use the three letter codes:
55
+
56
+
```
57
+
pygen-structures -u HSP-GLU-TYR -o HEY
58
+
```
30
59
31
-
## Running tests
60
+
For the trisaccharide raffinose, we must use the residue codes. The default segid is PROT, so we can specify a more specific segid using the `--segid` flag, and set the name given in the `COMPND` header using `--name`. The the following command produces `RAFF.psf` and `RAFF.pdb`:
We can also make glycopeptides. To link alpha-glucose to an arginine residue (in this case, from an ALA-ASN-ALA peptide), we can use the NGLA patch. Note that because the protein residue is not the last in the chain, we have to apply the C-terminus patch manually.
By default, if parameters are missing then the files are not created and the missing parameters are written to stdout. Using the `-v` flag will disable verification.
73
+
74
+
```
75
+
$ pygen-structures AdP -o AdP
76
+
Missing parameters:
77
+
bonds {('CPD1', 'CC')}
78
+
$ pygen-structures -v AdP -o AdP
79
+
$
80
+
```
81
+
82
+
A different CHARMM distribution can be loaded using the `-t` option, with the path to the folder. `pygen-structures` ships with the latest CHARMM distribution (July 2019) at the time of writing. The function which parses the folder will pick the latest versions of the parameter and topology files (36 over 27, 36m over 36), so if you plan on using an older version of the forcefield (this is not recommended) you will have to remove the newer versions and change the extensions to match the current conventions (.rtf, .prm).
83
+
84
+
## Library usage
32
85
33
-
To run the tests using pytest, run the following command in the shell: `pytest --pyargs pygen_structures`. `python -m pytest --pyargs pygen_structures` should also work.
86
+
Information about classes and functions for usage as a library can be found on [the project's ReadtheDocs page](https://pygen-structures.readthedocs.io/en/latest/).
0 commit comments