Skip to content

Commit

Permalink
Fixed interactive FASTA input on backbone
Browse files Browse the repository at this point in the history
  • Loading branch information
jlgelpi committed Jul 28, 2024
1 parent 022b21d commit c49c1c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions biobb_structure_checking/commands/backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _backbone_fix_main_chain(strcheck, fix_main_bck, breaks_list, modeller_key,
return []

# Checking for canonical sequence
if not strcheck.strucm.sequence_data.has_canonical:
if not strcheck.strucm.sequence_data.has_canonical[0]:
read_ok = False
while not read_ok:
input_line = ParamInput(
Expand All @@ -231,7 +231,7 @@ def _backbone_fix_main_chain(strcheck, fix_main_bck, breaks_list, modeller_key,
strcheck.strucm,
False
)
strcheck.strucm.sequence_data.match_sequence_numbering()
strcheck.strucm.sequence_data.match_sequence_numbering(strcheck.strucm)

to_fix = [
rpair
Expand Down
6 changes: 4 additions & 2 deletions biobb_structure_checking/modelling/sequencedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ def read_canonical_seqs(self, strucm, cif_warn):
if cif_warn:
print("Warning: sequence data unavailable on cif data")
return True
print(self.data)

for mod in strucm.st:
if mod not in self.data:
if mod.id not in self.data:
self.data[mod.id] = {}
for index, chid in enumerate(chids):
for ch_id in chid.split(','):
Expand Down Expand Up @@ -205,7 +207,6 @@ def read_canonical_seqs(self, strucm, cif_warn):
self.data[mod.id][ch_id]['can'].features.append(
SeqFeature(FeatureLocation(1, len(seqs[index])))
)

# for chn in chids[i].split(','):
# if chn in strucm.chain_ids:
# self.data[ch_id]['chains'].append(chn)
Expand Down Expand Up @@ -330,6 +331,7 @@ def match_sequence_numbering(self, strucm):
# print(f"{self.has_canonical=} {mod.id=}")
if ch_id not in self.has_canonical.get(mod.id, []) or not self.has_canonical.get(mod.id, dict()).get(ch_id, []):
continue
print(ch_data)
frgs = ch_data['pdb']['frgs']
ch_data['pdb']['match_numbering'] = True
for nfrag, frag in enumerate(frgs):
Expand Down

0 comments on commit c49c1c2

Please sign in to comment.