res=sql_ask_database(conn,f"""SELECT chain_id from chain WHERE structure_id='{pdb_id}' AND chain_name='{pdb_chain_id}' AND rfam_acc IS NULL AND issue=0""")
ifnotlen(res):# the chain is NOT yet in the database, or this is a known issue
ifnotlen(res)orself.REUSE_ALL:# the chain is NOT yet in the database, or this is a known issue
families=[f.split('.')[1]forfinfiles]# The RFAM families this chain has been mapped onto
# Delete the chain from the database, and the associated nucleotides and re_mappings, using foreign keys
forfaminfamilies:
command=["sqlite3","results/RNANet.db",f"PRAGMA foreign_keys=ON; delete from chain where structure_id=\"{structure}\" and chain_name=\"{chain}\" and rfam_acc=\"{fam}\";"]
ifhomology:
families=[f.split('.')[1]forfinfiles]# The RFAM families this chain has been mapped onto
# Delete the chain from the database, and the associated nucleotides and re_mappings, using foreign keys
forfaminfamilies:
command=["sqlite3","results/RNANet.db",f"PRAGMA foreign_keys=ON; delete from chain where structure_id=\"{structure}\" and chain_name=\"{chain}\" and rfam_acc=\"{fam}\";"]
# Delete the chain from the database, and the associated nucleotides and re_mappings, using foreign keys
command=["sqlite3","results/RNANet.db",f"PRAGMA foreign_keys=ON; delete from chain where structure_id=\"{structure}\" and chain_name=\"{chain}\" and rfam_acc is null;"]
l=[x[0]forxinsql_ask_database(conn,f"SELECT COUNT(index_chain) FROM (SELECT chain_id FROM chain JOIN structure ON chain.structure_id = structure.pdb_id WHERE rfam_acc='{f}' AND resolution <= {res_thr}) NATURAL JOIN nucleotide GROUP BY chain_id;",warn_every=0)]
axs[1+i][1].hist(df_inferred_only_unique_m.resolution,bins=np.arange(0,max_res,0.5),fc=(0.2,0,colors[1+i],0.5),cumulative=True,label='only by inference')