Backported PROPKA code base to Python2.

Now this same code can be run with either Python2.7 or Python3.
This commit is contained in:
Matvey Adzhigirey authored and Mike Beachy committed 2012-12-20 11:29:15 -05:00
1 parent 2aaf2d3a48
commit cfab0bbe69
8 files changed
+12 -6

No files matched your search

+4 -3
View File
@@ -1,3 +1,4 @@
from __future__ import division
import pickle,sys,os,math,Source.calculations import pickle,sys,os,math,Source.calculations
@@ -350,9 +351,9 @@ class bondmaker:
#print('z range: [%6.2f;%6.2f] %6.2f'%(zmin,zmax,zlen)) #print('z range: [%6.2f;%6.2f] %6.2f'%(zmin,zmax,zlen))
# how many boxes do we need in each dimension? # how many boxes do we need in each dimension?
self.no_box_x = max(1, math.ceil(xlen/box_size)) self.no_box_x = max(1, int(math.ceil(xlen/box_size)))
self.no_box_y = max(1, math.ceil(ylen/box_size)) self.no_box_y = max(1, int(math.ceil(ylen/box_size)))
self.no_box_z = max(1, math.ceil(zlen/box_size)) self.no_box_z = max(1, int(math.ceil(zlen/box_size)))
#print('No. box x: %6.2f'%self.no_box_x) #print('No. box x: %6.2f'%self.no_box_x)
#print('No. box y: %6.2f'%self.no_box_y) #print('No. box y: %6.2f'%self.no_box_y)
+1 -1
View File
@@ -1,5 +1,5 @@
from __future__ import division
import math, Source.protonate, Source.bonds,copy, sys import math, Source.protonate, Source.bonds,copy, sys
+1
View File
@@ -2,6 +2,7 @@
# Container for molecular conformations # Container for molecular conformations
# #
from __future__ import division
import Source.group, Source.determinants, Source.determinant, Source.ligand, Source.output, Source.coupled_groups, functools import Source.group, Source.determinants, Source.determinant, Source.ligand, Source.output, Source.coupled_groups, functools
class Conformation_container: class Conformation_container:
+1
View File
@@ -1,4 +1,5 @@
from __future__ import division
import math, Source.output, Source.group, Source.lib, itertools import math, Source.output, Source.group, Source.lib, itertools
+1
View File
@@ -2,6 +2,7 @@
# Class for storing groups important for propka calculations # Class for storing groups important for propka calculations
# #
from __future__ import division
import Source.ligand, Source.determinant, Source.ligand_pka_values, math, Source.protonate import Source.ligand, Source.determinant, Source.ligand_pka_values, math, Source.protonate
my_protonator = Source.protonate.Protonate(verbose=False) my_protonator = Source.protonate.Protonate(verbose=False)
+1 -1
View File
@@ -3,7 +3,7 @@
# Molecular container for storing all contents of pdb files # Molecular container for storing all contents of pdb files
# #
# #
from __future__ import division
import os, Source.pdb, sys, Source.version, Source.output, Source.conformation_container, Source.group, Source.lib import os, Source.pdb, sys, Source.version, Source.output, Source.conformation_container, Source.group, Source.lib
class Molecular_container: class Molecular_container:
+1
View File
@@ -1,5 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
from __future__ import division
from Source.vector_algebra import * from Source.vector_algebra import *
import Source.bonds, Source.pdb, Source.atom import Source.bonds, Source.pdb, Source.atom
+2 -1
View File
@@ -4,6 +4,7 @@
from subprocess import call from subprocess import call
import os, re import os, re
import sys
pdbs = ['1FTJ-Chain-A', pdbs = ['1FTJ-Chain-A',
'1HPX', '1HPX',
@@ -14,7 +15,7 @@ for pdb in pdbs:
print('RUNNING '+pdb) print('RUNNING '+pdb)
# Run pka calculation # Run pka calculation
call(['../propka.py','pdb/'+pdb+'.pdb'], stdout = open(pdb+'.out', 'w+')) call([sys.executable, '../propka.py','pdb/'+pdb+'.pdb'], stdout = open(pdb+'.out', 'w+'))
# Test pka predictiona # Test pka predictiona
result = open('results/'+pdb+'.dat','r') result = open('results/'+pdb+'.dat','r')