From 5526b308f300f80fbaf7f5da771371f3697340f8 Mon Sep 17 00:00:00 2001 From: cpauvert Date: Wed, 11 Sep 2024 18:13:29 +0200 Subject: [PATCH] remove the need for a README.Rmd and use plain .md small edits to the README to make it more compact and for readability --- README.Rmd | 99 ------------------------------------ README.md | 144 ++++++++++------------------------------------------- 2 files changed, 27 insertions(+), 216 deletions(-) delete mode 100644 README.Rmd diff --git a/README.Rmd b/README.Rmd deleted file mode 100644 index 2a35538..0000000 --- a/README.Rmd +++ /dev/null @@ -1,99 +0,0 @@ ---- -output: github_document ---- - - - -```{r, include = FALSE} -knitr::opts_chunk$set( - collapse = TRUE, - comment = "#>", - fig.path = "man/figures/README-", - out.width = "100%" -) -``` - -# maldipickr maldipickr website - - -[![CRAN status](https://www.r-pkg.org/badges/version/maldipickr)](https://CRAN.R-project.org/package=maldipickr) -[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) -[![R-CMD-check](https://github.com/ClavelLab/maldipickr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ClavelLab/maldipickr/actions/workflows/R-CMD-check.yaml) -[![codecov](https://codecov.io/github/ClavelLab/maldipickr/branch/main/graph/badge.svg?token=JQABKDK2MB)](https://app.codecov.io/github/ClavelLab/maldipickr) - - - -- You are using the MALDI-TOF[^maldi] Biotyper to identify bacterial isolates -- You want to select representative isolates for further experiments -- You need fast and automated selection decisions that you can retrace - -`{maldipickr}` provides documented and tested R functions that will help you dereplicate MALDI-TOF data and cherry-pick representative spectra of microbial isolates. - - -## Graphical overview - -Thumbnail of maldipickr graphical overview - -Illustration (click for a bigger version) of the data flow when using `{maldipickr}` to cherry-pick bacterial isolates with MALDI Biotyper. It depicts the two possible approaches using either taxonomic identification reports (left) or spectra data (right). - - -## Installation - -`{maldipickr}` is available on the [CRAN](https://cran.r-project.org/package=maldipickr) and on [GitHub](https://github.com/ClavelLab/maldipickr). - -To install the latest CRAN release, use the following command in R: - -```{r install_cran, eval = FALSE} -install.packages("maldipickr") -``` - - -To install the development version, use the following command in R: - -```{r install_github, eval = FALSE} -remotes::install_github("ClavelLab/maldipickr", build_vignettes = TRUE) -``` - -## Usage - -The comprehensive vignettes will walk you through the package functions and showcase how to: - -1. [Import spectra data and identification reports from Bruker MALDI Biotyper into R](https://clavellab.github.io/maldipickr/articles/import-data-from-bruker-maldi-biotyper.html). -2. [Process, dereplicate and cherry-pick representative spectra, from simple to complex design](https://clavellab.github.io/maldipickr/articles/dereplicate-bruker-maldi-biotyper-spectra.html). - -## Troubleshoot - -If something unexpected happened when using this package, please first search the [current open or closed issues](https://github.com/ClavelLab/maldipickr/issues?q=is%3Aissue++) to look for similar problems. If you are the first, you are more than welcome to open a new issue using the "Bug report" template with a minimal -[reprex](https://www.tidyverse.org/help/#reprex). - -## Contribute - -All contributions are welcome and the [`CONTRIBUTING.md`](https://clavellab.github.io/maldipickr/CONTRIBUTING.html) documents how to participate. - -Please note that the [`{maldipickr}`](https://github.com/ClavelLab/maldipickr) package is released with a [Contributor Code of Conduct](https://clavellab.github.io/maldipickr/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. - -## Credits - -### Acknowledgements - -This R package is developed for spectra data generated by the Bruker MALDI Biotyper device. The [`{maldipickr}`](https://github.com/ClavelLab/maldipickr) package is built from a suite of Rmarkdown files using the [`{fusen}`](https://thinkr-open.github.io/fusen/) package by Rochette S (2023). It relies on: - -1. the [`{MALDIquant}`](https://cran.r-project.org/package=MALDIquant) package from Gibb & Strimmer (2012) for spectra functions -2. the work of Strejcek et al. (2018) for the dereplication procedure. - -### Disclaimer - -The developers of this package are part of the [Clavel Lab](https://www.ukaachen.de/kliniken-institute/institut-fuer-medizinische-mikrobiologie/forschung/ag-clavel/) and are not affiliated with the company Bruker, therefore this package is independent of the company and is distributed under the [GPL-3.0 License](https://clavellab.github.io/maldipickr/LICENSE.html). - -The hexagonal logo was created by Charlie Pauvert and uses the [Atkinson Hyperlegible font](https://fonts.google.com/specimen/Atkinson+Hyperlegible/about) font and a color palette generated at [coolors.co](https://coolors.co/cf5c36-f0f0c9-555358). - - -## References - -* Gibb S & Strimmer K (2012). "MALDIquant: a versatile R package for the - analysis of mass spectrometry data". *Bioinformatics* 28, 2270-2271. . -* Rochette S (2023). "fusen: Build a Package from Rmarkdown Files". , . -* Strejcek M, Smrhova T, Junkova P & Uhlik O (2018). “Whole-Cell MALDI-TOF MS versus 16S rRNA Gene Analysis for Identification and Dereplication of Recurrent Bacterial Isolates.” *Frontiers in Microbiology* 9 . - - -[^maldi]: Matrix-Assisted Laser Desorption/Ionization-Time-Of-Flight (MALDI-TOF) diff --git a/README.md b/README.md index 4c96865..60f91b3 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ - # maldipickr maldipickr website [![CRAN -status](https://www.r-pkg.org/badges/version/maldipickr)](https://CRAN.R-project.org/package=maldipickr) +status](https://www.r-pkg.org/badges/version/maldipickr.png)](https://CRAN.R-project.org/package=maldipickr) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) @@ -23,100 +22,10 @@ developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.re you dereplicate MALDI-TOF data and cherry-pick representative spectra of microbial isolates. -## Graphical overview - -Thumbnail of maldipickr graphical overview - -Illustration (click for a bigger version) of the data flow when using -`{maldipickr}` to cherry-pick bacterial isolates with MALDI Biotyper. It -depicts the two possible approaches using either taxonomic -identification reports (left) or spectra data (right). - -## Quickstart - -How to **cherry-pick bacterial isolates** with MALDI Biotyper: - -- [using taxonomic identification - report](#using-taxonomic-identification-report) -- [using spectra data](#using-spectra-data) - -### Using taxonomic identification report - -``` r -library(maldipickr) -# Import Biotyper CSV report -# and glimpse at the table -report_tbl <- read_biotyper_report( - system.file("biotyper_unknown.csv", package = "maldipickr") -) -report_tbl %>% - dplyr::select(name, bruker_species, bruker_log) -#> # A tibble: 4 × 3 -#> name bruker_species bruker_log -#> -#> 1 unknown_isolate_1 not reliable identification 1.33 -#> 2 unknown_isolate_2 not reliable identification 1.4 -#> 3 unknown_isolate_3 Faecalibacterium prausnitzii 1.96 -#> 4 unknown_isolate_4 Faecalibacterium prausnitzii 2.07 - - -# Delineate clusters from the identifications after filtering the reliable ones -# and cherry-pick one representative spectra. -# The chosen ones are indicated by `to_pick` column -report_tbl <- report_tbl %>% - dplyr::mutate( - bruker_species = dplyr::if_else(bruker_log >= 2, bruker_species, - "not reliable identification") - ) -report_tbl %>% - delineate_with_identification() %>% - pick_spectra(report_tbl, criteria_column = "bruker_log") %>% - dplyr::relocate(name, to_pick, bruker_species) -#> Generating clusters from single report -#> # A tibble: 4 × 11 -#> name to_pick bruker_species membership cluster_size sample_name hit_rank -#> -#> 1 unknown_i… TRUE not reliable … 2 1 1 -#> 2 unknown_i… TRUE not reliable … 3 1 1 -#> 3 unknown_i… TRUE not reliable … 4 1 1 -#> 4 unknown_i… TRUE Faecalibacter… 1 1 1 -#> # ℹ 4 more variables: bruker_quality , bruker_taxid , -#> # bruker_hash , bruker_log -``` - -### Using spectra data - -``` r -library(maldipickr) -# Set up the directory location of your spectra data -spectra_dir <- system.file("toy-species-spectra", package = "maldipickr") - -# Import and process the spectra -processed <- spectra_dir %>% - import_biotyper_spectra() %>% - process_spectra() - -# Delineate spectra clusters using Cosine similarity -# and cherry-pick one representative spectra. -# The chosen ones are indicated by `to_pick` column -processed %>% - list() %>% - merge_processed_spectra() %>% - coop::tcosine() %>% - delineate_with_similarity(threshold = 0.92) %>% - set_reference_spectra(processed$metadata) %>% - pick_spectra() %>% - dplyr::relocate(name, to_pick) -#> # A tibble: 6 × 7 -#> name to_pick membership cluster_size SNR peaks is_reference -#> -#> 1 species1_G2 FALSE 1 4 5.09 21 FALSE -#> 2 species2_E11 FALSE 2 2 5.54 22 FALSE -#> 3 species2_E12 TRUE 2 2 5.63 23 TRUE -#> 4 species3_F7 FALSE 1 4 4.89 26 FALSE -#> 5 species3_F8 TRUE 1 4 5.56 25 TRUE -#> 6 species3_F9 FALSE 1 4 5.40 25 FALSE -``` +> Check out the graphical overview (click for a bigger version). +> `{maldipickr}` can use two approaches: +> from taxonomic identification reports (left) or from spectra data (right). +> Thumbnail of maldipickr graphical overview ## Installation @@ -130,16 +39,26 @@ To install the latest CRAN release, use the following command in R: install.packages("maldipickr") ``` +Or if you are using [`{renv}`](https://cran.r-project.org/package=renv), +use: + +``` r +renv::install("maldipickr") +``` + To install the development version, use the following command in R: ``` r remotes::install_github("ClavelLab/maldipickr", build_vignettes = TRUE) +# or with renv::install("ClavelLab/maldipickr") ``` ## Usage -The comprehensive vignettes will walk you through the package functions -and showcase how to: +Start off with the [Introduction to +maldipickr](https://clavellab.github.io/maldipickr/articles/maldipickr.html) +for a quickstart. Otherwise, the comprehensive vignettes will walk you +through the package functions and showcase how to: 1. [Import spectra data and identification reports from Bruker MALDI Biotyper into @@ -148,22 +67,18 @@ and showcase how to: simple to complex design](https://clavellab.github.io/maldipickr/articles/dereplicate-bruker-maldi-biotyper-spectra.html). -## Troubleshoot +## Troubleshoot and Contribute -If something unexpected happened when using this package, please first -search the [current open or closed +**Troubleshoot** If something unexpected happened when using this +package, please first search the [current open or closed issues](https://github.com/ClavelLab/maldipickr/issues?q=is%3Aissue++) to look for similar problems. If you are the first, you are more than welcome to open a new issue using the “Bug report” template with a minimal [reprex](https://www.tidyverse.org/help/#reprex). -## Contribute - -All contributions are welcome and the +**Contribute** All contributions are welcome and the [`CONTRIBUTING.md`](https://clavellab.github.io/maldipickr/CONTRIBUTING.html) -documents how to participate. - -Please note that the +documents how to participate. Please note that the [`{maldipickr}`](https://github.com/ClavelLab/maldipickr) package is released with a [Contributor Code of Conduct](https://clavellab.github.io/maldipickr/CODE_OF_CONDUCT.html). @@ -171,10 +86,8 @@ By contributing to this project, you agree to abide by its terms. ## Credits -### Acknowledgements - -This R package is developed for spectra data generated by the Bruker -MALDI Biotyper device. The +**Acknowledgements** This R package is developed for spectra data +generated by the Bruker MALDI Biotyper device. The [`{maldipickr}`](https://github.com/ClavelLab/maldipickr) package is built from a suite of Rmarkdown files using the [`{fusen}`](https://thinkr-open.github.io/fusen/) package by Rochette S @@ -184,15 +97,12 @@ built from a suite of Rmarkdown files using the package from Gibb & Strimmer (2012) for spectra functions 2. the work of Strejcek et al. (2018) for the dereplication procedure. -### Disclaimer - -The developers of this package are part of the [Clavel +**Disclaimer** The developers of this package are part of the [Clavel Lab](https://www.ukaachen.de/kliniken-institute/institut-fuer-medizinische-mikrobiologie/forschung/ag-clavel/) and are not affiliated with the company Bruker, therefore this package is independent of the company and is distributed under the [GPL-3.0 -License](https://clavellab.github.io/maldipickr/LICENSE.html). - -The hexagonal logo was created by Charlie Pauvert and uses the [Atkinson +License](https://clavellab.github.io/maldipickr/LICENSE.html). The +hexagonal logo was created by Charlie Pauvert and uses the [Atkinson Hyperlegible font](https://fonts.google.com/specimen/Atkinson+Hyperlegible/about) font and a color palette generated at