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

attempt fix bug file w multiple sequences chef choice

parent 079c6366
......@@ -500,7 +500,7 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
if interm:
print(maxs)
fOUTPUT=fOUTPUT+present_output([maxs], t)+"\n"
prediction_scores = maxs
prediction_scores = {"input_seq":maxs}
pickle.dump(prediction_scores,open("../output/"+o+".pickle","wb"))
else:
all_maxes = []
......@@ -530,7 +530,7 @@ def run_fasta(input, modules_to_parse, dataset, ss="", arguments={}):
all_maxes.append(maxs)
fOUTPUT=fOUTPUT+present_output(all_maxes, t)+"\n"
prediction_scores = all_maxes
prediction_scores = {"input_seq":all_maxes}
pickle.dump(prediction_scores,open("../output/"+o+".pickle","wb"))
return fOUTPUT,sequences,prediction_scores
......@@ -701,25 +701,29 @@ if __name__ == "__main__":
#timer.sleep(5)
# executes BayesPairing on the sequence
if not arguments["aln"]:
all_svg_hits = {}
all_chef_ss = []
#run BP2 and print results
toPrint, seqInfo, all_results = run_fasta(seq, modules_to_check, dataset, ss, arguments)
print(toPrint)
#generate SVG
modules_in_svg, chef_ss = bp_chefs_choice(all_results,seq,arguments["t"],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"])
#now we need to fill svg hits
svg_hits = {}
for hit in modules_in_svg:
modID, modInfo = hit
if modID not in svg_hits:
svg_hits[modID]=[modInfo]
else:
svg_hits[modID].append(modInfo)
#now we need to fill svg hits
svg_hits = {}
for hit in modules_in_svg:
modID, modInfo = hit
if modID not in svg_hits:
svg_hits[modID]=[modInfo]
else:
svg_hits[modID].append(modInfo)
all_svg_hits[inputSeqKey] = svg_hits
all_chef_ss.append(chef_ss)
#enter data in json
output_dict = {"input": seq, "params": arguments, "chefs_choice_struct": chef_ss, "all_hits":all_results, "svg_hits" : svg_hits }
output_dict = {"input": seqInfo, "params": arguments, "chefs_choice_struct": all_chef_ss, "all_hits":all_results, "svg_hits" : all_svg_hits }
else: #if the input is an alignment, then no SVG
......
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