hAMRonization 1.1.9__tar.gz → 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {hamronization-1.1.9 → hamronization-1.2.1}/PKG-INFO +13 -10
  2. {hamronization-1.1.9 → hamronization-1.2.1}/README.md +5 -4
  3. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/Interfaces.py +1 -1
  4. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/ResFinderIO.py +62 -43
  5. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/__init__.py +1 -1
  6. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/hamronize.py +1 -1
  7. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/summarize.py +11 -2
  8. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization.egg-info/PKG-INFO +13 -10
  9. {hamronization-1.1.9 → hamronization-1.2.1}/setup.py +6 -4
  10. {hamronization-1.1.9 → hamronization-1.2.1}/test/test_parsing_validity.py +5 -8
  11. {hamronization-1.1.9 → hamronization-1.2.1}/LICENSE.txt +0 -0
  12. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/AbricateIO.py +0 -0
  13. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/AmrFinderPlusIO.py +0 -0
  14. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/AmrPlusPlusIO.py +0 -0
  15. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/AribaIO.py +0 -0
  16. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/CSStarIO.py +0 -0
  17. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/DeepArgIO.py +0 -0
  18. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/FARGeneIO.py +0 -0
  19. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/GrootIO.py +0 -0
  20. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/KmerResistanceIO.py +0 -0
  21. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/MykrobeIO.py +0 -0
  22. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/ResFamsIO.py +0 -0
  23. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/RgiIO.py +0 -0
  24. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/SraxIO.py +0 -0
  25. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/Srst2IO.py +0 -0
  26. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/StarAmrIO.py +0 -0
  27. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/TBProfilerIO.py +0 -0
  28. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/constants.py +0 -0
  29. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization/hAMRonizedResult.py +0 -0
  30. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization.egg-info/SOURCES.txt +0 -0
  31. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization.egg-info/dependency_links.txt +0 -0
  32. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization.egg-info/entry_points.txt +0 -0
  33. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization.egg-info/requires.txt +0 -0
  34. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization.egg-info/top_level.txt +0 -0
  35. {hamronization-1.1.9 → hamronization-1.2.1}/hAMRonization.egg-info/zip-safe +0 -0
  36. {hamronization-1.1.9 → hamronization-1.2.1}/setup.cfg +0 -0
  37. {hamronization-1.1.9 → hamronization-1.2.1}/test/test_interfaces.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hAMRonization
3
- Version: 1.1.9
3
+ Version: 1.2.1
4
4
  Summary: Tool to convert and summarize AMR gene detection outputs using the hAMRonization specification
5
5
  Home-page: https://github.com/pha4ge/hAMRonization
6
- Download-URL: https://github.com/pha4ge/archive/v1.1.9.tar.gz
6
+ Download-URL: https://github.com/pha4ge/archive/v1.2.1.tar.gz
7
7
  Author: Finlay Maguire
8
8
  Author-email: finlaymaguire@gmail.com
9
9
  License: LGPLv3
@@ -16,13 +16,15 @@ Classifier: Operating System :: MacOS
16
16
  Classifier: Operating System :: POSIX
17
17
  Classifier: Operating System :: POSIX :: Linux
18
18
  Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.7
20
- Classifier: Programming Language :: Python :: 3.8
21
- Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Classifier: Intended Audience :: Science/Research
23
25
  Classifier: Intended Audience :: Healthcare Industry
24
26
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
25
- Requires-Python: >=3.7
27
+ Requires-Python: >=3.10
26
28
  Description-Content-Type: text/markdown
27
29
  License-File: LICENSE.txt
28
30
  Requires-Dist: pandas
