AMR 2.1.1.9126__py3-none-any.whl → 2.1.1.9128__py3-none-any.whl

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.
AMR/datasets.py CHANGED
@@ -19,6 +19,9 @@ r_lib_path = os.path.join(venv_path, "R_libs")
19
19
  os.makedirs(r_lib_path, exist_ok=True)
20
20
  # Set the R library path in .libPaths
21
21
  base = importr('base')
22
+ # Turn off warnings
23
+ base.options(warn = -1)
24
+
22
25
  base._libPaths(r_lib_path)
23
26
  r_amr_lib_path = base._libPaths()[0]
24
27
 
@@ -46,6 +49,9 @@ if r_amr_version != python_amr_version:
46
49
  except Exception as e:
47
50
  print(f"{BLUE}AMR:{RESET} Could not update: {e}{RESET}", flush=True)
48
51
 
52
+ # Restore warnings to default
53
+ base.options(warn = 0)
54
+
49
55
  print(f"{BLUE}AMR:{RESET} Setting up R environment and AMR datasets...", flush=True)
50
56
 
51
57
  # Activate the automatic conversion between R and pandas DataFrames
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: AMR
3
- Version: 2.1.1.9126
3
+ Version: 2.1.1.9128
4
4
  Summary: A Python wrapper for the AMR R package
5
5
  Home-page: https://github.com/msberends/AMR
6
6
  Author: Matthijs Berends
@@ -98,48 +98,6 @@ print(df)
98
98
 
99
99
  * **ab_name**: Similarly, this function standardises antimicrobial names. The different representations of ciprofloxacin (e.g., "Cipro", "CIP", "J01MA02", and "Ciproxin") are all converted to the standard name, "Ciprofloxacin".
100
100
 
101
-
102
- ## Taxonomic Data Sets Now in Python!
103
-
104
- As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antibiotics`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames:
105
-
106
- ```python
107
- AMR.microorganisms
108
- ```
109
-
110
- | mo | fullname | status | kingdom | gbif | gbif_parent | gbif_renamed_to | prevalence |
111
- |--------------|------------------------------------|----------|----------|-----------|-------------|-----------------|------------|
112
- | B_GRAMN | (unknown Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
113
- | B_GRAMP | (unknown Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
114
- | B_ANAER-NEG | (unknown anaerobic Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
115
- | B_ANAER-POS | (unknown anaerobic Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
116
- | B_ANAER | (unknown anaerobic bacteria) | unknown | Bacteria | None | None | None | 2.0 |
117
- | ... | ... | ... | ... | ... | ... | ... | ... |
118
- | B_ZYMMN_POMC | Zymomonas pomaceae | accepted | Bacteria | 10744418 | 3221412 | None | 2.0 |
119
- | B_ZYMPH | Zymophilus | synonym | Bacteria | None | 9475166 | None | 2.0 |
120
- | B_ZYMPH_PCVR | Zymophilus paucivorans | synonym | Bacteria | None | None | None | 2.0 |
121
- | B_ZYMPH_RFFN | Zymophilus raffinosivorans | synonym | Bacteria | None | None | None | 2.0 |
122
- | F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 |
123
-
124
- ```python
125
- AMR.antibiotics
126
- ```
127
-
128
- | ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units |
129
- |-----|-------------|----------------------|----------------------------|----------|------------|--------|----------|
130
- | AMA | 4649.0 | 4-aminosalicylic acid| Antimycobacterials | 12.00 | g | NaN | None |
131
- | ACM | 6450012.0 | Acetylmidecamycin | Macrolides/lincosamides | NaN | None | NaN | None |
132
- | ASP | 49787020.0 | Acetylspiramycin | Macrolides/lincosamides | NaN | None | NaN | None |
133
- | ALS | 8954.0 | Aldesulfone sodium | Other antibacterials | 0.33 | g | NaN | None |
134
- | AMK | 37768.0 | Amikacin | Aminoglycosides | NaN | None | 1.0 | g |
135
- | ... | ... | ... | ... | ... | ... | ... | ... |
136
- | VIR | 11979535.0 | Virginiamycine | Other antibacterials | NaN | None | NaN | None |
137
- | VOR | 71616.0 | Voriconazole | Antifungals/antimycotics | 0.40 | g | 0.4 | g |
138
- | XBR | 72144.0 | Xibornol | Other antibacterials | NaN | None | NaN | None |
139
- | ZID | 77846445.0 | Zidebactam | Other antibacterials | NaN | None | NaN | None |
140
- | ZFD | NaN | Zoliflodacin | None | NaN | None | NaN | None |
141
-
142
-
143
101
  ## Calculating AMR
144
102
 
145
103
  ```python
@@ -190,6 +148,47 @@ print(result2b)
190
148
 
191
149
  In this example, we generate an antibiogram by selecting various antibiotics.
192
150
 
