Mercurial > repos > sanbi-uwc > assess_poliovirus_alignment
changeset 2:31ca16290d4f draft
planemo upload for repository https://github.com/pvanheus/polio_report commit a99e10fec2fac5aae70974c977eb3b362a1a8429-dirty
author | sanbi-uwc |
---|---|
date | Thu, 21 Jul 2022 16:43:16 +0000 |
parents | 9105ec016911 |
children | 52c2d2b7da6c |
files | assess_alignment.py assess_poliovirus_alignment.xml |
diffstat | 2 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/assess_alignment.py Tue Jul 19 11:57:09 2022 +0000 +++ b/assess_alignment.py Thu Jul 21 16:43:16 2022 +0000 @@ -106,7 +106,7 @@ if state == "M": # for mismatch store [pos_in_genome, pos_in_vp1, reference_base, sequenced_base] mismatch_list.append( - [i, i - offset, reference["align"][i], mismatch_bases[i]] + [i, i - offset + 1, reference["align"][i], mismatch_bases[i]] ) return [conflicts, matches, mismatches, mismatch_list] @@ -153,9 +153,10 @@ args = parser.parse_args() offsets = { - "poliovirus1sabin": 2480, - "poliovirus2sabin": 2482, - "poliovirus3sabin": 2477, + # these are in 0-based coordinates, so off-by-one from NCBI 1-based coordinates + "poliovirus1sabin": 2479, # V01150 + "poliovirus2sabin": 2481, # AY184220 + "poliovirus3sabin": 2478, # X00925 } lengths = { @@ -181,6 +182,7 @@ best_match_mismatch_list = mismatch_list best_match_quality = quality best_match_reference = dataset_name + percent_mismatches = round(min_mismatches / lengths[best_match_reference] * 100, 2) info = { "sample_name": args.sample_name, @@ -188,5 +190,6 @@ "mismatches": min_mismatches, "mismatch_list": best_match_mismatch_list, "quality": best_match_quality, + "perc_mismatches": percent_mismatches } json.dump(info, open(args.output_filename, "w"))
--- a/assess_poliovirus_alignment.xml Tue Jul 19 11:57:09 2022 +0000 +++ b/assess_poliovirus_alignment.xml Thu Jul 21 16:43:16 2022 +0000 @@ -1,4 +1,4 @@ -<tool id="assess_poliovirus_alignment" name="Assess poliovirus alignment" version="0.1.0+galaxy1" profile="21.05"> +<tool id="assess_poliovirus_alignment" name="Assess poliovirus alignment" version="0.2.0+galaxy0" profile="21.05"> <requirements> <requirement type="package" version="3.9">python</requirement> </requirements>