# expected data point 1 |--------------------------------| 154
#
l=df.iloc[-1,1]-df.iloc[0,1]+1# l is the length of chain from nt_resnum point of view.
ifl!=len(df['index_chain']):# if some residues are missing, len(df['index_chain']) < l
diff=set(range(l)).difference(df['nt_resnum']-resnum_start)# the rowIDs the missing nucleotides would have (rowID = index_chain - 1 = nt_resnum - resnum_start)
# expected data point 1 |--------------------------------| 154
#
ifdf.iloc[-1,1]-df.iloc[0,1]+1!=len(df['index_chain']):# if some residues are missing, len(df['index_chain']) < length of chain from nt_resnum point of view
resnum_start=int(df.nt_resnum[0])
diff=set(range(l)).difference(df['nt_resnum']-resnum_start)# the rowIDs the missing nucleotides would have (rowID = index_chain - 1 = nt_resnum - resnum_start)
print("\t> Saved",self.chain_label,f"annotations to database.\t\t{validsymb}",flush=True)
# Now load data from the CSV file
# Now load data from the database
self.seq="".join([x[0]forxinsql_ask_database(conn,f"SELECT nt_code from nucleotide WHERE chain_id = {self.db_chain_id} ORDER BY index_chain ASC;")])
self.seq_to_align="".join([x[0]forxinsql_ask_database(conn,f"SELECT nt_align_code from nucleotide WHERE chain_id = {self.db_chain_id} ORDER BY index_chain ASC;")])