Skip to content
Snippets Groups Projects
Commit e38fcd7a authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

method get_molecules

Former-commit-id: be15bd63263293acf0dbbe23e7ad4965ef7b4b10
parent 1e790032
No related branches found
No related tags found
No related merge requests found
......@@ -48,12 +48,12 @@ Return:
import os
import sys
import argparse
import textwrap
import logging
import time
from Bio.PDB import Select, PDBIO
from Bio.PDB.PDBParser import PDBParser
from argparse import RawTextHelpFormatter
import itertools
# =============================================================================
......@@ -140,10 +140,10 @@ def main(pdb, distance):
# Save each chain in different file
for chain in target_partner_chain:
io = PDBIO()
io.set_structure(model)
io.save('{}_{}.pdb'.format(pdb_code, chain), select = ChainSelection(chain),
#for chain in target_partner_chain:
io = PDBIO()
io.set_structure(model)
io.save('{}_{}.pdb'.format(pdb_code, chain), select = ChainSelection(target_partner_chain),
preserve_atom_numbering = True)
......@@ -153,11 +153,11 @@ def main(pdb, distance):
class ChainSelection(Select):
def __init__(self, chain):
self.chain = chain
def __init__(self, chains):
self.chains = chains
def accept_chain(self, chain):
if chain.get_id() == self.chain:
if chain.get_id() in self.chains:
return 1
else:
return 0
......@@ -297,21 +297,18 @@ def setlogger():
# =============================================================================
if __name__ == '__main__':
parser = argparse.ArgumentParser(description =
textwrap.dedent('''
parser = argparse.ArgumentParser(description = '''
1) Format protein/protein complex PDB structure (no ligand)
1.a) Number of models
1.b) Alternative atomic locations
1.c) Heteroatoms
2) Identify protein/protein interface residues
(for combinations of first chain of each protein)
3) Save each chain in separate files'''))
parser.add_argument('pdb', help =
textwrap.dedent(''' Input [.pdb file]: PBD 3D structure
(with HEADER included)'''))
parser.add_argument('-d', dest = 'distance', help =
textwrap.dedent('''Input [float or integer]: distance threshold
{by default, 6 Angstroms}'''))
3) Save each chain in separate files''', formatter_class=RawTextHelpFormatter)
parser.add_argument('pdb', help = '''Input [.pdb file]: PBD 3D structure
(with HEADER included)''')
parser.add_argument('-d', dest = 'distance', help = '''Input [float or integer]: distance threshold
{by default, 6 Angstroms}''')
options = parser.parse_args()
if options.distance is None:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment