Commit 281c9050 authored by Roman Sarrazin-Gendron's avatar Roman Sarrazin-Gendron
Browse files

started comparing to RMDetect

parent d0fa8292
......@@ -3,7 +3,7 @@ import networkx as nx
from matplotlib import pyplot as plt
#g = pickle.load(open("all_graphs_pickled/" + "1FFK" + ".nxpickled", "rb"))
PDBid = "1Q7Y.A"
PDBid = "1FJG.A"
#print("PDB")
#print(PDBid)
PDB, chain = PDBid.split(".")
......
......@@ -8,7 +8,13 @@ aligned_modulegraphs = pickle.load(open("../models/all_21+_rna3dmotif_106_aligne
PDB_positions = pickle.load(open("../models/all_21+_rna3dmotif_106_PDB_positions.cPickle", 'rb'))
PDBs = pickle.load(open("../models/all_21+_rna3dmotif_106_PDB_names.cPickle", 'rb'))
graphs = pickle.load(open("../models/all_21+_rna3dmotif_106_one_of_each_graph.cPickle", 'rb'))
module = 1
#aligned_modulegraphs = pickle.load(open("../models/all_full3_rna3dmotif_aligned_modulegraphs.cPickle", 'rb'))
#PDB_positions = pickle.load(open("../models/all_full3_rna3dmotif_PDB_positions.cPickle", 'rb'))
#PDBs = pickle.load(open("../models/all_full3_rna3dmotif_PDB_names.cPickle", 'rb'))
#graphs = pickle.load(open("../models/all_full3_rna3dmotif_one_of_each_graph.cPickle", 'rb'))
#print(len(graphs))
good_ones = [0, 3, 6, 8, 9, 12, 14, 15, 17, 19, 21, 22, 26, 27, 28, 30, 33, 34, 35, 36, 37, 39, 41, 42, 43, 46, 47, 48, 50, 52, 54, 58, 61, 64, 66, 69, 74, 75, 77, 80, 83, 84, 88, 90, 92, 95, 96, 97, 102, 104]
module = 0
aln = aligned_modulegraphs[module]
g = graphs[module]
......@@ -50,8 +56,8 @@ def get_seqs (g,aln,addresses):
else:
seqs[i] = seqs[i] + '-'
return seqs
print("ADDRESSES",addresses)
print("SEQS")
#print("ADDRESSES",addresses)
#print("SEQS")
seqs = get_seqs(g,aln,addresses)
print(seqs)
......@@ -131,20 +137,30 @@ with open("seq.fasta", "a") as f:
#print(a)
#a()
#alignment = SeqIO.parse("seq.fasta","fasta")
#SeqIO.write(alignment,open("module_"+str(module)+".stk","w"),"stockholm")
alignment = SeqIO.parse("seq.fasta","fasta")
SeqIO.write(alignment,open("module_"+str(module)+".stk","w"),"stockholm")
#cons = get_consensus_sequence(seqs)
print(graphs[module][2].nodes(data=True))
print(graphs[module][1].nodes(data=True))
ss= get_ss_from_graph(graphs[module][0])
print(ss)
print(PDBs[module][86])
print(PDB_positions[module][86])
print(PDBs[module][1])
print(PDB_positions[module][1])
seq,dec = get_PDB_sequence(".".join((PDBs[module][1].split(".")[:2])))
print(seq)
for pos,i in enumerate(PDBs[module][1:]):
#print(i)
seq,dec = get_PDB_sequence(".".join((i.split(".")[:2])))
if len(seq)>200:
print(pos, len(seq))
print(seq)
print(PDBs[module][pos])
print(PDB_positions[module][pos])
print("------")
#TEST : 86,5
me0=[]
rmdetect0="Never detects"
#for pos,i in enumerate(PDBs[module][1:]):
# #print(i)
# seq,dec = get_PDB_sequence(".".join((i.split(".")[:2])))
# print(pos, len(seq))
#TEST : 86
#python parse_sequences.py -d all_21+_rna3dmotif_106 -seq
me1 = [1,0,0]
rmdetect1 = [0,0,0]
......@@ -876,4 +876,5 @@ seq290 CUUCGG
seq291 CUUCGG
#=GS seq291 AC seq291
#=GS seq291 DE seq291
REF_SEQ CGACGAG
//
import pickle
import numpy as np
import matplotlib.pyplot as plt
from altair import *
#from altair import *
import matplotlib.patches as mpatches
import networkx as nx
ALL_RESULTS = []
the_100 = [0, 1, 2, 3, 5, 6, 7, 10, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 115, 116, 117, 118, 119, 121, 122, 123, 124, 126, 127, 128]
print(len(the_100))
excellent = [0, 3, 7, 12, 13, 16, 21, 22, 24, 26, 30, 31, 35, 36, 37, 39, 43, 44, 45, 46, 47, 50, 53, 54, 55, 59, 60, 61, 63, 65, 67, 72, 76, 79, 81, 86, 92, 93, 95, 98, 101, 104, 108, 110, 112, 116, 117, 118, 124, 127]
failed = [8,10,13,16]
pretty_bad = [10, 15, 20, 29, 32, 34, 42, 49, 58, 69, 80, 88, 97, 100, 105, 109, 111, 125, 126, 128]
NUL = [8, 10, 13, 16, 15, 20, 42, 80, 97, 100, 109]
failed =pretty_bad
excellent_100=[]
decale = 0
for i in range(the_100[-1]+1):
if i in excellent:
excellent_100.append(i-decale)
if i not in the_100:
decale=decale+1
print(len(excellent_100))
print(excellent_100)
exit()
'''
graphs = pickle.load(open("../models/all_full3_rna3dmotif_one_of_each_graph.cPickle","rb"))
total = 0
......@@ -246,4 +259,4 @@ plt.xlabel("Precision")
plt.ylabel("Counts")
plt.show()
print("EXCELLENT")
print(excellent)
\ No newline at end of file
print(excellent)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment