Skip to content

Commit

Permalink
missing DSSP raises a more meaningful EnvironmentError exception
Browse files Browse the repository at this point in the history
  • Loading branch information
luponzo86 committed Jun 13, 2019
1 parent 0b2b83c commit f440ccd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Rhapsody is published on [PyPI](https://pypi.org/). To install Rhapsody, please
```console
$ pip install -U prody-rhapsody
```
It might be necessary to manually install the DSSP program, by giving for instance on Linux:
```console
$ sudo apt get dssp
```

## Install from source
Rhapsody is written in pure Python so no local compilation is needed.
Expand Down
14 changes: 7 additions & 7 deletions rhapsody/PDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ def calcANMfeatures(self, chain='all', env='chain',
def _launchDSSP(self, ag):
LOGGER.info('Running DSSP...')
LOGGER.timeit('_DSSP')
pdb_file = writePDB('_temp.pdb', ag, secondary=False)
try:
pdb_file = writePDB('_temp.pdb', ag, secondary=False)
dssp_file = execDSSP(pdb_file, outputname='_temp')
ag = parseDSSP(dssp_file, ag)
except:
raise
finally:
os.remove('_temp.pdb')
os.remove('_temp.dssp')
except EnvironmentError:
raise EnvironmentError("dssp executable not found: please install "
"with 'sudo apt install dssp'")
ag = parseDSSP(dssp_file, ag)
os.remove('_temp.pdb')
os.remove('_temp.dssp')
LOGGER.report('DSSP finished in %.1fs.', '_DSSP')
return ag

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
version=version,
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
python_requires='>=3.5, <4',
install_requires=['requests', 'numpy', 'scikit-learn',
install_requires=['requests', 'numpy', 'scikit-learn', 'matplotlib',
'biopython', 'pyparsing', 'prody'],
description="""Python program, based on ProDy, for pathogenicity prediction
of human missense variants.""",
Expand Down

0 comments on commit f440ccd

Please sign in to comment.