1
0
mirror of https://github.com/msberends/AMR.git synced 2026-06-29 20:56:19 +02:00

Built site for AMR@3.0.1.9065: 39b6a25

This commit is contained in:
github-actions
2026-06-24 17:08:22 +00:00
parent b3b6a798ae
commit c89dafb556
126 changed files with 887 additions and 710 deletions

View File

@@ -85,31 +85,31 @@ suspicious.
sir <- random_sir(10)
sir
#> Class <sir>
#> [1] S S I S I S I S I R
#> [1] S R I R R R R I I I
mean_amr_distance(sir)
#> [1] -0.3162278 -0.3162278 -0.3162278 -0.3162278 -0.3162278 -0.3162278
#> [7] -0.3162278 -0.3162278 -0.3162278 2.8460499
#> [1] -0.9486833 0.9486833 -0.9486833 0.9486833 0.9486833 0.9486833
#> [7] 0.9486833 -0.9486833 -0.9486833 -0.9486833
mic <- random_mic(10)
mic
#> Class <mic>
#> [1] <=0.0001 0.0002 0.5 0.0005 0.004 0.001 0.016 0.0002
#> [9] 0.032 1
#> [1] 0.032 0.064 0.125 0.5 0.016 0.008 <=0.0005 0.032
#> [9] 0.5 1
mean_amr_distance(mic)
#> [1] -1.13933320 -0.92906618 1.44436742 -0.65110831 -0.02030726 -0.44084129
#> [7] 0.40022677 -0.92906618 0.61049379 1.65463443
#> [1] -0.20876566 0.09541835 0.38919449 0.99756251 -0.51294967 -0.81713368
#> [7] -2.03386972 -0.20876566 0.99756251 1.30174652
# equal to the Z-score of their log2:
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
#> [1] -1.13933320 -0.92906618 1.44436742 -0.65110831 -0.02030726 -0.44084129
#> [7] 0.40022677 -0.92906618 0.61049379 1.65463443
#> [1] -0.20876566 0.09541835 0.38919449 0.99756251 -0.51294967 -0.81713368
#> [7] -2.03386972 -0.20876566 0.99756251 1.30174652
disk <- random_disk(10)
disk
#> Class <disk>
#> [1] 49 30 42 50 16 27 12 13 28 32
#> [1] 48 45 48 40 44 9 39 49 39 29
mean_amr_distance(disk)
#> [1] 1.37726856 0.00721083 0.87251045 1.44937686 -1.00230539 -0.20911407
#> [7] -1.29073860 -1.21863029 -0.13700577 0.15142743
#> [1] 0.74202711 0.49468474 0.74202711 0.08244746 0.41223728 -2.47342369
#> [7] 0.00000000 0.82447456 0.00000000 -0.82447456
y <- data.frame(
id = LETTERS[1:10],
@@ -120,35 +120,35 @@ y <- data.frame(
)
y
#> id amox cipr gent tobr
#> 1 A I 32 4 8
#> 2 B R 32 4 8
#> 3 C I 30 8 8
#> 4 D S 16 4 8
#> 5 E S 33 4 16
#> 6 F R 32 4 8
#> 7 G I 29 8 8
#> 8 H I 31 8 16
#> 9 I I 30 4 16
#> 10 J R 20 8 8
#> 1 A R 26 4 4
#> 2 B R 28 8 1
#> 3 C R 31 8 1
#> 4 D R 30 4 2
#> 5 E I 32 8 2
#> 6 F S 28 32 2
#> 7 G S 33 <=2 >=8
#> 8 H I 24 <=2 4
#> 9 I S 20 <=2 1
#> 10 J R 19 16 2
mean_amr_distance(y)
#> Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> [1] -0.351732344 0.165816825 0.045278388 -1.048629829 0.209372918
#> [6] 0.165816825 0.001722296 0.606383651 0.078704640 0.127266630
#> [1] 0.31430391 0.09942875 0.25436185 0.26948082 0.08306514 0.24576214
#> [7] 0.26823618 -0.44796371 -1.15734233 0.07066724
y$amr_distance <- mean_amr_distance(y, is.mic(y))
#> Calculating mean AMR distance based on columns "gent" and "tobr"
y[order(y$amr_distance), ]
#> id amox cipr gent tobr amr_distance
#> 1 A I 32 4 8 -0.6978278
#> 2 B R 32 4 8 -0.6978278
#> 4 D S 16 4 8 -0.6978278
#> 6 F R 32 4 8 -0.6978278
#> 3 C I 30 8 8 0.2704180
#> 7 G I 29 8 8 0.2704180
#> 10 J R 20 8 8 0.2704180
#> 5 E S 33 4 16 0.3372705
#> 9 I I 30 4 16 0.3372705
#> 8 H I 31 8 16 1.3055163
#> 9 I S 20 <=2 1 -1.1069930
#> 2 B R 28 8 1 -0.3684440
#> 3 C R 31 8 1 -0.3684440
#> 4 D R 30 4 2 -0.2349174
#> 8 H I 24 <=2 4 -0.1013907
#> 5 E I 32 8 2 0.1343571
#> 1 A R 26 4 4 0.2678838
#> 7 G S 33 <=2 >=8 0.4014105
#> 10 J R 19 16 2 0.5036316
#> 6 F S 28 32 2 0.8729061
if (require("dplyr")) {
y %>%
@@ -160,17 +160,17 @@ if (require("dplyr")) {
}
#> Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> id amox cipr gent tobr amr_distance check_id_C
#> 1 C I 30 8 8 0.045278388 0.00000000
#> 2 I I 30 4 16 0.078704640 0.03342625
#> 3 G I 29 8 8 0.001722296 0.04355609
#> 4 J R 20 8 8 0.127266630 0.08198824
#> 5 B R 32 4 8 0.165816825 0.12053844
#> 6 F R 32 4 8 0.165816825 0.12053844
#> 7 E S 33 4 16 0.209372918 0.16409453
#> 8 A I 32 4 8 -0.351732344 0.39701073
#> 9 H I 31 8 16 0.606383651 0.56110526
#> 10 D S 16 4 8 -1.048629829 1.09390822
#> id amox cipr gent tobr amr_distance check_id_C
#> 1 C R 31 8 1 0.25436185 0.000000000
#> 2 F S 28 32 2 0.24576214 0.008599711
#> 3 G S 33 <=2 >=8 0.26823618 0.013874329
#> 4 D R 30 4 2 0.26948082 0.015118966
#> 5 A R 26 4 4 0.31430391 0.059942062
#> 6 B R 28 8 1 0.09942875 0.154933106
#> 7 E I 32 8 2 0.08306514 0.171296709
#> 8 J R 19 16 2 0.07066724 0.183694618
#> 9 H I 24 <=2 4 -0.44796371 0.702325561
#> 10 I S 20 <=2 1 -1.15734233 1.411704178
if (require("dplyr")) {
# support for groups
example_isolates %>%