# This is part of DEPTH.
# DEPTH (Version: 2.0) computes the closest distance of a residue/atom to bulk solvent and predicts small molecule binding site of a protein.
# Copyright (C) 2013, Kuan Pern Tan, Nguyen Thanh Binh, Raghavan Varadarajan and M.S. Madhusudhan
#
# DEPTH is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# DEPTH 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 Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with DEPTH.  If not, see <http://www.gnu.org/licenses/>.

import sys
from PDB import *

fname = sys.argv[1]
mdl = PDB(fname)

binding_residues = []
for i in range(len(mdl)):
    if mdl.T(i) == 1:
        res = str(mdl.resSeq(i)) + ':' + mdl.chainID(i)
        if res not in binding_residues:
            binding_residues.append(res)
        # end if
    # end if
# end for

out = ' '.join(binding_residues)
print out
def find_quartiles(S):
	mid = median(S)
	lower = [t for t in S if t < mid]
	upper = [t for t in S if t > mid]
	return median(lower), mid, median(upper)
# end def

root = pred_fname.split('/')[-1]

# 1. check if length of pdb file and entropy file match
entropy_data = open(entropy_fname).read().strip().split('\n')[1:]
entropy_data = [line.split() for line in entropy_data]
mdl = PDB(pred_fname)

# 1.1 read depth prediction
prediction = [mdl.T(i) for i in range(len(mdl)) if mdl.name(i) == 'CA']
# 1.2 read entropies <- 
# entropies = [float(t[1]) for t in entropy_data]
# following 10 lines make up for NA value in entropies (for benchmarking set only <- with unannotated residues)
buffer_entropy = [t[1] for t in entropy_data]
u = mean_float(buffer_entropy)
entropies = []
for t in buffer_entropy:
	try:
		entropies.append(float(t))
	except ValueError:
		entropies.append(u)
	# end try
# end for

# normalization to prevent 0 (error in logarithm function)
Beispiel #3
0
        except KeyError:
            solsol_neighbours.update({sol2: [sol1]})
        # end try
    # end if
# end for

for key in solsol_neighbours:
    solsol_neighbours[key] = list(set(solsol_neighbours[key]))
# end for

solvents = mol_neighbours.keys()
residues = sol_neighbours.keys()

mdl = PDB(fname)
Pred = dict([[str(mdl.resSeq(i)) + ':' + mdl.chainID(i),
              max(mdl.T()[i], 0)] for i in range(len(mdl))])


def separate_by_chains(S):
    keys = list(set([res.split(':')[-1] for res in S]))
    chains = dict([[key, []] for key in keys])
    for res in S:
        key = res.split(':')[-1]
        chains[key].append(res)
    # end for
    return chains


# end def

# Assign primary probability measure to solvent