tidied and updated kd and dssp scripts & generated their respective outputs
This commit is contained in:
parent
37e1d43b76
commit
73e0029b65
6 changed files with 209 additions and 181 deletions
|
@ -5,28 +5,78 @@ Created on Thu Feb 6 12:18:24 2020
|
|||
|
||||
@author: tanu
|
||||
"""
|
||||
#http://foldxsuite.crg.eu/faq-page#
|
||||
# after fold x downlaoded, extract and run it from
|
||||
#https://biopython.org/DIST/docs/api/Bio.PDB.ResidueDepth%27-module.html
|
||||
#proDepth: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0007072
|
||||
#Depth server: http://cospi.iiserpune.ac.in/depth/htdocs/index.html
|
||||
# needs biopython and msms
|
||||
#=======================================================================
|
||||
# Task: Residue Depth (rd) values for amino acid sequence using the
|
||||
# Depth server.
|
||||
# Depth server: http://cospi.iiserpune.ac.in/depth/htdocs/index.html
|
||||
# FIXME: for now input is a valid pdb code NOT a valid pdb file that you can upload
|
||||
# Input: PDB file (valid pdb code)
|
||||
|
||||
# load libraries
|
||||
# Output:
|
||||
|
||||
# useful links
|
||||
# http://foldxsuite.crg.eu/faq-page#
|
||||
# after fold x downlaoded, extract and run it from
|
||||
# https://biopython.org/DIST/docs/api/Bio.PDB.ResidueDepth%27-module.html
|
||||
# proDepth: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0007072
|
||||
# needs biopython and msms
|
||||
#=======================================================================
|
||||
#%% load packages
|
||||
import sys, os
|
||||
import re
|
||||
import pandas as pd
|
||||
from Bio.PDB.ResidueDepth import ResidueDepth
|
||||
from Bio.PDB.PDBParser import PDBParser
|
||||
from Bio.PDB.ResidueDepth import get_surface
|
||||
|
||||
#%%
|
||||
#%% specify input and output variables
|
||||
homedir = os.path.expanduser('~') # spyder/python doesn't recognise tilde
|
||||
|
||||
# set working dir
|
||||
os.getcwd()
|
||||
os.chdir(homedir + '/git/LSHTM_analysis/meta_data_analysis/struct_params')
|
||||
os.chdir(homedir + '/git/LSHTM_analysis/meta_data_analysis')
|
||||
os.getcwd()
|
||||
#%%
|
||||
#=======================================================================
|
||||
#%% variable assignment: input and output paths & filenames
|
||||
drug = 'pyrazinamide'
|
||||
gene = 'pncA'
|
||||
gene_match = gene + '_p.'
|
||||
|
||||
#==========
|
||||
# data dir
|
||||
#==========
|
||||
#indir = 'git/Data/pyrazinamide/input/original'
|
||||
datadir = homedir + '/' + 'git/Data'
|
||||
|
||||
#=======
|
||||
# input
|
||||
#=======
|
||||
indir = datadir + '/' + drug + '/' + 'input'
|
||||
in_filename = '3pl1.pdb'
|
||||
infile = indir + '/' + in_filename
|
||||
print('Input filename:', in_filename
|
||||
, '\nInput path:', indir)
|
||||
|
||||
#=======
|
||||
# output
|
||||
#=======
|
||||
outdir = datadir + '/' + drug + '/' + 'output'
|
||||
# specify output file
|
||||
out_filename = 'XXX'
|
||||
outfile = outdir + '/' + out_filename
|
||||
print('Output filename: ', out_filename
|
||||
, '\nOutput path: ', outdir)
|
||||
|
||||
#%% end of variable assignment for input and output files
|
||||
#================================================================
|
||||
# Read input pdb file
|
||||
parser = PDBParser()
|
||||
structure = parser.get_structure("3pl1", "/home/tanu/git/3pl1.pdb")
|
||||
|
||||
# extract the 3 letter pdb code
|
||||
pdb_code = re.search(r'(^[0-9]{1}\w{3})', in_filename).group(1)
|
||||
|
||||
#structure = parser.get_structure("3pl1", "/home/tanu/git/3pl1.pdb")
|
||||
structure = parser.get_structure(pdb_code, infile)
|
||||
model = structure[0]
|
||||
surface = get_surface(model)
|
||||
|
||||
|
@ -38,7 +88,7 @@ rd.property_keys
|
|||
baz = rd.property_list
|
||||
|
||||
|
||||
#To calculate the residue depth (average atom depth of the atoms in a residue):
|
||||
# To calculate the residue depth (average atom depth of the atoms in a residue):
|
||||
from Bio.PDB.ResidueDepth import residue_depth
|
||||
chain = model['A']
|
||||
res152 = chain[152]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue