Skip to content

Commit

Permalink
Updates to run as package in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
kls93 committed Feb 2, 2021
1 parent 08a4a44 commit e9b443d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rabdam/Subroutines/PDBCUR.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def clean_atom_rec(atoms_list, disulfide_bonds, seqres, cryst1_line,
and atm.insCode == inscode1 and atm.resiType == 'CYS')
or
(atm.chainID == chain2 and atm.resiNum == resnum2
and atm.insCode == inscode2 and atom.resiType == 'CYS'))
and atm.insCode == inscode2 and atm.resiType == 'CYS'))
):
pause = True
print('\n\nERROR: One or more disulfide bonds has been '
Expand Down
2 changes: 1 addition & 1 deletion rabdam/Subroutines/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def plot_Bnet_histogram(self, bnet_df, median, prot_or_na):
plt.ylabel('Normalised Frequency')
plt.title(self.pdb_code + ' Bnet kernel density plot')

# Extracts an array of 128 (x, y) coordinate pairs evenly spaced
# Extracts an array of 100 (x, y) coordinate pairs evenly spaced
# along the x(BDamage)-axis from the kernel density plot. These
# coordinate pairs are used to calculate, via the trapezium rule,
# the area under the curve between the smallest value of x and the
Expand Down
14 changes: 10 additions & 4 deletions rabdam/rabdam.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ def parse_command_line_arguments(command_line, test=False):
else:
from rabdam.Subroutines.checkDependencies import check_RABDAM_dependencies
else:
if __name__ == '__main__' or 'CCP4' in list(os.environ.keys()):
if __name__ == '__main__':
from Subroutines.checkDependencies import check_RABDAM_dependencies
else:
from rabdam.Subroutines.checkDependencies import check_RABDAM_dependencies
if sys.version_info[0] < 3:
from Subroutines.checkDependencies import check_RABDAM_dependencies
else:
from rabdam.Subroutines.checkDependencies import check_RABDAM_dependencies

# Reads in command line inputs. There are three recognised flags: -i, -f
# and -o. Program inputs are specified by either the -i or the -f flag;
Expand Down Expand Up @@ -466,10 +469,13 @@ def main(test=False):
import time
import numpy as np

if __name__ == '__main__' or 'CCP4' in list(os.environ.keys()):
if __name__ == '__main__':
from Subroutines.CalculateBDamage import rabdam
else:
from rabdam.Subroutines.CalculateBDamage import rabdam
if sys.version_info[0] < 3:
from Subroutines.CalculateBDamage import rabdam
else:
from rabdam.Subroutines.CalculateBDamage import rabdam

# Parses in command line arguments
args = parse_command_line_arguments(sys.argv[1:])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

from setuptools import setup, find_packages

with open('README.md', 'r') as f:
with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()

setup(
Expand Down

0 comments on commit e9b443d

Please sign in to comment.