@@ -61,7 +63,7 @@ This supports a variety of summary options including an [interactive summary](ht
61
63
 
62
64
  ## Installation
63
65
 
64
- This tool requires python>=3.7 and [pandas](https://pandas.pydata.org/)
66
+ This tool requires python>=3.9 and [pandas](https://pandas.pydata.org/)
65
67
  and the latest release can be installed directly from pip, conda, docker, this repository, or from the galaxy toolshed:
66
68
  ```
67
69
  pip install hAMRonization
@@ -72,16 +74,17 @@ pip install hAMRonization
72
74
  Or
73
75
 
74
76
  ```
75
- conda create --name hamronization --channel conda-forge --channel bioconda --channel defaults hamronization
77
+ conda create --name hamronization --channel conda-forge --channel bioconda hamronization
76
78
  ```
77
79
  ![version-on-conda](https://anaconda.org/bioconda/hamronization/badges/version.svg)
78
80
  ![conda-download](https://anaconda.org/bioconda/hamronization/badges/downloads.svg)
79
81
  ![last-update-on-conda](https://anaconda.org/bioconda/hamronization/badges/latest_release_date.svg)
80
82
 
81
83
 
82
- Or to install using docker:
84
+ Or to install and run using docker, podman, singularity:
83
85
  ```
84
- docker pull finlaymaguire/hamronization:latest
86
+ docker pull docker.io/finlaymaguire/hamronization:latest
87
+ docker run --rm docker.io/finlaymaguire/hamronization:latest hamronize --help
85
88
  ```
86
89
 
87
90
  Or to install the latest development version:
@@ -19,7 +19,7 @@ This supports a variety of summary options including an [interactive summary](ht
19
19
 
20
20
  ## Installation
21
21
 
22
- This tool requires python>=3.7 and [pandas](https://pandas.pydata.org/)
22
+ This tool requires python>=3.9 and [pandas](https://pandas.pydata.org/)
23
23
  and the latest release can be installed directly from pip, conda, docker, this repository, or from the galaxy toolshed:
24
24
  ```
25
25
  pip install hAMRonization
@@ -30,16 +30,17 @@ pip install hAMRonization
30
30
  Or
31
31
 
32
32
  ```
33
- conda create --name hamronization --channel conda-forge --channel bioconda --channel defaults hamronization
33
+ conda create --name hamronization --channel conda-forge --channel bioconda hamronization
34
34
  ```
35
35
  ![version-on-conda](https://anaconda.org/bioconda/hamronization/badges/version.svg)
36
36
  ![conda-download](https://anaconda.org/bioconda/hamronization/badges/downloads.svg)
37
37
  ![last-update-on-conda](https://anaconda.org/bioconda/hamronization/badges/latest_release_date.svg)
38
38
 
39
39
 
40
- Or to install using docker:
40
+ Or to install and run using docker, podman, singularity:
41
41
  ```
42
- docker pull finlaymaguire/hamronization:latest
42
+ docker pull docker.io/finlaymaguire/hamronization:latest
43
+ docker run --rm docker.io/finlaymaguire/hamronization:latest hamronize --help
43
44
  ```
44
45
 
45
46
  Or to install the latest development version:
@@ -123,7 +123,7 @@ class hAMRonizedResultIterator(ABC):
123
123
  # to get first result to build csvwriter
124
124
  try:
125
125
  first_result = next(self)
126
- fieldnames = first_result.__annotations__.keys()
126
+ fieldnames = [f.name for f in dataclasses.fields(type(first_result))]
127
127
  writer = csv.DictWriter(
128
128
  out_fh,
129
129
  delimiter="\t",
@@ -26,7 +26,7 @@ class ResFinderIterator(hAMRonizedResultIterator):
26
26
  def __init__(self, source, metadata):
27
27
 
28
28
  # We don't use metadata or field mapping so can just defer to super,
29
- # which will open source and invoke our parse method with the open stream.
29
+ # which opens source and invokes our parse() on the open stream.
30
30
  super().__init__(source, dict(), metadata)
31
31
 
32
32
  def parse(self, handle):
@@ -42,7 +42,7 @@ class ResFinderIterator(hAMRonizedResultIterator):
42
42
  # Input data read in ResFinder 4.2+ JSON format. This has three main elements:
43
43
  # - seq_regions: loci/genes that were found, keying into 0 or more phenotypes
44
44
  # - seq_variations: mutations that key into a seq_region and 0 or more phenotypes
45
- # - phenotypes: antimicriobals keying back into the above objects
45
+ # - phenotypes: antimicrobials keying back into the above objects
46
46
  data = json.load(handle)
47
47
 
48
48
  # Helpers to fetch database names and versions from the JSON data
@@ -75,7 +75,7 @@ class ResFinderIterator(hAMRonizedResultIterator):
75
75
  res.input_gene_start = _get_start_pos(r.get('query_start_pos'), r.get('query_end_pos'))
76
76
  res.input_gene_stop = _get_end_pos(r.get('query_start_pos'), r.get('query_end_pos'))
77
77
  res.strand_orientation = _get_strand(r.get('query_start_pos'), r.get('query_end_pos'))
78
- res.predicted_phenotype = _empty_to_none(", ".join(r.get('phenotypes', [])))
78
+ res.predicted_phenotype = 'antimicrobial resistance' # we report only resistant phenotypes
79
79
  res.predicted_phenotype_confidence_level = _condense_notes(r.get('notes'), r.get('pmids'))
80
80
  res.reference_gene_length = r.get('ref_seq_length')
81
81
  res.reference_gene_start = r.get('ref_start_pos')
@@ -91,20 +91,19 @@ class ResFinderIterator(hAMRonizedResultIterator):
91
91
 
92
92
  # Setter for the hAMRonizedResult fields related to mutations
93
93
  def set_variation_fields(r, vs):
94
- """Sets the mutation-specific fields in res, aggregating from all variations in vs on region r."""
94
+ """Sets the mutation-specific fields in res, aggregating from all variations vs."""
95
95
 
96
96
  # Bags to collect variations, phenotypes and notes across the variations
97
97
  _aa_vars = list()
98
98
  _nt_vars = list()
99
- _codon = list()
100
- _phenos = set()
99
+ _codons = list()
101
100
  _notes = set()
102
101
  _pmids = set()
103
102
 
104
- # Iterate v over the variations in vs that lie on region r in order of their position
105
- # (variation->regions strangely is a list, so we need to check if r.key is in it)
106
- for v in sorted(filter(lambda v: r['key'] in v.get('seq_regions', []), vs),
107
- key=lambda v: v.get('ref_start_pos', 0)):
103
+ res.genetic_variation_type = NUCLEOTIDE_VARIANT
104
+
105
+ # Iterate v over the variations in vs in order of their position
106
+ for v in sorted(vs, key=lambda v: v.get('ref_start_pos', 0)):
108
107
 
109
108
  # May need refinement to properly accommodate inserts and deletes,
110
109
  # though it seems recent Res/PointFinder output uses HGVS coordinates.
@@ -117,19 +116,17 @@ class ResFinderIterator(hAMRonizedResultIterator):
117
116
 
118
117
  _cod_chg = v.get('codon_change')
119
118
  if _cod_chg:
120
- _codon.append(v.get('codon_change'))
119
+ _codons.append(_cod_chg)
121
120
 
122
121
  # Add the content of the list fields to the bags above
123
- _phenos.update(v.get('phenotypes', []))
124
122
  _notes.update(v.get('notes', []))
125
123
  _pmids.update(v.get('pmids', []))
126
124
 
127
125
  # We have collected all variations on region r, now collapse into fields on res
128
- res.predicted_phenotype = _empty_to_none(", ".join(filter(None, _phenos)))
129
126
  res.predicted_phenotype_confidence_level = _condense_notes(_notes, _pmids)
130
127
  res.amino_acid_mutation = _empty_to_none(", ".join(filter(None, _aa_vars)))
131
128
  res.nucleotide_mutation = _empty_to_none(", ".join(filter(None, _nt_vars)))
132
- res.nucleotide_mutation_interpretation = ("Codon changes: " + " ".join(_codon)) if _codon else None
129
+ res.nucleotide_mutation_interpretation = ("Codon changes: " + " ".join(_codons)) if _codons else None
133
130
 
134
131
  # --- Do the actual work --- #
135
132
 
@@ -138,42 +135,64 @@ class ResFinderIterator(hAMRonizedResultIterator):
138
135
  res.analysis_software_name = data['software_name']
139
136
  res.analysis_software_version = data['software_version']
140
137
 
141
- # We flatten the ResFinder data graph as follows
142
- # - iterate over all phenotypes p (generally: antimicrobials) that have amr_resistant=true
143
- # - iterate over the seq_regions r referenced by p (generally: resistance genes)
144
- # - for each r report a GENE_PRESENCE
145
- # - group the seq_variations referenced by p by the seq_region r they lie on
146
- # - iterate over the regions r
147
- # - for each r report one AMINO_ACID_VARIANT record, collapsing the seq_variations
148
- for p in filter(lambda d: d.get('amr_resistant', False), data['phenotypes'].values()):
149
-
150
- # Set the fields available on the phenotype object
151
- res.drug_class = ", ".join(p.get('amr_classes', []))
152
- res.antimicrobial_agent = p.get('amr_resistance', "unspecified")
153
-
154
- # Iterate r over the regions (AMR genes) referenced by p, and yield each in turn
155
- for r in map(lambda k: data['seq_regions'][k], p.get('seq_regions', [])):
156
-
138
+ # To obtain the AMR genes, we flatten the ResFinder data graph as follows
139
+ # - iterate over each region r
140
+ # - iterate over phenotypes p that reference region r and are amr_resistant
141
+ # - collect their amr_classes and antimicrobials
142
+ # - emit a GENE_PRESENCE record if any AMR was found
143
+ for r in data['seq_regions'].values():
144
+ amr_cls = set()
145
+ amr_res = set()
146
+
147
+ # Iterate p over the phenotypes that reference r and have amr_resistant set true
148
+ # and collect their AMR classes and antimicrobials
149
+ for p in filter(lambda p: r['key'] in p.get('seq_regions', [])
150
+ and p.get('amr_resistant', False), data['phenotypes'].values()):
151
+ amr_cls.update(p.get('amr_classes', []))
152
+ amr_res.add(p.get('amr_resistance', "unspecified"))
153
+
154
+ # If we collected any AMR we emit the region as a GENE_PRESENCE record
155
+ if amr_cls or amr_res:
156
+
157
+ # Set the fields collected from the phenotypes and from the region object
157
158
  res.genetic_variation_type = GENE_PRESENCE
159
+ res.drug_class = ", ".join(sorted(amr_cls))
160
+ res.antimicrobial_agent = ", ".join(sorted(amr_res))
158
161
  set_shared_fields(r)
159
162
 
160
- # Yield a new hAMRonizedResult ours using super's method as that may do the needful
163
+ # Yield a new hAMRonizedResult using super's method as that may do the needful
161
164
  yield self.hAMRonize(None, res.__dict__)
162
165
 
163
- # Collect the list of seq_variations (if any) referenced from phenotype p,
164
- # and the set of regions that these mutations lie on, so that we iterate
165
- # these regions and "collapse" all mutations for that region onto one record
166
- vs = list(map(lambda k: data['seq_variations'][k], p.get('seq_variations', [])))
167
- rs = set(fold(lambda a, v: a + v.get('seq_regions', []), [], vs))
168
-
169
- # Iterate r over each region referenced by some set of variations, and yield each
170
- for r in map(lambda k: data['seq_regions'][k], rs):
171
-
166
+ # For the variants things are slightly more involved, as phenotypes don't reference
167
+ # seq_regions directly, but through seq_variations. We have some indirection here.
168
+
169
+ for r in data['seq_regions'].values():
170
+ amr_cls = set()
171
+ amr_res = set()
172
+ vs_dict = dict()
173
+
174
+ # We want to collect all variations vs that reference region r AND are referenced
175
+ # by a phenotype p that is amr_resistant. Along the way we collect from the p
176
+ # the AMR classes and antimicriobials (to save us another iteration)
177
+ for v in filter(lambda v: r['key'] in v.get('seq_regions', []), data['seq_variations'].values()):
178
+ for p in filter(lambda p: v['key'] in p.get('seq_variations', [])
179
+ and (p.get('amr_classes') or p.get('amr_resistance'))
180
+ and p.get('amr_resistant', False), data['phenotypes'].values()):
181
+ amr_cls.update(p.get('amr_classes', []))
182
+ amr_res.add(p.get('amr_resistance', "unspecified"))
183
+ vs_dict[v['key']] = v # need to do this in inner loop but dups will squish
184
+
185
+ # If we collected variants with resistant phenotypes then emit a record
186
+ if vs_dict:
187
+
188
+ # Set fields we collected plus the region and variant ones as above
172
189
  res.genetic_variation_type = NUCLEOTIDE_VARIANT # default may be overridden
190
+ res.drug_class = ", ".join(sorted(amr_cls))
191
+ res.antimicrobial_agent = ", ".join(sorted(amr_res))
173
192
  set_shared_fields(r)
174
- set_variation_fields(r, vs)
193
+ set_variation_fields(r, vs_dict.values())
175
194
 
176
- # Yield a new hAMRonizedResult ours using super's method as that may do the needful
195
+ # Yield a new hAMRonizedResult using super's method as that may do the needful
177
196
  yield self.hAMRonize(None, res.__dict__)
178
197
 
179
198
 
@@ -209,7 +228,7 @@ def _condense_notes(notes, pmids):
209
228
  lines += filter(None, notes)
210
229
  pmids = list(filter(None, pmids))
211
230
  if pmids:
212
- lines.append("PMIDs: " + ", ".join(set(pmids)))
231
+ lines.append("PMIDs: " + ", ".join(sorted(set(pmids))))
213
232
  return ". ".join(lines) if lines else None
214
233
 
215
234
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
 
3
- __version__ = "1.1.9"
3
+ __version__ = "1.2.1"
4
4
 
5
5
  from hAMRonization import AbricateIO
6
6
  from hAMRonization import AmrFinderPlusIO
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env python
1
+ #!/usr/bin/env python3
2
2
 
3
3
  import hAMRonization
4
4
 
@@ -48,7 +48,7 @@ def format_interactive_json(combined_records):
48
48
 
49
49
  grouped_data = combined_records.groupby(
50
50
  ["input_file_name", "config_display_name"]
51
- ).apply(lambda x: x.to_json(orient="records"))
51
+ ).apply(lambda x: x.to_json(orient="records"), include_groups=False)
52
52
  for (input_file, config), hits in grouped_data.items():
53
53
  json_hits = json.loads(hits)
54
54
  if input_file not in data_for_summary:
@@ -733,7 +733,11 @@ def summarize_reports(report_paths, summary_type, output_path=None):
733
733
 
734
734
  # remove any duplicate entries in the parsed_report
735
735
  # set can't hash dictionaries unfortunately
736
- combined_reports = pd.concat(combined_report_data, ignore_index=True)
736
+ non_empty_reports = [report for report in combined_report_data if not report.empty]
737
+ if len(non_empty_reports) > 0:
738
+ combined_reports = pd.concat(non_empty_reports, ignore_index=True)
739
+ else:
740
+ combined_reports = pd.DataFrame(columns=combined_report_data[0].columns)
737
741
  total_records = len(combined_reports)
738
742
  combined_reports = combined_reports.drop_duplicates()
739
743
 
@@ -745,6 +749,11 @@ def summarize_reports(report_paths, summary_type, output_path=None):
745
749
  file=sys.stderr,
746
750
  )
747
751
 
752
+ # prevent columns of int type to be converted to float if they have NA values
753
+ # Fixes: https://github.com/zwets/hAMRonization/issues/1
754
+ # See: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.convert_dtypes.html
755
+ combined_reports = combined_reports.convert_dtypes()
756
+
748
757
  # sort records by input_file_name, tool_config i.e. toolname, version,
749
758
  # db_name, db_versions, and then within that by gene_symbol
750
759
  combined_reports = combined_reports.sort_values(
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hAMRonization
3
- Version: 1.1.9
3
+ Version: 1.2.1
4
4
  Summary: Tool to convert and summarize AMR gene detection outputs using the hAMRonization specification
5
5
  Home-page: https://github.com/pha4ge/hAMRonization
6
- Download-URL: https://github.com/pha4ge/archive/v1.1.9.tar.gz
6
+ Download-URL: https://github.com/pha4ge/archive/v1.2.1.tar.gz
7
7
  Author: Finlay Maguire
8
8
  Author-email: finlaymaguire@gmail.com
9
9
  License: LGPLv3
@@ -16,13 +16,15 @@ Classifier: Operating System :: MacOS
16
16
  Classifier: Operating System :: POSIX
17
17
  Classifier: Operating System :: POSIX :: Linux
18
18
  Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.7
20
- Classifier: Programming Language :: Python :: 3.8
21
- Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Classifier: Intended Audience :: Science/Research
23
25
  Classifier: Intended Audience :: Healthcare Industry
24
26
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
25
- Requires-Python: >=3.7
27
+ Requires-Python: >=3.10
26
28
  Description-Content-Type: text/markdown
27
29
  License-File: LICENSE.txt
28
30
  Requires-Dist: pandas
@@ -61,7 +63,7 @@ This supports a variety of summary options including an [interactive summary](ht
61
63
 
62
64
  ## Installation
63
65
 
64
- This tool requires python>=3.7 and [pandas](https://pandas.pydata.org/)
66
+ This tool requires python>=3.9 and [pandas](https://pandas.pydata.org/)
65
67
  and the latest release can be installed directly from pip, conda, docker, this repository, or from the galaxy toolshed:
66
68
  ```
67
69
  pip install hAMRonization
@@ -72,16 +74,17 @@ pip install hAMRonization
72
74
  Or
73
75
 
74
76
  ```
75
- conda create --name hamronization --channel conda-forge --channel bioconda --channel defaults hamronization
77
+ conda create --name hamronization --channel conda-forge --channel bioconda hamronization
76
78
  ```
77
79
  ![version-on-conda](https://anaconda.org/bioconda/hamronization/badges/version.svg)
78
80
  ![conda-download](https://anaconda.org/bioconda/hamronization/badges/downloads.svg)
79
81
  ![last-update-on-conda](https://anaconda.org/bioconda/hamronization/badges/latest_release_date.svg)
80
82
 
81
83
 
82
- Or to install using docker:
84
+ Or to install and run using docker, podman, singularity:
83
85
  ```
84
- docker pull finlaymaguire/hamronization:latest
86
+ docker pull docker.io/finlaymaguire/hamronization:latest
87
+ docker run --rm docker.io/finlaymaguire/hamronization:latest hamronize --help
85
88
  ```
86
89
 
87
90
  Or to install the latest development version:
@@ -22,7 +22,7 @@ setup(
22
22
  download_url=f"https://github.com/pha4ge/archive/v{version}.tar.gz",
23
23
  keywords=["Genomics", "Antimicrobial resistance", "Antibiotic",
24
24
  "Standardization"],
25
- python_requires='>=3.7',
25
+ python_requires='>=3.10',
26
26
  long_description=long_description,
27
27
  long_description_content_type="text/markdown",
28
28
  install_requires=['pandas'],
@@ -40,9 +40,11 @@ setup(
40
40
  "Operating System :: POSIX",
41
41
  "Operating System :: POSIX :: Linux",
42
42
  "Programming Language :: Python :: 3",
43
- "Programming Language :: Python :: 3.7",
44
- "Programming Language :: Python :: 3.8",
45
- "Programming Language :: Python :: 3.9",
43
+ "Programming Language :: Python :: 3.10",
44
+ "Programming Language :: Python :: 3.11",
45
+ "Programming Language :: Python :: 3.12",
46
+ "Programming Language :: Python :: 3.13",
47
+ "Programming Language :: Python :: 3.14",
46
48
  "Intended Audience :: Science/Research",
47
49
  "Intended Audience :: Healthcare Industry",
48
50
  "Topic :: Scientific/Engineering :: Bio-Informatics"
@@ -315,11 +315,8 @@ def test_resfinder():
315
315
  seen_genes += 1
316
316
 
317
317
  # it reports these 4 agents separately (even if all on one gene)
318
- assert (result.antimicrobial_agent, result.drug_class) in [
319
- ('ciprofloxacin', 'quinolone'),
320
- ('nalidixic acid', 'quinolone'),
321
- ('trimethoprim', 'folate pathway antagonist'),
322
- ('chloramphenicol', 'amphenicol')]
318
+ assert result.antimicrobial_agent == 'chloramphenicol, ciprofloxacin, nalidixic acid, trimethoprim'
319
+ assert result.drug_class == 'amphenicol, folate pathway antagonist, quinolone'
323
320
 
324
321
  # assert mandatory fields (5)
325
322
  assert result.gene_symbol == "OqxA"
@@ -329,7 +326,7 @@ def test_resfinder():
329
326
  assert result.reference_accession == "EU370913"
330
327
 
331
328
  # optional fields (12)
332
- assert result.predicted_phenotype == "ciprofloxacin, nalidixic acid, trimethoprim, chloramphenicol"
329
+ assert result.predicted_phenotype == "antimicrobial resistance"
333
330
  assert result.predicted_phenotype_confidence_level == (
334
331
  "Must be in an operon with oqxB," +
335
332
  "phenotype differs based on genomic location of the operon PMID 25801572," +
@@ -374,7 +371,7 @@ def test_resfinder():
374
371
  # optional fields (14)
375
372
  assert result.antimicrobial_agent == "ampicillin"
376
373
  assert result.drug_class == "beta-lactam"
377
- assert result.predicted_phenotype == "ampicillin"
374
+ assert result.predicted_phenotype == "antimicrobial resistance"
378
375
  assert result.predicted_phenotype_confidence_level == (
379
376
  "The nineteen pbp5 mutations must be present simultaneously " +
380
377
  "for resistance phenotype. PMIDs: 25182648")
@@ -414,7 +411,7 @@ def test_resfinder():
414
411
  assert result.genetic_variation_type is False # just to stop
415
412
 
416
413
  # Check that we saw all
417
- assert seen_genes == 4
414
+ assert seen_genes == 1
418
415
  assert seen_variants == 1
419
416
 
420
417
 
File without changes
File without changes