Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update full_seq_processor.py #23

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parapred/full_seq_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_CDR_simple(sequence ,allow=set(["H", "K", "L"]),scheme='chothia',seqname
elif num_tuple[0] in cdr3_scheme: cdr3+=res

# put in parapred formta
cdrs={'CDR1':cdr1,'CDR2':cdr2,'CDR3':cdr3}
cdrs={'CDR1':cdr1.replace('-',''),'CDR2':cdr2.replace('-',''),'CDR3':cdr3.replace('-','')}
return cdrs

class FakeSeq :
Expand Down
21 changes: 19 additions & 2 deletions parapred/parapred.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
from pandas import read_csv
import numpy as np
import pkg_resources
import sys
import traceback

from .structure_processor import get_structure_from_pdb, extract_cdrs_from_structure, \
residue_seq_to_one, produce_annotated_ab_structure, save_structure, aa_s, \
Expand Down Expand Up @@ -163,7 +165,14 @@ def process_multiple_pdbs(pdb_descr_file, pdb_folder):
pdb_name = pdb_name + ".pdb"

pdb_file = pdb_folder + "/" + pdb_name
process_single_pdb(pdb_file, ab_h_chain_id, ab_l_chain_id)
try:
process_single_pdb(pdb_file, ab_h_chain_id, ab_l_chain_id)
except Exception as e:
sys.stderr.write('\nSkipping {pdb_name} with erorr. \n')
sys.stderr.write("Error below:\n")
traceback.print_exc(file=sys.stderr)
sys.stderr.flush()
continue


def process_sequences(seqs):
Expand Down Expand Up @@ -206,7 +215,15 @@ def process_fasta_file(fastafile) :
sequences,_ = read_fasta(fastafile)
for srec in sequences :
print("\n> %s" % (srec.name))
process_full_VH_VL_sequence( str(srec.seq) )
try:
process_full_VH_VL_sequence( str(srec.seq) )
except Exception as e:
sys.stderr.write(f'\nErorr processing {srec.name}. Skipping\n')
sys.stderr.write("Error message below: \n")
traceback.print_exc(file=sys.stderr)
sys.stderr.flush()
continue



def main():
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cycler==0.10.0
docopt==0.6.2
h5py==2.6.0
Keras==2.0.6
matplotlib==2.0.0
nltk==3.2.2
numpy==1.13.1
packaging==16.8
Expand All @@ -20,7 +19,6 @@ scikit-learn==0.18.1
scipy==0.19.1
six==1.10.0
sklearn==0.0
tensorflow==1.2.1
Theano==0.9.0
docopt==0.6.2
setuptools-scm==1.15.6
Expand Down