151
+ ## Taxonomic Data Sets Now in Python!
152
+
153
+ As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antibiotics`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames:
154
+
155
+ ```python
156
+ AMR.microorganisms
157
+ ```
158
+
159
+ | mo | fullname | status | kingdom | gbif | gbif_parent | gbif_renamed_to | prevalence |
160
+ |--------------|------------------------------------|----------|----------|-----------|-------------|-----------------|------------|
161
+ | B_GRAMN | (unknown Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
162
+ | B_GRAMP | (unknown Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
163
+ | B_ANAER-NEG | (unknown anaerobic Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
164
+ | B_ANAER-POS | (unknown anaerobic Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
165
+ | B_ANAER | (unknown anaerobic bacteria) | unknown | Bacteria | None | None | None | 2.0 |
166
+ | ... | ... | ... | ... | ... | ... | ... | ... |
167
+ | B_ZYMMN_POMC | Zymomonas pomaceae | accepted | Bacteria | 10744418 | 3221412 | None | 2.0 |
168
+ | B_ZYMPH | Zymophilus | synonym | Bacteria | None | 9475166 | None | 2.0 |
169
+ | B_ZYMPH_PCVR | Zymophilus paucivorans | synonym | Bacteria | None | None | None | 2.0 |
170
+ | B_ZYMPH_RFFN | Zymophilus raffinosivorans | synonym | Bacteria | None | None | None | 2.0 |
171
+ | F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 |
172
+
173
+ ```python
174
+ AMR.antibiotics
175
+ ```
176
+
177
+ | ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units |
178
+ |-----|-------------|----------------------|----------------------------|----------|------------|--------|----------|
179
+ | AMA | 4649.0 | 4-aminosalicylic acid| Antimycobacterials | 12.00 | g | NaN | None |
180
+ | ACM | 6450012.0 | Acetylmidecamycin | Macrolides/lincosamides | NaN | None | NaN | None |
181
+ | ASP | 49787020.0 | Acetylspiramycin | Macrolides/lincosamides | NaN | None | NaN | None |
182
+ | ALS | 8954.0 | Aldesulfone sodium | Other antibacterials | 0.33 | g | NaN | None |
183
+ | AMK | 37768.0 | Amikacin | Aminoglycosides | NaN | None | 1.0 | g |
184
+ | ... | ... | ... | ... | ... | ... | ... | ... |
185
+ | VIR | 11979535.0 | Virginiamycine | Other antibacterials | NaN | None | NaN | None |
186
+ | VOR | 71616.0 | Voriconazole | Antifungals/antimycotics | 0.40 | g | 0.4 | g |
187
+ | XBR | 72144.0 | Xibornol | Other antibacterials | NaN | None | NaN | None |
188
+ | ZID | 77846445.0 | Zidebactam | Other antibacterials | NaN | None | NaN | None |
189
+ | ZFD | NaN | Zoliflodacin | None | NaN | None | NaN | None |
190
+
191
+
193
192
  # Conclusion
194
193
 
195
194
  With the `AMR` Python package, Python users can now effortlessly call R functions from the `AMR` R package. This eliminates the need for complex `rpy2` configurations and provides a clean, easy-to-use interface for antimicrobial resistance analysis. The examples provided above demonstrate how this can be applied to typical workflows, such as standardising microorganism and antimicrobial names or calculating resistance.
@@ -0,0 +1,7 @@
1
+ AMR/__init__.py,sha256=-3zoWVuhybnYkXePzljDrtcxxaAQscPpCPP75EiqLfQ,7540
2
+ AMR/datasets.py,sha256=tNLt7ERRxR-HYWD_gY6NwkMjdTIkg0bqtdi98U7sCyQ,2673
3
+ AMR/functions.py,sha256=JSh-0_mfrAj7ajpazlv2KFyEtRAglj7oQV9Iiaux7eo,45557
4
+ AMR-2.1.1.9128.dist-info/METADATA,sha256=QnZSp517HzD7Z-fb-IBsRM2Yl0rrcib0ikS4di8j2gE,9624
5
+ AMR-2.1.1.9128.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
6
+ AMR-2.1.1.9128.dist-info/top_level.txt,sha256=7K6Mq_X_OHdXOzQM5y06VUadXjYkze6yzufL1d7_6xc,4
7
+ AMR-2.1.1.9128.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- AMR/__init__.py,sha256=-3zoWVuhybnYkXePzljDrtcxxaAQscPpCPP75EiqLfQ,7540
2
- AMR/datasets.py,sha256=DtzZAmuaFK3H4LZIycEfCDS7BIY5iyNxDzfTj2bGsdU,2574
3
- AMR/functions.py,sha256=JSh-0_mfrAj7ajpazlv2KFyEtRAglj7oQV9Iiaux7eo,45557
4
- AMR-2.1.1.9126.dist-info/METADATA,sha256=3PIASuWvjNhLvT6r17T7tuTO_10GnMzk_EDNTgIUxUk,9625
5
- AMR-2.1.1.9126.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
6
- AMR-2.1.1.9126.dist-info/top_level.txt,sha256=7K6Mq_X_OHdXOzQM5y06VUadXjYkze6yzufL1d7_6xc,4
7
- AMR-2.1.1.9126.dist-info/RECORD,,