Skip to content

Commit

Permalink
Added GlobalVars, Parasail
Browse files Browse the repository at this point in the history
  • Loading branch information
monteirotorres committed May 25, 2018
1 parent ed9d891 commit e254832
Show file tree
Hide file tree
Showing 7 changed files with 435 additions and 54 deletions.
24 changes: 21 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ Simply run AccessPDB to perform some of these functions intuitively.

The Toolbox is packed up with functions that can be imported and used in your own scripts.

Installation
************
The scripts are available as a `PyPi project`_. Just install them with:

.. _`PyPi project`: https://pypi.org/project/Structuralia/



:code:`pip install Structuralia`



Prerequisites
*************

Expand All @@ -22,11 +34,17 @@ Python packages
- biopython
- biopandas
- pathlib
- parasail

External software (must be installed separately)
================================================

- `TM-align`_
- `GESAMT`_

External software
=================
.. _`TM-align`: https://zhanglab.ccmb.med.umich.edu/TM-align/
.. _`GESAMT`: http://www.ccp4.ac.uk/html/gesamt.html

- TM-align

Author
******
Expand Down
19 changes: 17 additions & 2 deletions Structuralia/AccessPDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
import os
import textwrap as tw
import Structuralia.Toolbox as strtools
from Structuralia.GlobalVars import *


# Main Function
###############################################################################

def main():
strtools.set_globals()
print(tw.dedent("""\
Structuralia Copyright (C) 2018 Pedro H. M. Torres
This program comes with ABSOLUTELY NO WARRANTY
Expand All @@ -54,10 +54,17 @@ def main():
them according to oligomeric state.
5) Simply clean the PDB files in a directory.
6) Select a single chain from PDB files in the directory and write
them in a sub-directory
them in a sub-directory.
7) Clean and sort a local copy of the PDB database, organized in the
default "divided" scheme.
8) Creates a folder containing PDB files with at least one chain
longer than a desired value.
9) Creates a FASTA file containing the sequences of all pdbs in the
current directory.
"""))
pdb_dir = os.getcwd()
os.chdir(pdb_dir)
option = input('Chose one of the options: ')
if option == '1':
cutoff = input('\nChose a cutoff. Available options are: 30, 40, 50, 70, 90, 95 and 100.\n')
Expand All @@ -74,6 +81,14 @@ def main():
strtools.clean_pdb_files(pdb_dir)
elif option == '6':
strtools.single_chain(pdb_dir)
elif option == '7':
pdb_base = input('\nPlease indicate the directory containing the pdb database:\n')
strtools.clean_and_sort_PDB(pdb_base)
elif option == '8':
length = input('\nPlease select minimum chain length:\n')
strtools.min_chain_length(pdb_dir, length)
elif option == '9':
strtools.pdb_to_fasta(pdb_dir)
else:
print('\n Sorry, you did not select a valid option.\n\n Try again.')

Expand Down
56 changes: 56 additions & 0 deletions Structuralia/GlobalVars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# License
###############################################################################
'''
Structuralia: A suite of python scripts to easily manipulate PDBs
Copyright (C) 2018 Pedro H. M. Torres
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact info:
Department Of Biochemistry
University of Cambridge
80 Tennis Court Road
Cambridge CB2 1GA
E-mail address: monteirotorres@gmail.com
'''

# Description
###############################################################################
'''
Set most widely used global variables across the Structuralia scripts.
'''

# Imports
###############################################################################
import os
import progressbar
import Bio.PDB as bpp

# Global Variables
###############################################################################

global workdir
global oligo_dict
global p
global io
global widgets
workdir = os.getcwd()+'/'
oligo_dict = {1: 'MONOMERIC', 2: 'DIMERIC', 3: 'TRIMERIC', 4: 'TETRAMERIC',
5: 'PENTAMERIC', 6: 'HEXAMERIC'}
p = bpp.PDBParser(PERMISSIVE=0, QUIET=True)
io = bpp.PDBIO()
widgets = [' [', progressbar.SimpleProgress(), '] ',
progressbar.Bar(),
progressbar.Percentage(),
' (', progressbar.AdaptiveETA(), ') ']

0 comments on commit e254832

Please sign in to comment.