annotate screen_abricate_report.py @ 3:1c1c680c70a0 draft default tip

"planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
author dfornika
date Thu, 02 Jan 2020 21:04:04 +0000
parents 40003338a8e8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
1 #!/usr/bin/env python
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
2
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
3 from __future__ import print_function
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
4
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
5 import argparse
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
6 import csv
0
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
7 import re
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
8
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
9
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
10 class Range(object):
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
11 """
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
12 Used to limit the min_coverage and min_identity args to range 0.0 - 100.0
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
13 """
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
14 def __init__(self, start, end):
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
15 self.start = start
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
16 self.end = end
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
17
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
18 def __eq__(self, other):
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
19 return self.start <= other <= self.end
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
20
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
21 def __contains__(self, item):
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
22 return self.__eq__(item)
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
23
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
24 def __iter__(self):
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
25 yield self
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
26
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
27 def __repr__(self):
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
28 return str(self.start) + " - " + str(self.end)
0
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
29
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
30 def parse_screen_file(screen_file):
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
31 screen = []
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
32 with open(screen_file) as f:
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
33 reader = csv.DictReader(f, delimiter="\t", quotechar='"')
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
34 for row in reader:
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
35 screen.append(row)
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
36 return screen
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
37
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
38
1
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
39 def get_fieldnames(input_file):
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
40 with open(input_file) as f:
0
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
41 reader = csv.DictReader(f, delimiter="\t", quotechar='"')
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
42 row = next(reader)
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
43 fieldnames = row.keys()
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
44 return fieldnames
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
45
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
46 def detect_gene(abricate_report_row, regex, min_coverage, min_identity):
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
47 gene_of_interest = bool(re.search(regex, abricate_report_row['GENE']))
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
48 sufficient_coverage = float(abricate_report_row['%COVERAGE']) >= min_coverage
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
49 sufficient_identity = float(abricate_report_row['%IDENTITY']) >= min_identity
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
50 if gene_of_interest and sufficient_coverage and sufficient_identity:
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
51 return True
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
52 else:
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
53 return False
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
54
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
55
0
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
56 def main(args):
1
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
57 screen = parse_screen_file(args.screening_file)
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
58 gene_detection_status_fieldnames = ['gene_name', 'detected']
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
59 with open(args.abricate_report, 'r') as f1, \
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
60 open(args.screened_report, 'w') as f2, \
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
61 open(args.gene_detection_status, 'w') as f3:
1
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
62 abricate_report_reader = csv.DictReader(f1, delimiter="\t", quotechar='"')
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
63 screened_report_writer = csv.DictWriter(f2, delimiter="\t", quotechar='"',
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
64 fieldnames=abricate_report_reader.fieldnames)
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
65 gene_detection_status_writer = csv.DictWriter(f3, delimiter="\t", quotechar='"',
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
66 fieldnames=gene_detection_status_fieldnames)
1
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
67 screened_report_writer.writeheader()
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
68 gene_detection_status_writer.writeheader()
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
69
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
70 for gene in screen:
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
71 gene_detection_status = {
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
72 'gene_name': gene['gene_name'],
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
73 'detected': False
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
74 }
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
75 for abricate_report_row in abricate_report_reader:
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
76 if detect_gene(abricate_report_row, gene['regex'], args.min_coverage, args.min_identity):
1
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
77 gene_detection_status['detected'] = True
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
78 screened_report_writer.writerow(abricate_report_row)
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
79 gene_detection_status_writer.writerow(gene_detection_status)
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
80 f1.seek(0) # return file pointer to start of abricate report
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
81 next(abricate_report_reader)
0
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
82
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
83 if __name__ == '__main__':
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
84 parser = argparse.ArgumentParser()
1
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
85 parser.add_argument("abricate_report", help="Input: Abricate report to screen (tsv)")
40003338a8e8 planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents: 0
diff changeset
86 parser.add_argument("--screening_file", help="Input: List of genes to screen for (tsv)")
3
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
87 parser.add_argument("--screened_report", help=("Output: Screened abricate report, including only genes of interest (tsv)"))
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
88 parser.add_argument("--gene_detection_status", help=("Output: detection status for all genes listed in the screening file (tsv)"))
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
89 parser.add_argument("--min_coverage", type=float, default=90.0, choices=Range(0.0, 100.0), help=("Minimum percent coverage"))
1c1c680c70a0 "planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467-dirty"
dfornika
parents: 1
diff changeset
90 parser.add_argument("--min_identity", type=float, default=90.0, choices=Range(0.0, 100.0), help=("Minimum percent identity"))
0
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
91 args = parser.parse_args()
2ffd23634c1e planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/screen_abricate_report commit d9732cd3279d03dcc498bf2eb903f9e6120a9d85-dirty
dfornika
parents:
diff changeset
92 main(args)