concentr8r

An R package containing functions that load, process, normalise and visualise NMR spectra for metabolomic study.

https://github.com/kbario/concentr8r

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.8%) to scientific vocabulary

Keywords

data-science data-visualization metabolomics nmr-spectroscopy r
Last synced: 7 months ago · JSON representation

Repository

An R package containing functions that load, process, normalise and visualise NMR spectra for metabolomic study.

Basic Info
Statistics
  • Stars: 2
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Topics
data-science data-visualization metabolomics nmr-spectroscopy r
Created over 4 years ago · Last pushed over 3 years ago
Metadata Files
Readme Changelog License Citation

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# concentr8r




concentr8r is a collection of normalisation functions that are intended for magnetic resonance spectroscopy (MRS) spectra, more specifically that from nuclear magnetic resonance (NMR) and mass spectrometry (MS). Normalisation is a crucial yet context-dependent aspect of analysing MRS data meaning that one method may work perfectly with one study but make the spectra in another study worse so having a diverse range of techniques available is useful. This is a collection of such methods sourced from published literature.

## Installation







concentr8r is currently only available on [GitHub](https://github.com/) and can be sourced using the code below:

``` r
# install.packages("devtools")
devtools::install_github("kylebario/concentr8r")
```
## Standard Pipeline

The intended use of concentr8r is to manipulate your NMR spectra so that they are as comparable as possible. This includes properly preprocessing the spectra, removing regions that are non-quantative, as well as correcting/flattening the baseline. It also includes normalising your spectra and removing the effects of dilution so that their concentrations are comparable.    
Below is the code for the standard pipeline used to preprocess NMR spectra:

```{r example}
library(concentr8r)
read_in(path=system.file('extdata',package='concentr8r'),exp_type=list(exp=c("PROF_URINE_NOESY")), n_spec = 'multiple')
plot(ppm, X[2,], type = 'l', col = 'red', main = 'The Same NMR Spectrum (Processed vs. Non Processed)', xlab = 'Chemical Shift (ppm)', ylab = 'Intensity', xlim = c(10,-1))
preproc(X, ppm, meta, flip = TRUE, cali = TRUE, calib = 'tsp')
points(ppm, X[2,], type = 'l', col = 'blue')
legend('topleft', legend = c("Unprocessed", "Processed"), col = c('red', 'blue'), lty = 1)
plot(ppm, X[2,], type = 'l', col = 'red', main = 'Two Spectra Unnormalised', xlab = 'Chemical Shift (ppm)', ylab = 'Intensity', xlim = c(9.5,0.25))
points(ppm, X[1,], type = 'l', col = 'blue')
legend('topleft', legend = c("Spectrum 1", "Spectrum 2"), col = c('red', 'blue'), lty = 1)
pqNorm(X, noi)
plot(ppm, X_pqn[2,], type = 'l', col = 'red', main = 'Two Spectra Normalised', xlab = 'Chemical Shift (ppm)', ylab = 'Intensity', xlim = c(9.5,0.25))
points(ppm, X_pqn[1,], type = 'l', col = 'blue')
legend('topleft', legend = c("Spectrum 1", "Spectrum 2"), col = c('red', 'blue'), lty = 1)
```

As you can see there are multiple stages in preprocessing, that build to producing highly comparable spectra which is made all the easier by concentr8r.

## Data Manipulation Functions

Data Manipulation ranges from ensuring the spectra are correctly orientated to scaling spectra based on their relationship to a reference. Here are some of the functions within concentr8r designed to do just that.

### Flip

```{r pressure, echo = FALSE}
library(concentr8r)
read_in(path=system.file('extdata',package='concentr8r'),exp_type=list(exp=c("PROF_URINE_NOESY")))
Xf <- flip(X, ppm)
par(mfrow = c(1,2))
plot(ppm,X[1,],type='l',xlim=c(9.5,0.25),col='red',main="Disorientated NMR Spectrum",ylab="X")
plot(ppm,Xf[1,],type='l',xlim=c(9.5,0.25),col ='blue',main="Orientated NMR Spectrum",ylab="Xf")
```


Owner

  • Name: Kyle Bario
  • Login: kbario
  • Kind: user
  • Location: Western Australia

Code and its applications are joys in life. Web Dev | Science | nvim

GitHub Events

Total
Last Year

Dependencies

DESCRIPTION cran
  • R >= 4.0 depends
  • plyr * imports
  • ptw * imports
  • stats * imports
  • knitr * suggests
  • rmarkdown * suggests