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: ...@@ -48,12 +48,12 @@ Return:
import os import os
import sys import sys
import argparse import argparse
import textwrap
import logging import logging
import time import time
from Bio.PDB import Select, PDBIO from Bio.PDB import Select, PDBIO
from Bio.PDB.PDBParser import PDBParser from Bio.PDB.PDBParser import PDBParser
from argparse import RawTextHelpFormatter
import itertools import itertools
# ============================================================================= # =============================================================================
...@@ -140,10 +140,10 @@ def main(pdb, distance): ...@@ -140,10 +140,10 @@ def main(pdb, distance):
# Save each chain in different file # Save each chain in different file
for chain in target_partner_chain: #for chain in target_partner_chain:
io = PDBIO() io = PDBIO()
io.set_structure(model) io.set_structure(model)
io.save('{}_{}.pdb'.format(pdb_code, chain), select = ChainSelection(chain), io.save('{}_{}.pdb'.format(pdb_code, chain), select = ChainSelection(target_partner_chain),
preserve_atom_numbering = True) preserve_atom_numbering = True)
...@@ -153,11 +153,11 @@ def main(pdb, distance): ...@@ -153,11 +153,11 @@ def main(pdb, distance):
class ChainSelection(Select): class ChainSelection(Select):
def __init__(self, chain): def __init__(self, chains):
self.chain = chain self.chains = chains
def accept_chain(self, chain): def accept_chain(self, chain):
if chain.get_id() == self.chain: if chain.get_id() in self.chains:
return 1 return 1
else: else:
return 0 return 0
...@@ -297,21 +297,18 @@ def setlogger(): ...@@ -297,21 +297,18 @@ def setlogger():
# ============================================================================= # =============================================================================
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser(description = parser = argparse.ArgumentParser(description = '''
textwrap.dedent('''
1) Format protein/protein complex PDB structure (no ligand) 1) Format protein/protein complex PDB structure (no ligand)
1.a) Number of models 1.a) Number of models
1.b) Alternative atomic locations 1.b) Alternative atomic locations
1.c) Heteroatoms 1.c) Heteroatoms
2) Identify protein/protein interface residues 2) Identify protein/protein interface residues
(for combinations of first chain of each protein) (for combinations of first chain of each protein)
3) Save each chain in separate files''')) 3) Save each chain in separate files''', formatter_class=RawTextHelpFormatter)
parser.add_argument('pdb', help = parser.add_argument('pdb', help = '''Input [.pdb file]: PBD 3D structure
textwrap.dedent(''' Input [.pdb file]: PBD 3D structure (with HEADER included)''')
(with HEADER included)''')) parser.add_argument('-d', dest = 'distance', help = '''Input [float or integer]: distance threshold
parser.add_argument('-d', dest = 'distance', help = {by default, 6 Angstroms}''')
textwrap.dedent('''Input [float or integer]: distance threshold
{by default, 6 Angstroms}'''))
options = parser.parse_args() options = parser.parse_args()
if options.distance is None: 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