Mercurial > repos > dfornika > kma_result_to_mlst
annotate kma_result_to_mlst.py @ 0:934f961a7189 draft default tip
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
author | dfornika |
---|---|
date | Thu, 31 Oct 2019 14:12:43 -0400 |
parents | |
children |
rev | line source |
---|---|
0
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
1 #!/usr/bin/env python |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
2 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
3 from __future__ import print_function |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
4 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
5 import argparse |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
6 import csv |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
7 import json |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
8 import os |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
9 import sys |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
10 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
11 from pprint import pprint |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
12 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
13 def parse_res_file(res_file_path): |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
14 LOCUS_ALLELE_DELIMITER = '_' |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
15 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
16 res_fieldnames = [ |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
17 'template', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
18 'score', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
19 'expected', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
20 'template_length', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
21 'template_identity', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
22 'template_coverage', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
23 'query_identity', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
24 'query_coverage', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
25 'depth', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
26 'q_value', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
27 'p_value', |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
28 ] |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
29 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
30 with open(res_file_path, 'r') as f: |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
31 loci = {} |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
32 reader = csv.DictReader(f, fieldnames=res_fieldnames, dialect="excel-tab") |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
33 next(reader) #skip header |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
34 for row in reader: |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
35 locus, allele = map(str.strip, row['template'].split(LOCUS_ALLELE_DELIMITER)) |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
36 if locus in loci: |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
37 loci[locus][allele] = { |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
38 'locus_id': locus, |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
39 'allele_id': allele, |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
40 'score': int(row['score'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
41 'expected': int(row['expected'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
42 'template_length': int(row['template_length'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
43 'template_identity': float(row['template_identity'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
44 'template_coverage': float(row['template_coverage'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
45 'query_identity': float(row['query_identity'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
46 'query_coverage': float(row['query_coverage'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
47 'depth': float(row['depth'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
48 'q_value': float(row['q_value'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
49 'p_value': float(row['p_value'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
50 } |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
51 else: |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
52 loci[locus] = {} |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
53 loci[locus][allele] = { |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
54 'locus_id': locus, |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
55 'allele_id': allele, |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
56 'score': int(row['score'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
57 'expected': int(row['expected'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
58 'template_length': int(row['template_length'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
59 'template_identity': float(row['template_identity'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
60 'template_coverage': float(row['template_coverage'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
61 'query_identity': float(row['query_identity'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
62 'query_coverage': float(row['query_coverage'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
63 'depth': float(row['depth'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
64 'q_value': float(row['q_value'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
65 'p_value': float(row['p_value'].strip()), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
66 } |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
67 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
68 return loci |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
69 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
70 def main(args): |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
71 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
72 loci = parse_res_file(args.res) |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
73 print("\t".join([ |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
74 "locus_id", |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
75 "allele_id", |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
76 "template_identity", |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
77 "template_coverage", |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
78 "depth", |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
79 ])) |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
80 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
81 for locus, alleles in loci.items(): |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
82 best_allele = sorted(alleles.values(), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
83 key=lambda x: x['score'], reverse=True)[0]['allele_id'] |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
84 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
85 print("\t".join([ |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
86 alleles[best_allele]['locus_id'], |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
87 alleles[best_allele]['allele_id'], |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
88 str(alleles[best_allele]['template_identity']), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
89 str(alleles[best_allele]['template_coverage']), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
90 str(alleles[best_allele]['depth']), |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
91 ])) |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
92 |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
93 if __name__ == '__main__': |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
94 parser = argparse.ArgumentParser() |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
95 parser.add_argument("--res", dest="res", help="KMA result overview file") |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
96 args = parser.parse_args() |
934f961a7189
"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/kma_result_to_mlst commit 62e7cd82cb9b209bf3f797ae288916e88bbe8bc6-dirty"
dfornika
parents:
diff
changeset
|
97 main(args) |