# HG changeset patch # User fabio # Date 1523705638 14400 # Node ID 19ac771cf32a2ac8ce28434e2d5c9e499dd06fb0 # Parent 51e30a7f48c454baa9e93e56d2bf3f5515eba1ad Uploaded 20180414 diff -r 51e30a7f48c4 -r 19ac771cf32a ._.shed.yml Binary file ._.shed.yml has changed diff -r 51e30a7f48c4 -r 19ac771cf32a ._query.py Binary file ._query.py has changed diff -r 51e30a7f48c4 -r 19ac771cf32a ._query.xml Binary file ._query.xml has changed diff -r 51e30a7f48c4 -r 19ac771cf32a query.py --- a/query.py Fri Apr 13 07:51:35 2018 -0400 +++ b/query.py Sat Apr 14 07:33:58 2018 -0400 @@ -88,14 +88,23 @@ if type(hit) is dict: # sabutan #accessions_list = accessions_list + str(hit['accession_number']) + "\t" + str(hit['score']) + "\n"; accession_number = hit['accession_number']; + #------------ + #score = hit['score']; + #score_split = score.split("/"); + #accessions_dict[accession_number] = "{0:.6f}".format(float(score_split[0])/float(score_split[1])); + #------------ + fraction = hit['fraction']; score = hit['score']; - score_split = score.split("/"); - accessions_dict[accession_number] = "{0:.6f}".format(float(score_split[0])/float(score_split[1])); + accession_scores = { + "fraction": str(fraction), + "score": float(score) + } + accessions_dict[accession_number] = accession_scores; is_sabutan = True; else: # all-some accessions_list = accessions_list + str(hit) + "\n"; if is_sabutan: - sorted_accessions = sorted(accessions_dict, key=lambda i: float(accessions_dict[i])); + sorted_accessions = sorted(accessions_dict, key=lambda i: float(accessions_dict[i]["score"]), reverse=True); for acc in sorted_accessions: accessions_list = accessions_list + str(acc) + "\t" + str(accessions_dict[acc]) + "\n"; with open(output_file_path, 'w') as out: