Skip to content

Commit 7e5c948

Browse files
authored
Merge pull request #6 from nostrumbiodiscovery/devel
Copied supported_aminoacids to prevent modifications during tests
2 parents 960bde9 + 9120361 commit 7e5c948

7 files changed

Lines changed: 17 additions & 15 deletions

File tree

.github/workflows/conda_deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest, macos-latest]
13-
python-version: [3.7, 3.8]
13+
python-version: [3.7, 3.8, 3.9]
1414
name: Python ${{ matrix.python-version }} at ${{ matrix.os }}
1515
steps:
1616
- uses: actions/checkout@v2

PPP/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22

33

4-
__version__ = "1.0.7"
4+
__version__ = "1.0.8"

PPP/adjustments_module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from PPP.checks_module import CheckClashes
66
from PPP.coordinates_module import ChangeResidueCoordinates
77
from PPP.global_processes import FindInitialAndFinalResidues
8-
from PPP.global_variables import protein_atomnames_dictionary, supported_aminoacids, supported_metals
8+
from PPP.global_variables import protein_atomnames_dictionary, default_supported_aminoacids, supported_metals
99
from PPP.program_own_classes import ROTAMERLIB
1010

1111
__author__ = 'jelisa'
@@ -185,8 +185,8 @@ def FixStructureResnames(initial_structure, ligand_chain=False):
185185
for res in structure.iterResidues():
186186
resname = res.getResname()
187187
ligand_structure = None
188-
# print ligand_chain == res.getChid(), resname in supported_aminoacids
189-
if ligand_chain == res.getChid() and resname in supported_aminoacids:
188+
189+
if ligand_chain == res.getChid() and resname in default_supported_aminoacids:
190190
ligand_structure = structure.chain_Z.copy()
191191
if ligand_structure is not None and ligand_structure.hetero is not None:
192192
print("INFO: Renaming the ligand to LIG in structure {}".format(initial_structure.getTitle()))

PPP/checks_module.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from prody import Contacts, calcDistance, calcAngle
44

55
from PPP.global_processes import FindInitialAndFinalResidues
6-
from PPP.global_variables import supported_aminoacids, supported_metals, coordination_geometries
6+
from PPP.global_variables import default_supported_aminoacids, supported_metals, coordination_geometries
77
from PPP.program_own_classes import ZMATRIX
88

99
__author__ = 'jelisa'
@@ -207,7 +207,7 @@ def CheckStructure(initial_structure, gaps={}, no_gaps={}, charge_terminals=Fals
207207
residue_atomnames = list(residue.getNames())
208208
if resname in supported_metals:
209209
continue
210-
if resname in supported_aminoacids:
210+
if resname in default_supported_aminoacids:
211211
if charge_terminals:
212212
if resnum == initial_residue or resnum in gaps_b:
213213
zmatrix = ZMATRIX(resname + 'B')
@@ -438,7 +438,7 @@ def CheckMutation(wt_structure, mutation):
438438
- valid_resnames_file: the path to the file containing a list with the supported mutations
439439
"""
440440

441-
if mutation['fin_resname'] not in supported_aminoacids:
441+
if mutation['fin_resname'] not in default_supported_aminoacids:
442442
return False
443443

444444
testing_the_resnum = "resnum {}".format(mutation['resnum'])
@@ -536,7 +536,7 @@ def CheckClashes(mutated_protein, mutation, zmatrix, initial_residue,
536536
atom2check = mutated_protein.select('index {}'.format(ind))
537537
atom2check_resname = atom2check.getResnames()[0]
538538
atom2check_resnum = atom2check.getResnums()[0]
539-
if atom2check_resnum == initial_residue and atom2check_resname in supported_aminoacids:
539+
if atom2check_resnum == initial_residue and atom2check_resname in default_supported_aminoacids:
540540
atom2check_zmatrix = ZMATRIX(atom2check_resname + 'B')
541541
elif atom2check_resnum == final_residue:
542542
atom2check_zmatrix = ZMATRIX(atom2check_resname + 'E')
@@ -583,7 +583,7 @@ def CheckforGaps(structure, max_bond_distance):
583583
# print residue.getResnum() < previous_residue_number
584584
if previous_residue_number is not None:
585585
# if residue.getResnum() > previous_residue_number + 1:
586-
if residue.getResname() in supported_aminoacids:
586+
if residue.getResname() in default_supported_aminoacids:
587587
if residue.getResname() == 'ACE':
588588
try:
589589
gaps[chain_id]

PPP/global_processes.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import copy
12
import sys
23
from argparse import ArgumentParser, RawTextHelpFormatter
34
from re import match
4-
from PPP.global_variables import supported_aminoacids, input_keywords, aminoacids_1letter, aminoacids_3letter
5+
from PPP.global_variables import default_supported_aminoacids, input_keywords, aminoacids_1letter, aminoacids_3letter
56
from PPP import parameters_help
67

78
from prody import parsePDB
@@ -79,7 +80,7 @@ def ParseMutations(unprocessed_mutation, structure_filename):
7980
final_resname = splitted_mutation[splitted_mutation.index('to') + 1].upper()
8081
mutation = {'ini_resname': original_resname, "resnum": resnum,
8182
"chain": chain, "fin_resname": final_resname}
82-
if mutation["fin_resname"] in supported_aminoacids:
83+
if mutation["fin_resname"] in default_supported_aminoacids:
8384
processed_mutations.append(mutation)
8485
print('a')
8586
elif mutation["fin_resname"].lower() in input_keywords.keys():
@@ -186,7 +187,7 @@ def FindInitialAndFinalResidues(structure):
186187
for res in structure.iterResidues():
187188
resnum = res.getResnum()
188189
resname = res.getResname()
189-
if resname in supported_aminoacids:
190+
if resname in default_supported_aminoacids:
190191
if not first_aa:
191192
initial_residue = resnum
192193
first_aa = True
@@ -198,6 +199,7 @@ def FindInitialAndFinalResidues(structure):
198199

199200
def PDBwriter(output_file_name, structure, make_unique, residues2remove, no_ter_mkar_for_gaps, no_proteic_ligand=None,
200201
gaps={}, no_gaps={}, mid_chain_nonstd_residue=[]):
202+
supported_aminoacids = copy.copy(default_supported_aminoacids)
201203
supported_aminoacids.extend(mid_chain_nonstd_residue)
202204
if '.pdb' not in output_file_name:
203205
output_file_name += '.pdb'

PPP/global_variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
supported_aminoacids = ["ALA", "ARG", "ASH", "ASN", "ASP", "CYS", "CYT", "GLH",
1+
default_supported_aminoacids = ["ALA", "ARG", "ASH", "ASN", "ASP", "CYS", "CYT", "GLH",
22
"GLN", "GLU", "GLY", "HID", "HIE", "HIS", "HIP", "ILE",
33
"LEU", "LYS", "LYN", "MET", "PHE", "PRO", "PTR", "SER", "TRP",
44
"THR", "TYR", "VAL", "ACE", "NMA"]

conda_recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# must do conda install -c NostrumBioDiscovery pele_platform
22
package:
33
name: pppele
4-
version: "1.0.7"
4+
version: "1.0.8"
55

66
about:
77
home: https://github.com/NostrumBioDiscovery/PP

0 commit comments

Comments
 (0)