Louis BECQUEY

removal of doubtful mappings from known mappings too

Showing 1 changed file with 10 additions and 1 deletions
...@@ -180,7 +180,10 @@ class Chain: ...@@ -180,7 +180,10 @@ class Chain:
180 self.db_chain_id = -1 # index of the RNA chain in the SQL database, table chain 180 self.db_chain_id = -1 # index of the RNA chain in the SQL database, table chain
181 181
182 def __str__(self): 182 def __str__(self):
183 - return self.pdb_id + '[' + str(self.pdb_model) + "]-" + self.pdb_chain_id 183 + if self.mapping is None:
184 + return self.pdb_id + '[' + str(self.pdb_model) + "]-" + self.pdb_chain_id
185 + else:
186 + return self.pdb_id + '[' + str(self.pdb_model) + "]-" + self.pdb_chain_id + "-" + self.mapping.rfam_acc
184 187
185 def __eq__(self, other): 188 def __eq__(self, other):
186 return self.chain_label == other.chain_label and str(self) == str(other) 189 return self.chain_label == other.chain_label and str(self) == str(other)
...@@ -2065,6 +2068,8 @@ def work_infer_mappings(update_only, allmappings, fullinference, redundant, code ...@@ -2065,6 +2068,8 @@ def work_infer_mappings(update_only, allmappings, fullinference, redundant, code
2065 newproblems.append(f"Found mappings to {rfam} in both directions on the same interval, keeping only the 5'->3' one.") 2068 newproblems.append(f"Found mappings to {rfam} in both directions on the same interval, keeping only the 5'->3' one.")
2066 else: 2069 else:
2067 newproblems.append(f"There are mappings for {rfam} in both directions, this is a clue that the hit is wrong. Ignoring it.") 2070 newproblems.append(f"There are mappings for {rfam} in both directions, this is a clue that the hit is wrong. Ignoring it.")
2071 + inferred_mappings = inferred_mappings.drop(index=inferred_mappings.index[thisfam_3_5 | thisfam_5_3])
2072 + known_mappings = known_mappings[known_mappings.rfam_acc != rfam]
2068 continue 2073 continue
2069 2074
2070 # Compute consensus for chains in 5' -> 3' sense 2075 # Compute consensus for chains in 5' -> 3' sense
...@@ -2811,6 +2816,10 @@ if __name__ == "__main__": ...@@ -2811,6 +2816,10 @@ if __name__ == "__main__":
2811 # If --all was passed, all the structures are kept. 2816 # If --all was passed, all the structures are kept.
2812 # Fills pp.update with Chain() objects. 2817 # Fills pp.update with Chain() objects.
2813 pp.list_available_mappings() 2818 pp.list_available_mappings()
2819 + for c in pp.update:
2820 + if "6ydw" in c.chain_label:
2821 + print(c)
2822 + exit(1)
2814 2823
2815 # =========================================================================== 2824 # ===========================================================================
2816 # 3D information 2825 # 3D information
......