AMR 2.1.1.9094__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/__init__.py ADDED
@@ -0,0 +1,201 @@
1
+ from .datasets import example_isolates
2
+ from .datasets import microorganisms
3
+ from .datasets import antibiotics
4
+ from .datasets import clinical_breakpoints
5
+ from .functions import ab_from_text
6
+ from .functions import ab_name
7
+ from .functions import ab_cid
8
+ from .functions import ab_synonyms
9
+ from .functions import ab_tradenames
10
+ from .functions import ab_group
11
+ from .functions import ab_atc
12
+ from .functions import ab_atc_group1
13
+ from .functions import ab_atc_group2
14
+ from .functions import ab_loinc
15
+ from .functions import ab_ddd
16
+ from .functions import ab_ddd_units
17
+ from .functions import ab_info
18
+ from .functions import ab_url
19
+ from .functions import ab_property
20
+ from .functions import add_custom_antimicrobials
21
+ from .functions import clear_custom_antimicrobials
22
+ from .functions import add_custom_microorganisms
23
+ from .functions import clear_custom_microorganisms
24
+ from .functions import age
25
+ from .functions import age_groups
26
+ from .functions import antibiogram
27
+ from .functions import ab_class
28
+ from .functions import ab_selector
29
+ from .functions import aminoglycosides
30
+ from .functions import aminopenicillins
31
+ from .functions import antifungals
32
+ from .functions import antimycobacterials
33
+ from .functions import betalactams
34
+ from .functions import carbapenems
35
+ from .functions import cephalosporins
36
+ from .functions import cephalosporins_1st
37
+ from .functions import cephalosporins_2nd
38
+ from .functions import cephalosporins_3rd
39
+ from .functions import cephalosporins_4th
40
+ from .functions import cephalosporins_5th
41
+ from .functions import fluoroquinolones
42
+ from .functions import glycopeptides
43
+ from .functions import lincosamides
44
+ from .functions import lipoglycopeptides
45
+ from .functions import macrolides
46
+ from .functions import nitrofurans
47
+ from .functions import oxazolidinones
48
+ from .functions import penicillins
49
+ from .functions import polymyxins
50
+ from .functions import quinolones
51
+ from .functions import rifamycins
52
+ from .functions import streptogramins
53
+ from .functions import tetracyclines
54
+ from .functions import trimethoprims
55
+ from .functions import ureidopenicillins
56
+ from .functions import administrable_per_os
57
+ from .functions import administrable_iv
58
+ from .functions import not_intrinsic_resistant
59
+ from .functions import as_ab
60
+ from .functions import is_ab
61
+ from .functions import as_av
62
+ from .functions import is_av
63
+ from .functions import as_disk
64
+ from .functions import is_disk
65
+ from .functions import as_mic
66
+ from .functions import is_mic
67
+ from .functions import rescale_mic
68
+ from .functions import as_mo
69
+ from .functions import is_mo
70
+ from .functions import mo_uncertainties
71
+ from .functions import mo_renamed
72
+ from .functions import mo_failures
73
+ from .functions import mo_reset_session
74
+ from .functions import mo_cleaning_regex
75
+ from .functions import as_sir
76
+ from .functions import is_sir
77
+ from .functions import is_sir_eligible
78
+ from .functions import sir_interpretation_history
79
+ from .functions import atc_online_property
80
+ from .functions import atc_online_groups
81
+ from .functions import atc_online_ddd
82
+ from .functions import atc_online_ddd_units
83
+ from .functions import av_from_text
84
+ from .functions import av_name
85
+ from .functions import av_cid
86
+ from .functions import av_synonyms
87
+ from .functions import av_tradenames
88
+ from .functions import av_group
89
+ from .functions import av_atc
90
+ from .functions import av_loinc
91
+ from .functions import av_ddd
92
+ from .functions import av_ddd_units
93
+ from .functions import av_info
94
+ from .functions import av_url
95
+ from .functions import av_property
96
+ from .functions import availability
97
+ from .functions import bug_drug_combinations
98
+ from .functions import count_resistant
99
+ from .functions import count_susceptible
100
+ from .functions import count_S
101
+ from .functions import count_SI
102
+ from .functions import count_I
103
+ from .functions import count_IR
104
+ from .functions import count_R
105
+ from .functions import count_all
106
+ from .functions import n_sir
107
+ from .functions import count_df
108
+ from .functions import custom_eucast_rules
109
+ from .functions import eucast_rules
110
+ from .functions import eucast_dosage
111
+ from .functions import export_ncbi_biosample
112
+ from .functions import first_isolate
113
+ from .functions import filter_first_isolate
114
+ from .functions import g_test
115
+ from .functions import is_new_episode
116
+ from .functions import ggplot_pca
117
+ from .functions import ggplot_sir
118
+ from .functions import geom_sir
119
+ from .functions import theme_sir
120
+ from .functions import labels_sir_count
121
+ from .functions import guess_ab_col
122
+ from .functions import italicise_taxonomy
123
+ from .functions import italicize_taxonomy
124
+ from .functions import inner_join_microorganisms
125
+ from .functions import left_join_microorganisms
126
+ from .functions import right_join_microorganisms
127
+ from .functions import full_join_microorganisms
128
+ from .functions import semi_join_microorganisms
129
+ from .functions import anti_join_microorganisms
130
+ from .functions import key_antimicrobials
131
+ from .functions import all_antimicrobials
132
+ from .functions import antimicrobials_equal
133
+ from .functions import kurtosis
134
+ from .functions import like
135
+ from .functions import mdro
136
+ from .functions import custom_mdro_guideline
137
+ from .functions import brmo
138
+ from .functions import mrgn
139
+ from .functions import mdr_tb
140
+ from .functions import mdr_cmi2012
141
+ from .functions import eucast_exceptional_phenotypes
142
+ from .functions import mean_amr_distance
143
+ from .functions import amr_distance_from_row
144
+ from .functions import mo_matching_score
145
+ from .functions import mo_name
146
+ from .functions import mo_fullname
147
+ from .functions import mo_shortname
148
+ from .functions import mo_subspecies
149
+ from .functions import mo_species
150
+ from .functions import mo_genus
151
+ from .functions import mo_family
152
+ from .functions import mo_order
153
+ from .functions import mo_class
154
+ from .functions import mo_phylum
155
+ from .functions import mo_kingdom
156
+ from .functions import mo_domain
157
+ from .functions import mo_type
158
+ from .functions import mo_status
159
+ from .functions import mo_pathogenicity
160
+ from .functions import mo_gramstain
161
+ from .functions import mo_is_gram_negative
162
+ from .functions import mo_is_gram_positive
163
+ from .functions import mo_is_yeast
164
+ from .functions import mo_is_intrinsic_resistant
165
+ from .functions import mo_oxygen_tolerance
166
+ from .functions import mo_is_anaerobic
167
+ from .functions import mo_snomed
168
+ from .functions import mo_ref
169
+ from .functions import mo_authors
170
+ from .functions import mo_year
171
+ from .functions import mo_lpsn
172
+ from .functions import mo_mycobank
173
+ from .functions import mo_gbif
174
+ from .functions import mo_rank
175
+ from .functions import mo_taxonomy
176
+ from .functions import mo_synonyms
177
+ from .functions import mo_current
178
+ from .functions import mo_group_members
179
+ from .functions import mo_info
180
+ from .functions import mo_url
181
+ from .functions import mo_property
182
+ from .functions import pca
183
+ from .functions import resistance
184
+ from .functions import susceptibility
185
+ from .functions import sir_confidence_interval
186
+ from .functions import proportion_R
187
+ from .functions import proportion_IR
188
+ from .functions import proportion_I
189
+ from .functions import proportion_SI
190
+ from .functions import proportion_S
191
+ from .functions import proportion_df
192
+ from .functions import sir_df
193
+ from .functions import random_mic
194
+ from .functions import random_disk
195
+ from .functions import random_sir
196
+ from .functions import resistance_predict
197
+ from .functions import sir_predict
198
+ from .functions import ggplot_sir_predict
199
+ from .functions import skewness
200
+ from .functions import reset_AMR_locale
201
+ from .functions import translate_AMR
AMR/datasets.py ADDED
@@ -0,0 +1,38 @@
1
+ BLUE = '\033[94m'
2
+ GREEN = '\033[32m'
3
+ RESET = '\033[0m'
4
+
5
+ print(f"{BLUE}AMR:{RESET} Setting up R environment and AMR datasets...", flush=True)
6
+
7
+ from rpy2 import robjects
8
+ from rpy2.robjects import pandas2ri
9
+ from rpy2.robjects.packages import importr, isinstalled
10
+ import pandas as pd
11
+
12
+ # Check if the R package is installed
13
+ if not isinstalled('AMR'):
14
+ utils = importr('utils')
15
+ utils.install_packages('AMR')
16
+
17
+ # Activate the automatic conversion between R and pandas DataFrames
18
+ pandas2ri.activate()
19
+ # example_isolates
20
+ example_isolates = pandas2ri.rpy2py(robjects.r('''
21
+ df <- AMR::example_isolates
22
+ df[] <- lapply(df, function(x) {
23
+ if (inherits(x, c("Date", "POSIXt", "factor"))) {
24
+ as.character(x)
25
+ } else {
26
+ x
27
+ }
28
+ })
29
+ df
30
+ '''))
31
+ example_isolates['date'] = pd.to_datetime(example_isolates['date'])
32
+
33
+ # microorganisms
34
+ microorganisms = pandas2ri.rpy2py(robjects.r('AMR::microorganisms[, !sapply(AMR::microorganisms, is.list)]'))
35
+ antibiotics = pandas2ri.rpy2py(robjects.r('AMR::antibiotics[, !sapply(AMR::antibiotics, is.list)]'))
36
+ clinical_breakpoints = pandas2ri.rpy2py(robjects.r('AMR::clinical_breakpoints'))
37
+
38
+ print(f"{BLUE}AMR:{RESET} {GREEN}Done.{RESET}", flush=True)
AMR/functions.py ADDED
@@ -0,0 +1,629 @@
1
+ import rpy2.robjects as robjects
2
+ from rpy2.robjects.packages import importr
3
+ from rpy2.robjects.vectors import StrVector, FactorVector, IntVector, FloatVector, DataFrame
4
+ from rpy2.robjects import pandas2ri
5
+ import pandas as pd
6
+ import numpy as np
7
+
8
+ # Activate automatic conversion between R data frames and pandas data frames
9
+ pandas2ri.activate()
10
+
11
+ # Import the AMR R package
12
+ amr_r = importr('AMR')
13
+
14
+ def convert_to_python(r_output):
15
+ # Check if it's a StrVector (R character vector)
16
+ if isinstance(r_output, StrVector):
17
+ return list(r_output) # Convert to a Python list of strings
18
+
19
+ # Check if it's a FactorVector (R factor)
20
+ elif isinstance(r_output, FactorVector):
21
+ return list(r_output) # Convert to a list of integers (factor levels)
22
+
23
+ # Check if it's an IntVector or FloatVector (numeric R vectors)
24
+ elif isinstance(r_output, (IntVector, FloatVector)):
25
+ return list(r_output) # Convert to a Python list of integers or floats
26
+
27
+ # Check if it's a pandas-compatible R data frame
28
+ elif isinstance(r_output, pd.DataFrame):
29
+ return r_output # Return as pandas DataFrame (already converted by pandas2ri)
30
+ elif isinstance(r_output, DataFrame):
31
+ return pandas2ri.rpy2py(r_output) # Return as pandas DataFrame
32
+
33
+ # Check if the input is a NumPy array and has a string data type
34
+ if isinstance(r_output, np.ndarray) and np.issubdtype(r_output.dtype, np.str_):
35
+ return r_output.tolist() # Convert to a regular Python list
36
+
37
+ # Fall-back
38
+ return r_output
39
+ def ab_from_text(*args, **kwargs):
40
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
41
+ return convert_to_python(amr_r.ab_from_text(*args, **kwargs))
42
+ def ab_name(x, *args, **kwargs):
43
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
44
+ return convert_to_python(amr_r.ab_name(x, *args, **kwargs))
45
+ def ab_cid(x, *args, **kwargs):
46
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
47
+ return convert_to_python(amr_r.ab_cid(x, *args, **kwargs))
48
+ def ab_synonyms(x, *args, **kwargs):
49
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
50
+ return convert_to_python(amr_r.ab_synonyms(x, *args, **kwargs))
51
+ def ab_tradenames(x, *args, **kwargs):
52
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
53
+ return convert_to_python(amr_r.ab_tradenames(x, *args, **kwargs))
54
+ def ab_group(x, *args, **kwargs):
55
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
56
+ return convert_to_python(amr_r.ab_group(x, *args, **kwargs))
57
+ def ab_atc(x, *args, **kwargs):
58
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
59
+ return convert_to_python(amr_r.ab_atc(x, *args, **kwargs))
60
+ def ab_atc_group1(x, *args, **kwargs):
61
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
62
+ return convert_to_python(amr_r.ab_atc_group1(x, *args, **kwargs))
63
+ def ab_atc_group2(x, *args, **kwargs):
64
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
65
+ return convert_to_python(amr_r.ab_atc_group2(x, *args, **kwargs))
66
+ def ab_loinc(x, *args, **kwargs):
67
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
68
+ return convert_to_python(amr_r.ab_loinc(x, *args, **kwargs))
69
+ def ab_ddd(x, *args, **kwargs):
70
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
71
+ return convert_to_python(amr_r.ab_ddd(x, *args, **kwargs))
72
+ def ab_ddd_units(x, *args, **kwargs):
73
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
74
+ return convert_to_python(amr_r.ab_ddd_units(x, *args, **kwargs))
75
+ def ab_info(x, *args, **kwargs):
76
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
77
+ return convert_to_python(amr_r.ab_info(x, *args, **kwargs))
78
+ def ab_url(x, *args, **kwargs):
79
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
80
+ return convert_to_python(amr_r.ab_url(x, *args, **kwargs))
81
+ def ab_property(x, *args, **kwargs):
82
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
83
+ return convert_to_python(amr_r.ab_property(x, *args, **kwargs))
84
+ def add_custom_antimicrobials(x):
85
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
86
+ return convert_to_python(amr_r.add_custom_antimicrobials(x))
87
+ def clear_custom_antimicrobials(*args, **kwargs):
88
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
89
+ return convert_to_python(amr_r.clear_custom_antimicrobials(*args, **kwargs))
90
+ def add_custom_microorganisms(x):
91
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
92
+ return convert_to_python(amr_r.add_custom_microorganisms(x))
93
+ def clear_custom_microorganisms(*args, **kwargs):
94
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
95
+ return convert_to_python(amr_r.clear_custom_microorganisms(*args, **kwargs))
96
+ def age(x, *args, **kwargs):
97
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
98
+ return convert_to_python(amr_r.age(x, *args, **kwargs))
99
+ def age_groups(x, *args, **kwargs):
100
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
101
+ return convert_to_python(amr_r.age_groups(x, *args, **kwargs))
102
+ def antibiogram(*args, **kwargs):
103
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
104
+ return convert_to_python(amr_r.antibiogram(*args, **kwargs))
105
+ def ab_class(ab_class, *args, **kwargs):
106
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
107
+ return convert_to_python(amr_r.ab_class(ab_class, *args, **kwargs))
108
+ def ab_selector(filter, *args, **kwargs):
109
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
110
+ return convert_to_python(amr_r.ab_selector(filter, *args, **kwargs))
111
+ def aminoglycosides(only_sir_columns = False, *args, **kwargs):
112
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
113
+ return convert_to_python(amr_r.aminoglycosides(only_sir_columns = False, *args, **kwargs))
114
+ def aminopenicillins(only_sir_columns = False, *args, **kwargs):
115
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
116
+ return convert_to_python(amr_r.aminopenicillins(only_sir_columns = False, *args, **kwargs))
117
+ def antifungals(only_sir_columns = False, *args, **kwargs):
118
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
119
+ return convert_to_python(amr_r.antifungals(only_sir_columns = False, *args, **kwargs))
120
+ def antimycobacterials(only_sir_columns = False, *args, **kwargs):
121
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
122
+ return convert_to_python(amr_r.antimycobacterials(only_sir_columns = False, *args, **kwargs))
123
+ def betalactams(only_sir_columns = False, *args, **kwargs):
124
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
125
+ return convert_to_python(amr_r.betalactams(only_sir_columns = False, *args, **kwargs))
126
+ def carbapenems(only_sir_columns = False, *args, **kwargs):
127
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
128
+ return convert_to_python(amr_r.carbapenems(only_sir_columns = False, *args, **kwargs))
129
+ def cephalosporins(only_sir_columns = False, *args, **kwargs):
130
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
131
+ return convert_to_python(amr_r.cephalosporins(only_sir_columns = False, *args, **kwargs))
132
+ def cephalosporins_1st(only_sir_columns = False, *args, **kwargs):
133
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
134
+ return convert_to_python(amr_r.cephalosporins_1st(only_sir_columns = False, *args, **kwargs))
135
+ def cephalosporins_2nd(only_sir_columns = False, *args, **kwargs):
136
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
137
+ return convert_to_python(amr_r.cephalosporins_2nd(only_sir_columns = False, *args, **kwargs))
138
+ def cephalosporins_3rd(only_sir_columns = False, *args, **kwargs):
139
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
140
+ return convert_to_python(amr_r.cephalosporins_3rd(only_sir_columns = False, *args, **kwargs))
141
+ def cephalosporins_4th(only_sir_columns = False, *args, **kwargs):
142
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
143
+ return convert_to_python(amr_r.cephalosporins_4th(only_sir_columns = False, *args, **kwargs))
144
+ def cephalosporins_5th(only_sir_columns = False, *args, **kwargs):
145
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
146
+ return convert_to_python(amr_r.cephalosporins_5th(only_sir_columns = False, *args, **kwargs))
147
+ def fluoroquinolones(only_sir_columns = False, *args, **kwargs):
148
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
149
+ return convert_to_python(amr_r.fluoroquinolones(only_sir_columns = False, *args, **kwargs))
150
+ def glycopeptides(only_sir_columns = False, *args, **kwargs):
151
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
152
+ return convert_to_python(amr_r.glycopeptides(only_sir_columns = False, *args, **kwargs))
153
+ def lincosamides(only_sir_columns = False, *args, **kwargs):
154
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
155
+ return convert_to_python(amr_r.lincosamides(only_sir_columns = False, *args, **kwargs))
156
+ def lipoglycopeptides(only_sir_columns = False, *args, **kwargs):
157
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
158
+ return convert_to_python(amr_r.lipoglycopeptides(only_sir_columns = False, *args, **kwargs))
159
+ def macrolides(only_sir_columns = False, *args, **kwargs):
160
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
161
+ return convert_to_python(amr_r.macrolides(only_sir_columns = False, *args, **kwargs))
162
+ def nitrofurans(only_sir_columns = False, *args, **kwargs):
163
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
164
+ return convert_to_python(amr_r.nitrofurans(only_sir_columns = False, *args, **kwargs))
165
+ def oxazolidinones(only_sir_columns = False, *args, **kwargs):
166
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
167
+ return convert_to_python(amr_r.oxazolidinones(only_sir_columns = False, *args, **kwargs))
168
+ def penicillins(only_sir_columns = False, *args, **kwargs):
169
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
170
+ return convert_to_python(amr_r.penicillins(only_sir_columns = False, *args, **kwargs))
171
+ def polymyxins(only_sir_columns = False, *args, **kwargs):
172
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
173
+ return convert_to_python(amr_r.polymyxins(only_sir_columns = False, *args, **kwargs))
174
+ def quinolones(only_sir_columns = False, *args, **kwargs):
175
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
176
+ return convert_to_python(amr_r.quinolones(only_sir_columns = False, *args, **kwargs))
177
+ def rifamycins(only_sir_columns = False, *args, **kwargs):
178
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
179
+ return convert_to_python(amr_r.rifamycins(only_sir_columns = False, *args, **kwargs))
180
+ def streptogramins(only_sir_columns = False, *args, **kwargs):
181
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
182
+ return convert_to_python(amr_r.streptogramins(only_sir_columns = False, *args, **kwargs))
183
+ def tetracyclines(only_sir_columns = False, *args, **kwargs):
184
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
185
+ return convert_to_python(amr_r.tetracyclines(only_sir_columns = False, *args, **kwargs))
186
+ def trimethoprims(only_sir_columns = False, *args, **kwargs):
187
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
188
+ return convert_to_python(amr_r.trimethoprims(only_sir_columns = False, *args, **kwargs))
189
+ def ureidopenicillins(only_sir_columns = False, *args, **kwargs):
190
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
191
+ return convert_to_python(amr_r.ureidopenicillins(only_sir_columns = False, *args, **kwargs))
192
+ def administrable_per_os(only_sir_columns = False, *args, **kwargs):
193
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
194
+ return convert_to_python(amr_r.administrable_per_os(only_sir_columns = False, *args, **kwargs))
195
+ def administrable_iv(only_sir_columns = False, *args, **kwargs):
196
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
197
+ return convert_to_python(amr_r.administrable_iv(only_sir_columns = False, *args, **kwargs))
198
+ def not_intrinsic_resistant(*args, **kwargs):
199
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
200
+ return convert_to_python(amr_r.not_intrinsic_resistant(*args, **kwargs))
201
+ def as_ab(x, *args, **kwargs):
202
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
203
+ return convert_to_python(amr_r.as_ab(x, *args, **kwargs))
204
+ def is_ab(x):
205
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
206
+ return convert_to_python(amr_r.is_ab(x))
207
+ def as_av(x, *args, **kwargs):
208
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
209
+ return convert_to_python(amr_r.as_av(x, *args, **kwargs))
210
+ def is_av(x):
211
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
212
+ return convert_to_python(amr_r.is_av(x))
213
+ def as_disk(x, *args, **kwargs):
214
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
215
+ return convert_to_python(amr_r.as_disk(x, *args, **kwargs))
216
+ def is_disk(x):
217
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
218
+ return convert_to_python(amr_r.is_disk(x))
219
+ def as_mic(x, *args, **kwargs):
220
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
221
+ return convert_to_python(amr_r.as_mic(x, *args, **kwargs))
222
+ def is_mic(x):
223
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
224
+ return convert_to_python(amr_r.is_mic(x))
225
+ def rescale_mic(x, *args, **kwargs):
226
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
227
+ return convert_to_python(amr_r.rescale_mic(x, *args, **kwargs))
228
+ def as_mo(*args, **kwargs):
229
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
230
+ return convert_to_python(amr_r.as_mo(*args, **kwargs))
231
+ def is_mo(x):
232
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
233
+ return convert_to_python(amr_r.is_mo(x))
234
+ def mo_uncertainties(*args, **kwargs):
235
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
236
+ return convert_to_python(amr_r.mo_uncertainties(*args, **kwargs))
237
+ def mo_renamed(*args, **kwargs):
238
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
239
+ return convert_to_python(amr_r.mo_renamed(*args, **kwargs))
240
+ def mo_failures(*args, **kwargs):
241
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
242
+ return convert_to_python(amr_r.mo_failures(*args, **kwargs))
243
+ def mo_reset_session(*args, **kwargs):
244
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
245
+ return convert_to_python(amr_r.mo_reset_session(*args, **kwargs))
246
+ def mo_cleaning_regex(*args, **kwargs):
247
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
248
+ return convert_to_python(amr_r.mo_cleaning_regex(*args, **kwargs))
249
+ def as_sir(x, *args, **kwargs):
250
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
251
+ return convert_to_python(amr_r.as_sir(x, *args, **kwargs))
252
+ def is_sir(x):
253
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
254
+ return convert_to_python(amr_r.is_sir(x))
255
+ def is_sir_eligible(x, *args, **kwargs):
256
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
257
+ return convert_to_python(amr_r.is_sir_eligible(x, *args, **kwargs))
258
+ def sir_interpretation_history(clean):
259
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
260
+ return convert_to_python(amr_r.sir_interpretation_history(clean))
261
+ def atc_online_property(*args, **kwargs):
262
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
263
+ return convert_to_python(amr_r.atc_online_property(*args, **kwargs))
264
+ def atc_online_groups(atc_code, *args, **kwargs):
265
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
266
+ return convert_to_python(amr_r.atc_online_groups(atc_code, *args, **kwargs))
267
+ def atc_online_ddd(atc_code, *args, **kwargs):
268
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
269
+ return convert_to_python(amr_r.atc_online_ddd(atc_code, *args, **kwargs))
270
+ def atc_online_ddd_units(atc_code, *args, **kwargs):
271
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
272
+ return convert_to_python(amr_r.atc_online_ddd_units(atc_code, *args, **kwargs))
273
+ def av_from_text(*args, **kwargs):
274
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
275
+ return convert_to_python(amr_r.av_from_text(*args, **kwargs))
276
+ def av_name(x, *args, **kwargs):
277
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
278
+ return convert_to_python(amr_r.av_name(x, *args, **kwargs))
279
+ def av_cid(x, *args, **kwargs):
280
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
281
+ return convert_to_python(amr_r.av_cid(x, *args, **kwargs))
282
+ def av_synonyms(x, *args, **kwargs):
283
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
284
+ return convert_to_python(amr_r.av_synonyms(x, *args, **kwargs))
285
+ def av_tradenames(x, *args, **kwargs):
286
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
287
+ return convert_to_python(amr_r.av_tradenames(x, *args, **kwargs))
288
+ def av_group(x, *args, **kwargs):
289
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
290
+ return convert_to_python(amr_r.av_group(x, *args, **kwargs))
291
+ def av_atc(x, *args, **kwargs):
292
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
293
+ return convert_to_python(amr_r.av_atc(x, *args, **kwargs))
294
+ def av_loinc(x, *args, **kwargs):
295
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
296
+ return convert_to_python(amr_r.av_loinc(x, *args, **kwargs))
297
+ def av_ddd(x, *args, **kwargs):
298
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
299
+ return convert_to_python(amr_r.av_ddd(x, *args, **kwargs))
300
+ def av_ddd_units(x, *args, **kwargs):
301
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
302
+ return convert_to_python(amr_r.av_ddd_units(x, *args, **kwargs))
303
+ def av_info(x, *args, **kwargs):
304
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
305
+ return convert_to_python(amr_r.av_info(x, *args, **kwargs))
306
+ def av_url(x, *args, **kwargs):
307
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
308
+ return convert_to_python(amr_r.av_url(x, *args, **kwargs))
309
+ def av_property(x, *args, **kwargs):
310
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
311
+ return convert_to_python(amr_r.av_property(x, *args, **kwargs))
312
+ def availability(tbl, *args, **kwargs):
313
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
314
+ return convert_to_python(amr_r.availability(tbl, *args, **kwargs))
315
+ def bug_drug_combinations(x, *args, **kwargs):
316
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
317
+ return convert_to_python(amr_r.bug_drug_combinations(x, *args, **kwargs))
318
+ def count_resistant(*args, **kwargs):
319
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
320
+ return convert_to_python(amr_r.count_resistant(*args, **kwargs))
321
+ def count_susceptible(*args, **kwargs):
322
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
323
+ return convert_to_python(amr_r.count_susceptible(*args, **kwargs))
324
+ def count_S(*args, **kwargs):
325
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
326
+ return convert_to_python(amr_r.count_S(*args, **kwargs))
327
+ def count_SI(*args, **kwargs):
328
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
329
+ return convert_to_python(amr_r.count_SI(*args, **kwargs))
330
+ def count_I(*args, **kwargs):
331
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
332
+ return convert_to_python(amr_r.count_I(*args, **kwargs))
333
+ def count_IR(*args, **kwargs):
334
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
335
+ return convert_to_python(amr_r.count_IR(*args, **kwargs))
336
+ def count_R(*args, **kwargs):
337
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
338
+ return convert_to_python(amr_r.count_R(*args, **kwargs))
339
+ def count_all(*args, **kwargs):
340
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
341
+ return convert_to_python(amr_r.count_all(*args, **kwargs))
342
+ def n_sir(*args, **kwargs):
343
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
344
+ return convert_to_python(amr_r.n_sir(*args, **kwargs))
345
+ def count_df(*args, **kwargs):
346
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
347
+ return convert_to_python(amr_r.count_df(*args, **kwargs))
348
+ def custom_eucast_rules(*args, **kwargs):
349
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
350
+ return convert_to_python(amr_r.custom_eucast_rules(*args, **kwargs))
351
+ def eucast_rules(*args, **kwargs):
352
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
353
+ return convert_to_python(amr_r.eucast_rules(*args, **kwargs))
354
+ def eucast_dosage(ab, *args, **kwargs):
355
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
356
+ return convert_to_python(amr_r.eucast_dosage(ab, *args, **kwargs))
357
+ def export_ncbi_biosample(*args, **kwargs):
358
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
359
+ return convert_to_python(amr_r.export_ncbi_biosample(*args, **kwargs))
360
+ def first_isolate(*args, **kwargs):
361
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
362
+ return convert_to_python(amr_r.first_isolate(*args, **kwargs))
363
+ def filter_first_isolate(*args, **kwargs):
364
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
365
+ return convert_to_python(amr_r.filter_first_isolate(*args, **kwargs))
366
+ def g_test(x, *args, **kwargs):
367
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
368
+ return convert_to_python(amr_r.g_test(x, *args, **kwargs))
369
+ def is_new_episode(x, *args, **kwargs):
370
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
371
+ return convert_to_python(amr_r.is_new_episode(x, *args, **kwargs))
372
+ def ggplot_pca(*args, **kwargs):
373
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
374
+ return convert_to_python(amr_r.ggplot_pca(*args, **kwargs))
375
+ def ggplot_sir(*args, **kwargs):
376
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
377
+ return convert_to_python(amr_r.ggplot_sir(*args, **kwargs))
378
+ def geom_sir(*args, **kwargs):
379
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
380
+ return convert_to_python(amr_r.geom_sir(*args, **kwargs))
381
+ def theme_sir(*args, **kwargs):
382
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
383
+ return convert_to_python(amr_r.theme_sir(*args, **kwargs))
384
+ def labels_sir_count(*args, **kwargs):
385
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
386
+ return convert_to_python(amr_r.labels_sir_count(*args, **kwargs))
387
+ def guess_ab_col(*args, **kwargs):
388
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
389
+ return convert_to_python(amr_r.guess_ab_col(*args, **kwargs))
390
+ def italicise_taxonomy(string, *args, **kwargs):
391
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
392
+ return convert_to_python(amr_r.italicise_taxonomy(string, *args, **kwargs))
393
+ def italicize_taxonomy(string, *args, **kwargs):
394
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
395
+ return convert_to_python(amr_r.italicize_taxonomy(string, *args, **kwargs))
396
+ def inner_join_microorganisms(x, *args, **kwargs):
397
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
398
+ return convert_to_python(amr_r.inner_join_microorganisms(x, *args, **kwargs))
399
+ def left_join_microorganisms(x, *args, **kwargs):
400
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
401
+ return convert_to_python(amr_r.left_join_microorganisms(x, *args, **kwargs))
402
+ def right_join_microorganisms(x, *args, **kwargs):
403
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
404
+ return convert_to_python(amr_r.right_join_microorganisms(x, *args, **kwargs))
405
+ def full_join_microorganisms(x, *args, **kwargs):
406
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
407
+ return convert_to_python(amr_r.full_join_microorganisms(x, *args, **kwargs))
408
+ def semi_join_microorganisms(x, *args, **kwargs):
409
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
410
+ return convert_to_python(amr_r.semi_join_microorganisms(x, *args, **kwargs))
411
+ def anti_join_microorganisms(x, *args, **kwargs):
412
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
413
+ return convert_to_python(amr_r.anti_join_microorganisms(x, *args, **kwargs))
414
+ def key_antimicrobials(*args, **kwargs):
415
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
416
+ return convert_to_python(amr_r.key_antimicrobials(*args, **kwargs))
417
+ def all_antimicrobials(x = None, *args, **kwargs):
418
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
419
+ return convert_to_python(amr_r.all_antimicrobials(x = None, *args, **kwargs))
420
+ def antimicrobials_equal(*args, **kwargs):
421
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
422
+ return convert_to_python(amr_r.antimicrobials_equal(*args, **kwargs))
423
+ def kurtosis(x, *args, **kwargs):
424
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
425
+ return convert_to_python(amr_r.kurtosis(x, *args, **kwargs))
426
+ def like(x, *args, **kwargs):
427
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
428
+ return convert_to_python(amr_r.like(x, *args, **kwargs))
429
+ def mdro(*args, **kwargs):
430
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
431
+ return convert_to_python(amr_r.mdro(*args, **kwargs))
432
+ def custom_mdro_guideline(*args, **kwargs):
433
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
434
+ return convert_to_python(amr_r.custom_mdro_guideline(*args, **kwargs))
435
+ def brmo(x = None, *args, **kwargs):
436
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
437
+ return convert_to_python(amr_r.brmo(x = None, *args, **kwargs))
438
+ def mrgn(x = None, *args, **kwargs):
439
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
440
+ return convert_to_python(amr_r.mrgn(x = None, *args, **kwargs))
441
+ def mdr_tb(x = None, *args, **kwargs):
442
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
443
+ return convert_to_python(amr_r.mdr_tb(x = None, *args, **kwargs))
444
+ def mdr_cmi2012(x = None, *args, **kwargs):
445
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
446
+ return convert_to_python(amr_r.mdr_cmi2012(x = None, *args, **kwargs))
447
+ def eucast_exceptional_phenotypes(x = None, *args, **kwargs):
448
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
449
+ return convert_to_python(amr_r.eucast_exceptional_phenotypes(x = None, *args, **kwargs))
450
+ def mean_amr_distance(x, *args, **kwargs):
451
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
452
+ return convert_to_python(amr_r.mean_amr_distance(x, *args, **kwargs))
453
+ def amr_distance_from_row(amr_distance, *args, **kwargs):
454
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
455
+ return convert_to_python(amr_r.amr_distance_from_row(amr_distance, *args, **kwargs))
456
+ def mo_matching_score(x, *args, **kwargs):
457
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
458
+ return convert_to_python(amr_r.mo_matching_score(x, *args, **kwargs))
459
+ def mo_name(*args, **kwargs):
460
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
461
+ return convert_to_python(amr_r.mo_name(*args, **kwargs))
462
+ def mo_fullname(*args, **kwargs):
463
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
464
+ return convert_to_python(amr_r.mo_fullname(*args, **kwargs))
465
+ def mo_shortname(*args, **kwargs):
466
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
467
+ return convert_to_python(amr_r.mo_shortname(*args, **kwargs))
468
+ def mo_subspecies(*args, **kwargs):
469
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
470
+ return convert_to_python(amr_r.mo_subspecies(*args, **kwargs))
471
+ def mo_species(*args, **kwargs):
472
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
473
+ return convert_to_python(amr_r.mo_species(*args, **kwargs))
474
+ def mo_genus(*args, **kwargs):
475
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
476
+ return convert_to_python(amr_r.mo_genus(*args, **kwargs))
477
+ def mo_family(*args, **kwargs):
478
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
479
+ return convert_to_python(amr_r.mo_family(*args, **kwargs))
480
+ def mo_order(*args, **kwargs):
481
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
482
+ return convert_to_python(amr_r.mo_order(*args, **kwargs))
483
+ def mo_class(*args, **kwargs):
484
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
485
+ return convert_to_python(amr_r.mo_class(*args, **kwargs))
486
+ def mo_phylum(*args, **kwargs):
487
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
488
+ return convert_to_python(amr_r.mo_phylum(*args, **kwargs))
489
+ def mo_kingdom(*args, **kwargs):
490
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
491
+ return convert_to_python(amr_r.mo_kingdom(*args, **kwargs))
492
+ def mo_domain(*args, **kwargs):
493
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
494
+ return convert_to_python(amr_r.mo_domain(*args, **kwargs))
495
+ def mo_type(*args, **kwargs):
496
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
497
+ return convert_to_python(amr_r.mo_type(*args, **kwargs))
498
+ def mo_status(*args, **kwargs):
499
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
500
+ return convert_to_python(amr_r.mo_status(*args, **kwargs))
501
+ def mo_pathogenicity(*args, **kwargs):
502
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
503
+ return convert_to_python(amr_r.mo_pathogenicity(*args, **kwargs))
504
+ def mo_gramstain(*args, **kwargs):
505
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
506
+ return convert_to_python(amr_r.mo_gramstain(*args, **kwargs))
507
+ def mo_is_gram_negative(*args, **kwargs):
508
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
509
+ return convert_to_python(amr_r.mo_is_gram_negative(*args, **kwargs))
510
+ def mo_is_gram_positive(*args, **kwargs):
511
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
512
+ return convert_to_python(amr_r.mo_is_gram_positive(*args, **kwargs))
513
+ def mo_is_yeast(*args, **kwargs):
514
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
515
+ return convert_to_python(amr_r.mo_is_yeast(*args, **kwargs))
516
+ def mo_is_intrinsic_resistant(*args, **kwargs):
517
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
518
+ return convert_to_python(amr_r.mo_is_intrinsic_resistant(*args, **kwargs))
519
+ def mo_oxygen_tolerance(*args, **kwargs):
520
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
521
+ return convert_to_python(amr_r.mo_oxygen_tolerance(*args, **kwargs))
522
+ def mo_is_anaerobic(*args, **kwargs):
523
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
524
+ return convert_to_python(amr_r.mo_is_anaerobic(*args, **kwargs))
525
+ def mo_snomed(*args, **kwargs):
526
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
527
+ return convert_to_python(amr_r.mo_snomed(*args, **kwargs))
528
+ def mo_ref(*args, **kwargs):
529
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
530
+ return convert_to_python(amr_r.mo_ref(*args, **kwargs))
531
+ def mo_authors(*args, **kwargs):
532
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
533
+ return convert_to_python(amr_r.mo_authors(*args, **kwargs))
534
+ def mo_year(*args, **kwargs):
535
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
536
+ return convert_to_python(amr_r.mo_year(*args, **kwargs))
537
+ def mo_lpsn(*args, **kwargs):
538
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
539
+ return convert_to_python(amr_r.mo_lpsn(*args, **kwargs))
540
+ def mo_mycobank(*args, **kwargs):
541
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
542
+ return convert_to_python(amr_r.mo_mycobank(*args, **kwargs))
543
+ def mo_gbif(*args, **kwargs):
544
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
545
+ return convert_to_python(amr_r.mo_gbif(*args, **kwargs))
546
+ def mo_rank(*args, **kwargs):
547
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
548
+ return convert_to_python(amr_r.mo_rank(*args, **kwargs))
549
+ def mo_taxonomy(*args, **kwargs):
550
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
551
+ return convert_to_python(amr_r.mo_taxonomy(*args, **kwargs))
552
+ def mo_synonyms(*args, **kwargs):
553
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
554
+ return convert_to_python(amr_r.mo_synonyms(*args, **kwargs))
555
+ def mo_current(x, *args, **kwargs):
556
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
557
+ return convert_to_python(amr_r.mo_current(x, *args, **kwargs))
558
+ def mo_group_members(*args, **kwargs):
559
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
560
+ return convert_to_python(amr_r.mo_group_members(*args, **kwargs))
561
+ def mo_info(*args, **kwargs):
562
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
563
+ return convert_to_python(amr_r.mo_info(*args, **kwargs))
564
+ def mo_url(*args, **kwargs):
565
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
566
+ return convert_to_python(amr_r.mo_url(*args, **kwargs))
567
+ def mo_property(*args, **kwargs):
568
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
569
+ return convert_to_python(amr_r.mo_property(*args, **kwargs))
570
+ def pca(*args, **kwargs):
571
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
572
+ return convert_to_python(amr_r.pca(*args, **kwargs))
573
+ def resistance(*args, **kwargs):
574
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
575
+ return convert_to_python(amr_r.resistance(*args, **kwargs))
576
+ def susceptibility(*args, **kwargs):
577
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
578
+ return convert_to_python(amr_r.susceptibility(*args, **kwargs))
579
+ def sir_confidence_interval(*args, **kwargs):
580
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
581
+ return convert_to_python(amr_r.sir_confidence_interval(*args, **kwargs))
582
+ def proportion_R(*args, **kwargs):
583
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
584
+ return convert_to_python(amr_r.proportion_R(*args, **kwargs))
585
+ def proportion_IR(*args, **kwargs):
586
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
587
+ return convert_to_python(amr_r.proportion_IR(*args, **kwargs))
588
+ def proportion_I(*args, **kwargs):
589
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
590
+ return convert_to_python(amr_r.proportion_I(*args, **kwargs))
591
+ def proportion_SI(*args, **kwargs):
592
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
593
+ return convert_to_python(amr_r.proportion_SI(*args, **kwargs))
594
+ def proportion_S(*args, **kwargs):
595
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
596
+ return convert_to_python(amr_r.proportion_S(*args, **kwargs))
597
+ def proportion_df(*args, **kwargs):
598
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
599
+ return convert_to_python(amr_r.proportion_df(*args, **kwargs))
600
+ def sir_df(*args, **kwargs):
601
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
602
+ return convert_to_python(amr_r.sir_df(*args, **kwargs))
603
+ def random_mic(size = None, *args, **kwargs):
604
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
605
+ return convert_to_python(amr_r.random_mic(size = None, *args, **kwargs))
606
+ def random_disk(size = None, *args, **kwargs):
607
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
608
+ return convert_to_python(amr_r.random_disk(size = None, *args, **kwargs))
609
+ def random_sir(size = None, *args, **kwargs):
610
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
611
+ return convert_to_python(amr_r.random_sir(size = None, *args, **kwargs))
612
+ def resistance_predict(*args, **kwargs):
613
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
614
+ return convert_to_python(amr_r.resistance_predict(*args, **kwargs))
615
+ def sir_predict(*args, **kwargs):
616
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
617
+ return convert_to_python(amr_r.sir_predict(*args, **kwargs))
618
+ def ggplot_sir_predict(*args, **kwargs):
619
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
620
+ return convert_to_python(amr_r.ggplot_sir_predict(*args, **kwargs))
621
+ def skewness(x, *args, **kwargs):
622
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
623
+ return convert_to_python(amr_r.skewness(x, *args, **kwargs))
624
+ def reset_AMR_locale(*args, **kwargs):
625
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
626
+ return convert_to_python(amr_r.reset_AMR_locale(*args, **kwargs))
627
+ def translate_AMR(x, *args, **kwargs):
628
+ """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html"""
629
+ return convert_to_python(amr_r.translate_AMR(x, *args, **kwargs))
@@ -0,0 +1,223 @@
1
+ Metadata-Version: 2.1
2
+ Name: AMR
3
+ Version: 2.1.1.9094
4
+ Summary: A Python wrapper for the AMR R package
5
+ Home-page: https://github.com/msberends/AMR
6
+ Author: Matthijs Berends
7
+ Author-email: m.s.berends@umcg.nl
8
+ License: GPL 2
9
+ Project-URL: Bug Tracker, https://github.com/msberends/AMR/issues
10
+ Platform: UNKNOWN
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.6
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: rpy2
16
+ Requires-Dist: numpy
17
+ Requires-Dist: pandas
18
+
19
+ ---
20
+ title: "AMR for Python"
21
+ output:
22
+ rmarkdown::html_vignette:
23
+ toc: true
24
+ toc_depth: 3
25
+ vignette: >
26
+ %\VignetteIndexEntry{AMR for Python}
27
+ %\VignetteEncoding{UTF-8}
28
+ %\VignetteEngine{knitr::rmarkdown}
29
+ editor_options:
30
+ chunk_output_type: console
31
+ ---
32
+
33
+ ```{r setup, include = FALSE, results = 'markup'}
34
+ knitr::opts_chunk$set(
35
+ warning = FALSE,
36
+ collapse = TRUE,
37
+ comment = "#>",
38
+ fig.width = 7.5,
39
+ fig.height = 5
40
+ )
41
+ ```
42
+
43
+ # Introduction
44
+
45
+ The `AMR` package for R is a powerful tool for antimicrobial resistance (AMR) analysis. It provides extensive features for handling microbial and antimicrobial data. However, for those who work primarily in Python, we now have a more intuitive option available: the `AMR` Python package, which uses `rpy2` internally. This package allows Python users to access all the functions from the R `AMR` package without the need to set up `rpy2` themselves. Since this Python package is not a true 'port' (which would require all R functions to be rewritten into Python), R and the AMR R package are still required to be installed. Yet, Python users can now easily work with AMR data directly through Python code.
46
+
47
+ In this document, we explain how this works and provide simple examples of using the `AMR` Python package.
48
+
49
+ ## How It Works
50
+
51
+ The `AMR` Python package acts as a wrapper around the functions in the `AMR` R package. The package simplifies the process of calling R functions in Python, eliminating the need to manually manage the `rpy2` setup, which Python uses internally to be able to work with the R package. By just using `import AMR`, Python users can directly use the functions from the `AMR` R package as if they were native Python functions.
52
+
53
+ Internally, `rpy2` is still being used, but all complexity is hidden from the user. This approach keeps the Python code clean and Pythonic, while still leveraging the full power of the R `AMR` package.
54
+
55
+ ## Example of Usage
56
+
57
+ Here’s an example that demonstrates how to clean microorganism and drug names using the `AMR` Python package:
58
+
59
+ ```python
60
+ import pandas as pd
61
+ import AMR
62
+
63
+ # Sample data
64
+ data = {
65
+ "MOs": ['E. coli', 'ESCCOL', 'esco', 'Esche coli'],
66
+ "Drug": ['Cipro', 'CIP', 'J01MA02', 'Ciproxin']
67
+ }
68
+ df = pd.DataFrame(data)
69
+
70
+ # Use AMR functions to clean microorganism and drug names
71
+ df['MO_clean'] = AMR.mo_name(df['MOs'])
72
+ df['Drug_clean'] = AMR.ab_name(df['Drug'])
73
+
74
+ # Display the results
75
+ print(df)
76
+ ```
77
+
78
+ | MOs | Drug | MO_clean | Drug_clean |
79
+ |-------------|-----------|--------------------|---------------|
80
+ | E. coli | Cipro | Escherichia coli | Ciprofloxacin |
81
+ | ESCCOL | CIP | Escherichia coli | Ciprofloxacin |
82
+ | esco | J01MA02 | Escherichia coli | Ciprofloxacin |
83
+ | Esche coli | Ciproxin | Escherichia coli | Ciprofloxacin |
84
+
85
+ ### Explanation
86
+
87
+ * **mo_name:** This function standardises microorganism names. Here, different variations of *Escherichia coli* (such as "E. coli", "ESCCOL", "esco", and "Esche coli") are all converted into the correct, standardised form, "Escherichia coli".
88
+
89
+ * **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".
90
+
91
+ ### Taxonomic Data Sets Now in Python!
92
+
93
+ 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:
94
+
95
+ ```python
96
+ AMR.microorganisms
97
+ ```
98
+
99
+ | mo | fullname | status | kingdom | gbif | gbif_parent | gbif_renamed_to | prevalence |
100
+ |--------------|------------------------------------|----------|----------|-----------|-------------|-----------------|------------|
101
+ | B_GRAMN | (unknown Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
102
+ | B_GRAMP | (unknown Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
103
+ | B_ANAER-NEG | (unknown anaerobic Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
104
+ | B_ANAER-POS | (unknown anaerobic Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
105
+ | B_ANAER | (unknown anaerobic bacteria) | unknown | Bacteria | None | None | None | 2.0 |
106
+ | ... | ... | ... | ... | ... | ... | ... | ... |
107
+ | B_ZYMMN_POMC | Zymomonas pomaceae | accepted | Bacteria | 10744418 | 3221412 | None | 2.0 |
108
+ | B_ZYMPH | Zymophilus | synonym | Bacteria | None | 9475166 | None | 2.0 |
109
+ | B_ZYMPH_PCVR | Zymophilus paucivorans | synonym | Bacteria | None | None | None | 2.0 |
110
+ | B_ZYMPH_RFFN | Zymophilus raffinosivorans | synonym | Bacteria | None | None | None | 2.0 |
111
+ | F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 |
112
+
113
+ ```python
114
+ AMR.antibiotics
115
+ ```
116
+
117
+ | ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units |
118
+ |-----|-------------|----------------------|----------------------------|----------|------------|--------|----------|
119
+ | AMA | 4649.0 | 4-aminosalicylic acid| Antimycobacterials | 12.00 | g | NaN | None |
120
+ | ACM | 6450012.0 | Acetylmidecamycin | Macrolides/lincosamides | NaN | None | NaN | None |
121
+ | ASP | 49787020.0 | Acetylspiramycin | Macrolides/lincosamides | NaN | None | NaN | None |
122
+ | ALS | 8954.0 | Aldesulfone sodium | Other antibacterials | 0.33 | g | NaN | None |
123
+ | AMK | 37768.0 | Amikacin | Aminoglycosides | NaN | None | 1.0 | g |
124
+ | ... | ... | ... | ... | ... | ... | ... | ... |
125
+ | VIR | 11979535.0 | Virginiamycine | Other antibacterials | NaN | None | NaN | None |
126
+ | VOR | 71616.0 | Voriconazole | Antifungals/antimycotics | 0.40 | g | 0.4 | g |
127
+ | XBR | 72144.0 | Xibornol | Other antibacterials | NaN | None | NaN | None |
128
+ | ZID | 77846445.0 | Zidebactam | Other antibacterials | NaN | None | NaN | None |
129
+ | ZFD | NaN | Zoliflodacin | None | NaN | None | NaN | None |
130
+
131
+
132
+ # Installation
133
+
134
+ To be able to use the `AMR` Python package, it is required to install both R and the `AMR` R package.
135
+
136
+ ### Preparation: Install R and `AMR` R package
137
+
138
+ For Linux and macOS, this is just:
139
+
140
+ ```bash
141
+ # Ubuntu / Debian
142
+ sudo apt install r-base && Rscript -e 'install.packages("AMR")'
143
+ # Fedora:
144
+ sudo dnf install R && Rscript -e 'install.packages("AMR")'
145
+ # CentOS/RHEL
146
+ sudo yum install R && Rscript -e 'install.packages("AMR")'
147
+ # Arch Linux
148
+ sudo pacman -S r && Rscript -e 'install.packages("AMR")'
149
+ # macOS
150
+ brew install r && Rscript -e 'install.packages("AMR")'
151
+ ```
152
+
153
+ For Windows, visit the [CRAN download page](https://cran.r-project.org) in install R, then afterwards install the 'AMR' package manually.
154
+
155
+ ### Install `AMR` Python Package
156
+
157
+ Since the Python package is available on the official [Python Package Index](https://pypi.org/project/AMR/), you can just run:
158
+
159
+ ```bash
160
+ pip install AMR
161
+ ```
162
+
163
+ # Working with `AMR` in Python
164
+
165
+ Now that we have everything set up, let’s walk through some practical examples of using the `AMR` package within Python.
166
+
167
+ ## Example 1: Calculating AMR
168
+
169
+ ```python
170
+ import AMR
171
+ import pandas as pd
172
+
173
+ df = AMR.example_isolates
174
+ result = AMR.resistance(df["AMX"])
175
+ print(result)
176
+ ```
177
+
178
+ ```
179
+ [0.59555556]
180
+ ```
181
+
182
+ ## Example 2: Generating Antibiograms
183
+
184
+ One of the core functions of the `AMR` package is generating an antibiogram, a table that summarises the antimicrobial susceptibility of bacterial isolates. Here’s how you can generate an antibiogram from Python:
185
+
186
+ ```python
187
+ result2a = AMR.antibiogram(df[["mo", "AMX", "CIP", "TZP"]])
188
+ print(result2a)
189
+ ```
190
+
191
+ | Pathogen | Amoxicillin | Ciprofloxacin | Piperacillin/tazobactam |
192
+ |-----------------|-----------------|-----------------|--------------------------|
193
+ | CoNS | 7% (10/142) | 73% (183/252) | 30% (10/33) |
194
+ | E. coli | 50% (196/392) | 88% (399/456) | 94% (393/416) |
195
+ | K. pneumoniae | 0% (0/58) | 96% (53/55) | 89% (47/53) |
196
+ | P. aeruginosa | 0% (0/30) | 100% (30/30) | None |
197
+ | P. mirabilis | None | 94% (34/36) | None |
198
+ | S. aureus | 6% (8/131) | 90% (171/191) | None |
199
+ | S. epidermidis | 1% (1/91) | 64% (87/136) | None |
200
+ | S. hominis | None | 80% (56/70) | None |
201
+ | S. pneumoniae | 100% (112/112) | None | 100% (112/112) |
202
+
203
+
204
+ ```python
205
+ result2b = AMR.antibiogram(df[["mo", "AMX", "CIP", "TZP"]], mo_transform = "gramstain")
206
+ print(result2b)
207
+ ```
208
+
209
+ | Pathogen | Amoxicillin | Ciprofloxacin | Piperacillin/tazobactam |
210
+ |----------------|-----------------|------------------|--------------------------|
211
+ | Gram-negative | 36% (226/631) | 91% (621/684) | 88% (565/641) |
212
+ | Gram-positive | 43% (305/703) | 77% (560/724) | 86% (296/345) |
213
+
214
+
215
+ In this example, we generate an antibiogram by selecting various antibiotics.
216
+
217
+ # Conclusion
218
+
219
+ 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.
220
+
221
+ By using `import AMR`, you can seamlessly integrate the robust features of the R `AMR` package into your Python workflows. Whether you're cleaning data or analysing resistance patterns, the `AMR` Python package makes it easy to work with AMR data in Python.
222
+
223
+
@@ -0,0 +1,7 @@
1
+ AMR/__init__.py,sha256=Jzrh0SVD8tXP1_sJAnElOPAJcvMgtleTzdSnY3RI3HY,7315
2
+ AMR/datasets.py,sha256=_TgR3aHvBVw2-hw3hhcVsY_FiTgCDLFQaNt8ChDuM48,1188
3
+ AMR/functions.py,sha256=XDN7fo0N3gGnZHYL0pdkG_9jwlsrvj0fo5IqLS7gWBM,43615
4
+ AMR-2.1.1.9094.dist-info/METADATA,sha256=hxzpR-f4dmXvOCdINE0i7SMaV4LIdGRrjjoquSY86aQ,11144
5
+ AMR-2.1.1.9094.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
6
+ AMR-2.1.1.9094.dist-info/top_level.txt,sha256=7K6Mq_X_OHdXOzQM5y06VUadXjYkze6yzufL1d7_6xc,4
7
+ AMR-2.1.1.9094.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.37.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ AMR