Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
naomiwilson authored Jul 18, 2024
1 parent 6754476 commit 7629fc6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ weiss2021_vanc %>%

![](tools/readme/weiss_vancomycin_index-1.png)<!-- -->

For healthy children, the medain value of the index is about 0.2,
whereas it is roughly 0.85 across the samples from children with sepsis.
For healthy children, the medain value of the index is about -0.2,
whereas it is roughly -0.85 across the samples from children with sepsis.
Let’s look further into how the index was calculated, and check out
which bacteria were labeled as susceptible or resistant to vancomycin.

Expand Down Expand Up @@ -246,7 +246,7 @@ Most taxa in the sample are annotated as susceptible to vancomycin,
including the most abundant taxon, *Ruminococcaceae*. One taxon, RF39,
is not annotated. Only a few taxa are annotated as resistant to
vancomycin, thus it’s not surprising that the vancomycin index for the
sample is negative.
sample is positive.

``` r
healthy6_data %>%
Expand All @@ -257,13 +257,13 @@ healthy6_data %>%
#> 1 0.207
```

How would we expect the proportions to change if the index increased to
a positive value, say 0.5? We can use `predict_abundance()` to run the
How would we expect the proportions to change if the index decreased to
a negative value, say -0.5? We can use `predict_abundance()` to run the
calculation.

``` r
healthy6_data %>%
mutate(predicted = predict_abundance(0.5, proportion, susceptibility)) %>%
mutate(predicted = predict_abundance(-0.5, proportion, susceptibility)) %>%
rename(observed = proportion) %>%
pivot_longer(
c(observed, predicted), names_to = "method", values_to = "abundance") %>%
Expand All @@ -283,11 +283,11 @@ the taxon that’s not annotated, RF39 (near the middle), the abundance
has not changed at all.

To finish, let’s re-calculate the vancomycin index for our predicted
abundances, so we can verify that it has the expected value of 0.5.
abundances, so we can verify that it has the expected value of -0.5.

``` r
healthy6_data %>%
mutate(predicted = predict_abundance(0.5, proportion, susceptibility)) %>%
mutate(predicted = predict_abundance(-0.5, proportion, susceptibility)) %>%
summarise(vanc = mirix_vancomycin(predicted, lineage))
#> # A tibble: 1 × 1
#> vanc
Expand Down

0 comments on commit 7629fc6

Please sign in to comment.