diff --git a/biobb_structure_checking/commands/backbone.py b/biobb_structure_checking/commands/backbone.py index 864c77e2..9167bbda 100644 --- a/biobb_structure_checking/commands/backbone.py +++ b/biobb_structure_checking/commands/backbone.py @@ -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( @@ -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 diff --git a/biobb_structure_checking/modelling/sequencedata.py b/biobb_structure_checking/modelling/sequencedata.py index 6d45bc1d..ca779fe3 100644 --- a/biobb_structure_checking/modelling/sequencedata.py +++ b/biobb_structure_checking/modelling/sequencedata.py @@ -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(','): @@ -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) @@ -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):