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

Fixed multiple seqs, TODO fix windows

parent a0650d1a
......@@ -122,7 +122,8 @@ def get_stats(prediction_scores,modules_to_parse,threshold=-5):
for sequence in prediction_scores:
hit_dict = {}
n_sequences=n_sequences+1
for window in prediction_scores[sequence]:
#for window in prediction_scores[sequence]:
window = prediction_scores[sequence]
scored_positions = {}
#print(window)
for module in window:
......@@ -258,7 +259,7 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
if len(sequences[0]) < 3000:
maxs = run_BP(sequences, ss, modules_to_parse, dataset, "NONE", aln= aln, t= t, samplesize=samplesize, pretrained=pretrained, Lambda=Lambda, Theta=Theta, Delta=Delta, fuzzy=fuzzy, verbose=verbose, first_run=first_run)
first_run=False
prediction_scores[id] = [maxs]
prediction_scores[id] = maxs
if interm:
print(maxs)
......@@ -330,7 +331,7 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
if len(sequences[0]) < 3000:
maxs = run_BP(sequences, ss, modules_to_parse, dataset, "NONE", aln= aln, t= t, samplesize=samplesize, pretrained=pretrained, Lambda=Lambda, Theta=Theta, Delta=Delta, fuzzy=fuzzy, verbose=verbose, first_run=first_run)
first_run=False
prediction_scores[id] = [maxs]
prediction_scores[id] = maxs
if interm:
print(maxs)
......@@ -398,7 +399,7 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
first_run=False
if interm:
print(maxs)
prediction_scores[id] = [maxs]
prediction_scores[id] = maxs
else:
all_maxes = []
......@@ -452,7 +453,7 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
if len(seq)<300:
maxs = run_BP(seq, ss, modules_to_parse, dataset, "NONE", aln= aln, t= t, samplesize=samplesize, pretrained=pretrained, Lambda=Lambda, Theta=Theta, Delta=Delta, fuzzy=fuzzy, verbose=verbose, first_run=first_run)
first_run=False
prediction_scores[id] = [maxs]
prediction_scores[id] = maxs
else:
all_maxes = []
......@@ -573,8 +574,9 @@ def check_already_there(results, new_range, new_mod):
def present_output(all_maxes, threshold, offset=0):
OUTPUT_STRING = ""
output = []
for m in all_maxes:
#for m in all_maxes:
#print("all_maxes",m)
m = all_maxes
for current_module in sorted(m.keys()):
if len(m[current_module])<1:
continue
......@@ -708,8 +710,16 @@ if __name__ == "__main__":
print(toPrint)
#generate SVG
outName = arguments["o"]
for seqCounter,inputSeqKey in enumerate(list(all_results.keys())):
modules_in_svg, chef_ss = bp_chefs_choice(all_results[inputSeqKey],seqInfo[seqCounter],arguments["t"],arguments["o"])
if seqCounter>0:
finalName = outName+str(counter)
else:
finalName = outName
#print("THE HITS")
#print(all_results[inputSeqKey])
modules_in_svg, chef_ss = bp_chefs_choice(all_results[inputSeqKey],seqInfo[seqCounter],arguments["t"],finalName)
#now we need to fill svg hits
......
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