annotate lrn_risk.py @ 0:99e04eba4033 draft

Uploaded
author greg
date Thu, 27 Apr 2023 19:22:36 +0000
parents
children f98c92618a6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
99e04eba4033 Uploaded
greg
parents:
diff changeset
1 #!/usr/bin/env python
99e04eba4033 Uploaded
greg
parents:
diff changeset
2
99e04eba4033 Uploaded
greg
parents:
diff changeset
3 import argparse
99e04eba4033 Uploaded
greg
parents:
diff changeset
4
99e04eba4033 Uploaded
greg
parents:
diff changeset
5
99e04eba4033 Uploaded
greg
parents:
diff changeset
6 BLACKLIST_HEADER = ['Blacklisted Gene', 'Reason', 'Risk Category']
99e04eba4033 Uploaded
greg
parents:
diff changeset
7 VFDB_HEADER = ['Gene', 'Contig', '% Identity', '% Coverage', 'E-Value', 'Annotation', 'Comparison to Publicly Available Genomes']
99e04eba4033 Uploaded
greg
parents:
diff changeset
8
99e04eba4033 Uploaded
greg
parents:
diff changeset
9
99e04eba4033 Uploaded
greg
parents:
diff changeset
10 def get_species_from_gtdb(f):
99e04eba4033 Uploaded
greg
parents:
diff changeset
11 # get GTDB species
99e04eba4033 Uploaded
greg
parents:
diff changeset
12 # assumes there is one genome in the GTDB-Tk output file
99e04eba4033 Uploaded
greg
parents:
diff changeset
13 with open(f, 'r') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
14 for line in fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
15 if line.find('user_genome') < 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
16 items = line.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
17 tax = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
18 tax = tax.split(';')[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
19 # split on GTDB species tag
99e04eba4033 Uploaded
greg
parents:
diff changeset
20 tax = tax.split('s__')[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
21 if len(tax) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
22 tax = '(Unknown Species)'
99e04eba4033 Uploaded
greg
parents:
diff changeset
23 return tax
99e04eba4033 Uploaded
greg
parents:
diff changeset
24
99e04eba4033 Uploaded
greg
parents:
diff changeset
25
99e04eba4033 Uploaded
greg
parents:
diff changeset
26 def get_blast_genes(f):
99e04eba4033 Uploaded
greg
parents:
diff changeset
27 # reads genes detected via BLAST
99e04eba4033 Uploaded
greg
parents:
diff changeset
28 # BLAST header is as follows:
99e04eba4033 Uploaded
greg
parents:
diff changeset
29 # qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore nident qlen
99e04eba4033 Uploaded
greg
parents:
diff changeset
30 d = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
31 with open(f, 'r') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
32 for line in fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
33 items = line.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
34 gene = items[0]
99e04eba4033 Uploaded
greg
parents:
diff changeset
35 # contig = items[1]
99e04eba4033 Uploaded
greg
parents:
diff changeset
36 # pid = items[2]
99e04eba4033 Uploaded
greg
parents:
diff changeset
37 alen = items[3]
99e04eba4033 Uploaded
greg
parents:
diff changeset
38 # e = items[-4]
99e04eba4033 Uploaded
greg
parents:
diff changeset
39 qlen = items[-1]
99e04eba4033 Uploaded
greg
parents:
diff changeset
40 # calculate query coverage by dividing alignment length by query length
99e04eba4033 Uploaded
greg
parents:
diff changeset
41 qcov = round(float(alen) / float(qlen) * 100.0, 2)
99e04eba4033 Uploaded
greg
parents:
diff changeset
42 if gene not in d.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
43 d[gene] = []
99e04eba4033 Uploaded
greg
parents:
diff changeset
44 d[gene].append('%s\t%s' % (line, str(qcov)))
99e04eba4033 Uploaded
greg
parents:
diff changeset
45 return d
99e04eba4033 Uploaded
greg
parents:
diff changeset
46
99e04eba4033 Uploaded
greg
parents:
diff changeset
47
99e04eba4033 Uploaded
greg
parents:
diff changeset
48 def get_blacklist(v, b):
99e04eba4033 Uploaded
greg
parents:
diff changeset
49 # identify high-risk isolates based on blacklisted genes
99e04eba4033 Uploaded
greg
parents:
diff changeset
50 # blacklisted genes file contains two columns:
99e04eba4033 Uploaded
greg
parents:
diff changeset
51 # column 0=the gene name as it appears in the gene database
99e04eba4033 Uploaded
greg
parents:
diff changeset
52 # column 1=the reason why the gene was blacklisted, which will be reported
99e04eba4033 Uploaded
greg
parents:
diff changeset
53 # e.g., 'ANTHRAX TOXIN'
99e04eba4033 Uploaded
greg
parents:
diff changeset
54 bdict = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
55 with open(b, 'r') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
56 for line in fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
57 items = line.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
58 gene = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
59 val = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
60 bdict[gene] = val
99e04eba4033 Uploaded
greg
parents:
diff changeset
61 blacklist_present = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
62 for key in v.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
63 if key in bdict.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
64 val = bdict[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
65 blacklist_present[key] = val
99e04eba4033 Uploaded
greg
parents:
diff changeset
66 return blacklist_present
99e04eba4033 Uploaded
greg
parents:
diff changeset
67
99e04eba4033 Uploaded
greg
parents:
diff changeset
68
99e04eba4033 Uploaded
greg
parents:
diff changeset
69 def gene_dist(f, blast, gtdb):
99e04eba4033 Uploaded
greg
parents:
diff changeset
70 # get within-species prevalence of genes
99e04eba4033 Uploaded
greg
parents:
diff changeset
71 # for virulence factors (VFs): uses VFDB VFs detected via ABRicate's VFDB db
99e04eba4033 Uploaded
greg
parents:
diff changeset
72 # for AMR genes: uses AMR genes detected via ABRicate's ResFinder db
99e04eba4033 Uploaded
greg
parents:
diff changeset
73 # for VFs and AMR genes: genes were detected via ABRicate XXX
99e04eba4033 Uploaded
greg
parents:
diff changeset
74 # minimum nucleotide identity and coverage values >=80%
99e04eba4033 Uploaded
greg
parents:
diff changeset
75 # total of 61,161 genomes queried
99e04eba4033 Uploaded
greg
parents:
diff changeset
76 # takes VFDB or AMR gene distribution file as input (f)
99e04eba4033 Uploaded
greg
parents:
diff changeset
77 # BLAST file of VFDB or AMR genes (blast)
99e04eba4033 Uploaded
greg
parents:
diff changeset
78 # GTDB species (gtdb)
99e04eba4033 Uploaded
greg
parents:
diff changeset
79 # create dictionaries based on gene distribution
99e04eba4033 Uploaded
greg
parents:
diff changeset
80 d = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
81 annd = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
82 gtdbd = {}
99e04eba4033 Uploaded
greg
parents:
diff changeset
83 with open(f, 'r') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
84 for line in fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
85 items = line.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
86 tax = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
87 tax = tax.split('s__')[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
88 if len(tax) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
89 tax = '(Unknown Species)'
99e04eba4033 Uploaded
greg
parents:
diff changeset
90 gene = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
91 ann = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
92 denom = items[3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
93 d['%s___%s' % (tax, gene)] = line
99e04eba4033 Uploaded
greg
parents:
diff changeset
94 annd[gene] = ann
99e04eba4033 Uploaded
greg
parents:
diff changeset
95 gtdbd[tax] = denom
99e04eba4033 Uploaded
greg
parents:
diff changeset
96 # parse BLAST results
99e04eba4033 Uploaded
greg
parents:
diff changeset
97 finallines = []
99e04eba4033 Uploaded
greg
parents:
diff changeset
98 for key in blast.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
99 blastval = blast[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
100 for bv in blastval:
99e04eba4033 Uploaded
greg
parents:
diff changeset
101 testkey = '%s___%s' % (gtdb, key)
99e04eba4033 Uploaded
greg
parents:
diff changeset
102 if testkey in d.keys() and gtdb != '(Unknown Species)':
99e04eba4033 Uploaded
greg
parents:
diff changeset
103 taxval = d[testkey]
99e04eba4033 Uploaded
greg
parents:
diff changeset
104 items = taxval.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
105 tax = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
106 tax = tax.split('s__')[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
107 if len(tax) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
108 tax = '(Unknown Species)'
99e04eba4033 Uploaded
greg
parents:
diff changeset
109 gene = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
110 pres = items[2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
111 denom = items[3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
112 perc = items[4].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
113 perc = str(round(float(perc), 2))
99e04eba4033 Uploaded
greg
parents:
diff changeset
114 ann = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
115 freetext = 'Gene {0} has been detected in {1}% of {2} genomes ({3} of {4} genomes queried)'.format(gene, perc, tax, pres, denom)
99e04eba4033 Uploaded
greg
parents:
diff changeset
116 elif gtdb != '(Unknown Species)':
99e04eba4033 Uploaded
greg
parents:
diff changeset
117 ann = annd[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
118 denom = gtdbd[gtdb]
99e04eba4033 Uploaded
greg
parents:
diff changeset
119 freetext = 'WARNING: Gene {0} ({1}) has never been detected in species {2} (n={3} genomes queried)! Interpret with caution!'.format(key, ann, gtdb, denom)
99e04eba4033 Uploaded
greg
parents:
diff changeset
120 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
121 ann = annd[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
122 freetext = 'WARNING: Genome belongs to an undescribed species. Interpret with caution!'
99e04eba4033 Uploaded
greg
parents:
diff changeset
123 finalline = '%s\t%s\t%s' % (bv, ann, freetext)
99e04eba4033 Uploaded
greg
parents:
diff changeset
124 finallines.append(finalline)
99e04eba4033 Uploaded
greg
parents:
diff changeset
125 return finallines
99e04eba4033 Uploaded
greg
parents:
diff changeset
126
99e04eba4033 Uploaded
greg
parents:
diff changeset
127
99e04eba4033 Uploaded
greg
parents:
diff changeset
128 def output_blacklist(blacklist, blacklist_output_file):
99e04eba4033 Uploaded
greg
parents:
diff changeset
129 # takes detected blacklisted genes as input (blacklist)
99e04eba4033 Uploaded
greg
parents:
diff changeset
130 # blacklist results
99e04eba4033 Uploaded
greg
parents:
diff changeset
131 with open(blacklist_output_file, 'w') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
132 fh.write('%s\n' % '\t'.join(BLACKLIST_HEADER))
99e04eba4033 Uploaded
greg
parents:
diff changeset
133 if len(blacklist.keys()) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
134 # print this if no blacklisted genes are detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
135 fh.write('(No blacklisted genes detected)\tNA\tNot high risk\n')
99e04eba4033 Uploaded
greg
parents:
diff changeset
136 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
137 # print this if blacklisted genes are detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
138 # print a table with one row per detected blacklisted gene
99e04eba4033 Uploaded
greg
parents:
diff changeset
139 for key in blacklist.keys():
99e04eba4033 Uploaded
greg
parents:
diff changeset
140 val = blacklist[key]
99e04eba4033 Uploaded
greg
parents:
diff changeset
141 fh.write('%s\t%s\tHIGH RISK\n' % (key, val))
99e04eba4033 Uploaded
greg
parents:
diff changeset
142
99e04eba4033 Uploaded
greg
parents:
diff changeset
143
99e04eba4033 Uploaded
greg
parents:
diff changeset
144 def output_vfdb(vfdist, vfdb_output_file):
99e04eba4033 Uploaded
greg
parents:
diff changeset
145 # takes distribution of virulence factors as input (vfdist)
99e04eba4033 Uploaded
greg
parents:
diff changeset
146 # VFDB results
99e04eba4033 Uploaded
greg
parents:
diff changeset
147 with open(vfdb_output_file, 'w') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
148 fh.write('%s\n' % '\t'.join(VFDB_HEADER))
99e04eba4033 Uploaded
greg
parents:
diff changeset
149 if len(vfdist) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
150 # print this if no VFs detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
151 fh.write('%s\n' % '\t'.join(['(No VFs Detected)'] * 7))
99e04eba4033 Uploaded
greg
parents:
diff changeset
152 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
153 # print table of VFs if VFs detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
154 for vline in vfdist:
99e04eba4033 Uploaded
greg
parents:
diff changeset
155 # blast_header=['Gene', 'Contig', 'Percent (%) Nucleotide Identity', 'Alignment Length', 'Mismatches', 'Gaps', 'Query Start', 'Query End', 'Subject Start', 'Subject End', 'E-Value', 'Bit Score', 'Identical Matches', 'Query Length']
99e04eba4033 Uploaded
greg
parents:
diff changeset
156 # lc_header=['Query Coverage', 'Annotation', 'Comparison to Publicly Available Genomes']
99e04eba4033 Uploaded
greg
parents:
diff changeset
157 items = vline.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
158 vgene = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
159 vcontig = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
160 vid = items[2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
161 vcov = items[-3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
162 veval = items[-7].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
163 vann = items[-2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
164 vnotes = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
165 vfinal = [vgene, vcontig, vid, vcov, veval, vann, vnotes]
99e04eba4033 Uploaded
greg
parents:
diff changeset
166 vfinal = '\t'.join(vfinal).strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
167 fh.write('%s\n' % vfinal)
99e04eba4033 Uploaded
greg
parents:
diff changeset
168
99e04eba4033 Uploaded
greg
parents:
diff changeset
169
99e04eba4033 Uploaded
greg
parents:
diff changeset
170 def output_amr(amrdist, amr_output_file):
99e04eba4033 Uploaded
greg
parents:
diff changeset
171 # takes distribution of AMR genes as input (amrdist)
99e04eba4033 Uploaded
greg
parents:
diff changeset
172 # AMR results
99e04eba4033 Uploaded
greg
parents:
diff changeset
173 with open(amr_output_file, 'w') as fh:
99e04eba4033 Uploaded
greg
parents:
diff changeset
174 fh.write('%s\n' % '\t'.join(VFDB_HEADER))
99e04eba4033 Uploaded
greg
parents:
diff changeset
175 if len(amrdist) == 0:
99e04eba4033 Uploaded
greg
parents:
diff changeset
176 # print this if no AMR genes detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
177 fh.write('%s\n' % '\t'.join(['(No AMR Genes Detected)'] * 7))
99e04eba4033 Uploaded
greg
parents:
diff changeset
178 else:
99e04eba4033 Uploaded
greg
parents:
diff changeset
179 # print this if AMR genes detected
99e04eba4033 Uploaded
greg
parents:
diff changeset
180 for aline in amrdist:
99e04eba4033 Uploaded
greg
parents:
diff changeset
181 # blast_header=['Gene', 'Contig', 'Percent (%) Nucleotide Identity', 'Alignment Length', 'Mismatches', 'Gaps', 'Query Start', 'Query End', 'Subject Start', 'Subject End', 'E-Value', 'Bit Score', 'Identical Matches', 'Query Length']
99e04eba4033 Uploaded
greg
parents:
diff changeset
182 # lc_header=['Query Coverage', 'Annotation', 'Comparison to Publicly Available Genomes']
99e04eba4033 Uploaded
greg
parents:
diff changeset
183 items = aline.split('\t')
99e04eba4033 Uploaded
greg
parents:
diff changeset
184 agene = items[0].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
185 acontig = items[1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
186 aid = items[2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
187 acov = items[-3].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
188 aeval = items[-7].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
189 aann = items[-2].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
190 anotes = items[-1].strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
191 afinal = [agene, acontig, aid, acov, aeval, aann, anotes]
99e04eba4033 Uploaded
greg
parents:
diff changeset
192 afinal = '\t'.join(afinal).strip()
99e04eba4033 Uploaded
greg
parents:
diff changeset
193 fh.write('%s\n' % afinal)
99e04eba4033 Uploaded
greg
parents:
diff changeset
194
99e04eba4033 Uploaded
greg
parents:
diff changeset
195
99e04eba4033 Uploaded
greg
parents:
diff changeset
196 # lrnrisk_prototype arguments
99e04eba4033 Uploaded
greg
parents:
diff changeset
197 parser = argparse.ArgumentParser()
99e04eba4033 Uploaded
greg
parents:
diff changeset
198
99e04eba4033 Uploaded
greg
parents:
diff changeset
199 parser.add_argument('--gtdb_file', action='store', dest='gtdb_file', help='Path to gtdbtk tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
200 parser.add_argument('--virulence_factors_file', action='store', dest='virulence_factors_file', help='Path to tsv virulence factors file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
201 parser.add_argument('--amr_determinants_file', action='store', dest='amr_determinants_file', help='Path to AMR determinants tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
202 parser.add_argument('--blacklist_file', action='store', dest='blacklist_file', help='Path to blacklisted high-risk virulence factors tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
203 parser.add_argument('--vf_distribution_file', action='store', dest='vf_distribution_file', help='Path to virulence factor distribution tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
204 parser.add_argument('--amr_distribution_file', action='store', dest='amr_distribution_file', help='Path to AMR determinant distribution tsv file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
205 parser.add_argument('--blacklist_output_file', action='store', dest='blacklist_output_file', help='Path to blacklist output file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
206 parser.add_argument('--vfdb_output_file', action='store', dest='vfdb_output_file', help='Path to vfdb output file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
207 parser.add_argument('--amr_output_file', action='store', dest='amr_output_file', help='Path to amr output file')
99e04eba4033 Uploaded
greg
parents:
diff changeset
208
99e04eba4033 Uploaded
greg
parents:
diff changeset
209 # parse arguments and run pipeline
99e04eba4033 Uploaded
greg
parents:
diff changeset
210 args = parser.parse_args()
99e04eba4033 Uploaded
greg
parents:
diff changeset
211
99e04eba4033 Uploaded
greg
parents:
diff changeset
212 # print_output(blacklist, vf_distribution, amr_distribution, args.output, species)
99e04eba4033 Uploaded
greg
parents:
diff changeset
213 virulence_genes = get_blast_genes(args.virulence_factors_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
214 species = get_species_from_gtdb(args.gtdb_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
215
99e04eba4033 Uploaded
greg
parents:
diff changeset
216 blacklist = get_blacklist(virulence_genes, args.blacklist_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
217 output_blacklist(blacklist, args.blacklist_output_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
218
99e04eba4033 Uploaded
greg
parents:
diff changeset
219 vf_distribution = gene_dist(args.vf_distribution_file, virulence_genes, species)
99e04eba4033 Uploaded
greg
parents:
diff changeset
220 output_vfdb(vf_distribution, args.vfdb_output_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
221
99e04eba4033 Uploaded
greg
parents:
diff changeset
222 amr_genes = get_blast_genes(args.amr_determinants_file)
99e04eba4033 Uploaded
greg
parents:
diff changeset
223 amr_distribution = gene_dist(args.amr_distribution_file, amr_genes, species)
99e04eba4033 Uploaded
greg
parents:
diff changeset
224 output_amr(amr_distribution, args.amr_output_file)