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

changed a couple things

parent 31c4083e
......@@ -97,7 +97,7 @@ def parse_sequence(seq,modules,ss,dataset,left_out,sm=0.25, mc=0,k=5000):
return_dict[mod] = [this_score,constraints]
return return_dict
def returner(scores,seq,ss="",m=8,n=7):
def returner(scores,seq,ss="",m=4,n=4):
if ss=="":
maxs = []
for i in scores.keys():
......
......@@ -447,7 +447,7 @@ def seq_to_struct(
space = 0
else:
space = space + 1
n_subs = int(len(positions)/3) + mc +2
n_subs = int(len(positions)/3) + mc
res = []
re_call = '(' + re_call
re_call = r"(?V1)" + re_call
......
......@@ -8,7 +8,7 @@ from Bio import SeqIO
import argparse
def run_BP(seq,ss,modules_to_parse,dataset, left_out,m=8,n=7,sm=0.2,mc=3,k=5000):
def run_BP(seq,ss,modules_to_parse,dataset, left_out,m=4,n=4,sm=0.2,mc=3,k=5000):
return_dict = BayesPairing.parse_sequence(seq, modules_to_parse, "",dataset, left_out,sm,mc,k)
maxs = BayesPairing.returner(return_dict,seq,ss)
return maxs
......@@ -18,11 +18,11 @@ def run_fasta(input, modules_to_parse,dataset,ss = "",arguments={}):
if "m" in arguments:
m=arguments["m"]
else:
m=8
m=4
if "n" in arguments:
n = arguments["n"]
else:
n = 7
n =4
if "sm" in arguments:
sm=arguments["sm"]
else:
......@@ -68,16 +68,19 @@ def run_fasta(input, modules_to_parse,dataset,ss = "",arguments={}):
if "T" in input:
input = str(input).replace("T","U")
if len(input)<=300:
print("INPUT IS SHORT, RUNNING BAYESPAIRING")
maxs = run_BP(input, ss, modules_to_parse, dataset, "NONE",m,n,sm,mc,k)
print("FINAL RESULTS:")
print(maxs)
else:
all_maxes=[]
index = 0
while index+100<len(seq):
while index+100<len(input):
print("Running Bayespairing on sequence:",input[index:index+100])
maxs = run_BP(input[index:index+100], ss, modules_to_parse, dataset, "NONE",m,n,sm,mc,k)
#print(maxs)
all_maxes.append(maxs)
index=index+100
maxs = run_BP(input[index:], ss, modules_to_parse, dataset, "NONE",m,n,sm,mc,k)
all_maxes.append(maxs)
print("FINAL RESULTS:")
......@@ -132,5 +135,5 @@ if __name__ == "__main__":
#run_fasta(seq,range(len(graphs)),dataset,ss,arguments)
#run_fasta(seq,[0,1],dataset,ss,arguments)
run_fasta(seq,2,dataset,ss,arguments)
run_fasta(seq,[2],dataset,ss,arguments)
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