Skip to content

Commit 33dfecb

Browse files
Merge pull request #1 from NostrumBioDiscovery/master
Update devel
2 parents 9af8211 + ff2d0e3 commit 33dfecb

54 files changed

Lines changed: 7610 additions & 575368 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
recursive-include PPP/Data/Templates/OPLS2005/HeteroAtoms *
2+
recursive-include PPP/Data/Templates/OPLS2005/Protein *
3+
recursive-include PPP/Data/RotamerLibs *

PPP/Helpers/deploy_pypi.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#Clean and reinstall requirements
2+
pip uninstall -r requirements.txt --yes
3+
pip uninstall PPP --yes
4+
pip install .
5+
6+
#Clean and build
7+
rm -r dist PPP.egg*
8+
python setup.py sdist
9+
twine upload dist/*
10+

PPP/Helpers/deploy_testpypi.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#Clean and reinstall requirements
2+
pip uninstall -r requirements.txt --yes
3+
pip uninstall PPP --yes
4+
pip install .
5+
6+
#fast test
7+
python -m PPP.main -h
8+
cd tests
9+
rm 1l63_proc_processed.pdb
10+
pytest
11+
cd ..
12+
13+
#Clean and build
14+
rm -r dist PPP.egg*
15+
python setup.py sdist
16+
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
17+
#twine upload dist/*
18+

PPP/Helpers/test_pypi.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Clean after build
2+
pip uninstall -r requirements.txt --yes
3+
pip uninstall PPPPele --yes
4+
pip install PPPele
5+
cd tests
6+
pytest
7+
cd ..
8+
9+

PPP/Helpers/test_testpypi.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Clean after build
2+
pip uninstall -r requirements.txt --yes
3+
pip uninstall PPP --yes
4+
pip install -r requirements.txt
5+
pip install --index-url https://test.pypi.org/simple/ PPPELE
6+
cd tests
7+
pytest
8+
9+

PPP/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

PPP/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
3+
4+
__version__ = "1.0.1"

PPP/adjustments_module.py

100755100644
Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
from prody import calcDistance
44

5-
from checks_module import CheckClashes
6-
from coordinates_module import ChangeResidueCoordinates
7-
from global_processes import FindInitialAndFinalResidues
8-
from global_variables import protein_atomnames_dictionary, supported_aminoacids, supported_metals
9-
from program_own_classes import ROTAMERLIB
5+
from PPP.checks_module import CheckClashes
6+
from PPP.coordinates_module import ChangeResidueCoordinates
7+
from PPP.global_processes import FindInitialAndFinalResidues
8+
from PPP.global_variables import protein_atomnames_dictionary, supported_aminoacids, supported_metals
9+
from PPP.program_own_classes import ROTAMERLIB
1010

1111
__author__ = 'jelisa'
1212

1313

1414
def SolveClashes(initial_structure, initial_clashes, mutation, zmatrix, initial_residue_number, final_residue_number):
15-
print "Trying to solve the clashes."
15+
print("Trying to solve the clashes.")
1616
dihedral2check = 0
1717
initial_part_of_the_protein = initial_structure.select("resnum < {}".format(mutation["resnum"])).copy()
1818
final_part_of_the_protein = initial_structure.select("resnum > {}".format(mutation["resnum"])).copy()
@@ -28,8 +28,8 @@ def SolveClashes(initial_structure, initial_clashes, mutation, zmatrix, initial_
2828
initial_number_of_clashes = 0
2929
for values in initial_clashes.values():
3030
initial_number_of_clashes += len(values)
31-
print "Starting number of heavy atoms clashes: {}".format(len(initial_clashes.keys()))
32-
print "Starting number of total clashes: {}".format(initial_number_of_clashes)
31+
print("Starting number of heavy atoms clashes: {}".format(len(initial_clashes.keys())))
32+
print("Starting number of total clashes: {}".format(initial_number_of_clashes))
3333

3434
zmatrix.ComputeDeltaFi()
3535
while maximum_number_of_trials > 0:
@@ -51,16 +51,16 @@ def SolveClashes(initial_structure, initial_clashes, mutation, zmatrix, initial_
5151
break
5252
elif len(new_clashes.keys()) < len(initial_clashes.keys()):
5353

54-
print 'The number of clashing heavy atoms in the residue now is: {} and clashes with {} atoms'.format(
54+
print('The number of clashing heavy atoms in the residue now is: {} and clashes with {} atoms'.format(
5555
len(new_clashes.keys()),
56-
current_number_of_clashes)
56+
current_number_of_clashes))
5757
initial_residue = new_residue.copy()
5858
initial_number_of_clashes = current_number_of_clashes
5959
initial_clashes = new_clashes
6060
elif len(new_clashes.keys()) == len(initial_clashes.keys()):
6161
if current_number_of_clashes < initial_number_of_clashes:
62-
print "The number of clashing heavy atoms is still the same but now they clash with {} atoms.".format(
63-
current_number_of_clashes)
62+
print("The number of clashing heavy atoms is still the same but now they clash with {} atoms.".format(
63+
current_number_of_clashes))
6464
initial_residue = new_residue.copy()
6565
initial_number_of_clashes = current_number_of_clashes
6666
return initial_part_of_the_protein + initial_residue + final_part_of_the_protein
@@ -86,14 +86,14 @@ def FixAtomNames(initial_structure, gaps={}, no_gaps={}, debug=False):
8686
no_gaps_residues = []
8787
initial_res, final_res = FindInitialAndFinalResidues(chain)
8888
if debug:
89-
print "working with chain {}".format(chain.getChid())
89+
print("working with chain {}".format(chain.getChid()))
9090
for residue in chain.iterResidues():
9191
tmp_dictio = copy.deepcopy(protein_atomnames_dictionary)
9292
resname = residue.getResname()
9393
try:
9494
possible_names = tmp_dictio[resname]
9595
except KeyError:
96-
print ' * The residue {} is not an aa nor a water.'.format(resname)
96+
print(' * The residue {} is not an aa nor a water.'.format(resname))
9797
possible_names = [["CL"], ["CU"], ["FE1"], ["FE2"], ["ZN"], ["MG"]]
9898
heteroatom = True
9999
else:
@@ -107,9 +107,6 @@ def FixAtomNames(initial_structure, gaps={}, no_gaps={}, debug=False):
107107
# should have the hydrogen H from the nitrogen, but if the residue is the
108108
# first one in the protein it should be changed into H3 which belongs to
109109
# the "END" keyword in the names dictionary.
110-
if debug:
111-
print 'the initial residue is: {} and the residue number: {}'.format(initial_res,
112-
residue.getResnum())
113110
if 'H' in possible_names[0]:
114111
possible_names.pop(0)
115112
if residue.getResnum() in [initial_res, final_res] + gaps_residues:
@@ -131,26 +128,22 @@ def FixAtomNames(initial_structure, gaps={}, no_gaps={}, debug=False):
131128
atom_name = atoms[0]
132129
atom_found = True
133130
possible_names.pop(possible_names.index(atoms))
134-
if debug and atom.getResnum() == debug[0] and chain.getChid() == debug[
135-
1]: # .split()[0] and atom.getResnum() == debug.split()[1]:
136-
print 'a', residue.getResnum(), old_atom_name, atom_name, final_res
137-
# print 'a', possible_names
138131

139132
break
140133
if not atom_found and not heteroatom:
141134
if atom_name in ['HXT', 'H1', "H2"]:
142135
if residue.getResnum() in gaps_residues or residue.getResnum() in [initial_res, final_res]:
143136
pass
144137
elif residue.getResnum() in no_gaps_residues:
145-
print " * The residue {} won't be considered as a gap, if it really is one," \
138+
print(" * The residue {} won't be considered as a gap, if it really is one," \
146139
" let the developer know".format("{2} {1} {0}".format(residue.getResnum(),
147140
residue.getChid(),
148-
residue.getResname()))
141+
residue.getResname())))
149142
else:
150-
print " * The Atom {} from residue {} {} {} doesn't have a valid name.".format(atom_name,
143+
print(" * The Atom {} from residue {} {} {} doesn't have a valid name.".format(atom_name,
151144
resname,
152145
atom.getChid(),
153-
atom.getResnum())
146+
atom.getResnum()))
154147
atom.setName(atom_name)
155148
# if debug: break
156149
return correct_structure
@@ -196,7 +189,7 @@ def FixStructureResnames(initial_structure, ligand_chain=False):
196189
if ligand_chain == res.getChid() and resname in supported_aminoacids:
197190
ligand_structure = structure.chain_Z.copy()
198191
if ligand_structure is not None and ligand_structure.hetero is not None:
199-
print "INFO: Renaming the ligand to LIG in structure {}".format(initial_structure.getTitle())
192+
print("INFO: Renaming the ligand to LIG in structure {}".format(initial_structure.getTitle()))
200193
resname = "LIG"
201194
res.setResnum(1)
202195
if resname == "HIS":
@@ -219,16 +212,16 @@ def FixStructureResnames(initial_structure, ligand_chain=False):
219212
elif "HD1" in res.getNames() or "HND" in res.getNames():
220213
resname = "HID"
221214
else:
222-
print "Make sure the histidine is correctly protonated and then, only then, explain the bug" \
223-
" to the the developer."
215+
print("Make sure the histidine is correctly protonated and then, only then, explain the bug" \
216+
" to the the developer.")
224217
elif res.numAtoms() == 17:
225218
if "HE2" in res.getNames() or "HNE" in res.getNames():
226219
resname = "HIE"
227220
elif "HD1" in res.getNames() or "HND" in res.getNames():
228221
resname = "HID"
229222
else:
230-
print " * WARNING: The hystidine {} has an incorrect number " \
231-
"of atoms. PELE won't work correctly".format("{} {}".format(res.getResnum(), res.getChid(),))
223+
print(" * WARNING: The hystidine {} has an incorrect number " \
224+
"of atoms. PELE won't work correctly".format("{} {}".format(res.getResnum(), res.getChid(),)))
232225
elif resname == "LYS":
233226
if res.numAtoms() == 21:
234227
resname = "LYN"

0 commit comments

Comments
 (0)