# Extract the angle values of c2'-endo and c3'-endo nucleotides
withsqlite3.connect("results/RNANet.db")asconn:
df=pd.read_sql(f"""SELECT {angle}, th{angle} FROM nucleotide WHERE puckering="C2'-endo" AND {angle} IS NOT NULL AND th{angle} IS NOT NULL;""",conn)
df=pd.read_sql(f"""SELECT {angle}, th{angle}
FROM nucleotide JOIN (
SELECT chain_id FROM chain JOIN structure
WHERE structure.resolution <= {res_thr}
) AS c
WHERE puckering="C2'-endo"
AND {angle} IS NOT NULL
AND th{angle} IS NOT NULL;""",conn)
c2_endo_etas=df[angle].values.tolist()
c2_endo_thetas=df["th"+angle].values.tolist()
df=pd.read_sql(f"""SELECT {angle}, th{angle} FROM nucleotide WHERE form = '.' AND puckering="C3'-endo" AND {angle} IS NOT NULL AND th{angle} IS NOT NULL;""",conn)
# sort the RNA families so that the plot is readable
deffamily_order(f):
iffinLSU_set:
return4
eliffinSSU_set:
return3
eliffin["RF00001"]:#
return1# put tRNAs and 5S rRNAs first,
eliffin["RF00005"]:# because of the logarithmic scale, otherwise, they look tiny
return0#
else:
return2
fam_list.sort(key=family_order)
cols=[]
lengths=[]
...
...
@@ -204,8 +231,8 @@ def stats_len():
# Get the lengths of chains
withsqlite3.connect("results/RNANet.db")asconn:
l=[x[0]forxinsql_ask_database(conn,f"SELECT COUNT(index_chain) FROM (SELECT chain_id FROM chain WHERE rfam_acc='{f}') NATURAL JOIN nucleotide GROUP BY chain_id;",warn_every=0)]
lengths.append(l)
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)]
lengths.append(l)# list of chain lengths from the family