MyNixOS website logo
Description

'MGMS2' for Polymicrobial Samples.

A glycolipid mass spectrometry technology has the potential to accurately identify individual bacterial species from polymicrobial samples. To develop bacterial identification algorithms (e.g. machine learning) using this glycolipid technology, it is necessary to generate a large number of various in-silico polymicrobial mass spectra that are similar to real mass spectra. 'MGMS2' (Membrane Glycolipid Mass Spectrum Simulator) generates such in-silico mass spectra, considering errors in m/z (mass-to-charge ratio) and variances of intensity values, occasions of missing signature ions, and noise peaks. It estimates summary statistics of monomicrobial mass spectra for each strain or species and simulates polymicrobial glycolipid mass spectra using the summary statistics of monomicrobial mass spectra. References: Ryu, S.Y., Wendt, G.A., Chandler, C.E., Ernst, R.K. and Goodlett, D.R. (2019) <doi:10.1021/acs.analchem.9b03340> "Model-based Spectral Library Approach for Bacterial Identification via Membrane Glycolipids." Gibb, S. and Strimmer, K. (2012) <doi:10.1093/bioinformatics/bts447> "MALDIquant: a versatile R package for the analysis of mass spectrometry data."

MGMS2

Membrane Glycolipid Mass Spectrum Simulator for polymicrobial samples

User

Installation

Production Version

install.packages(c("MALDIquant","MALDIquantForeign"),type="source")
install.packages("MGMS2")
library("MGMS2")

or

R -e 'install.packages("MGMS2")'

Development Version

install.packages(c("MALDIquant","MALDIquantForeign"),type="source")
devtools::install_github("unreno/MGMS2")
library("MGMS2")

or

R -e 'devtools::install_github("unreno/MGMS2")'

Usage

library('MGMS2')

Removal

remove.packages("MGMS2")

Developer

Initial Creation

install.packages(c('devtools','roxygen2'))
library('devtools')
library('roxygen2')
create('MGMS2')

The "create()" function fails with "Error: Directory 'MGMS2' does not exist." after it creates DESCRIPTION and NAMESPACE files and an empty R/ dir. Kinda pointless. Could've just used a simple template for this. Is that what its supposed to do?

Creation / Updation / Posting

Create/Edit .R files in R/ folder with properly formated documentation above functions.

Then update NAMESPACE and man/ from within R ...

library('devtools')
document()

Or from the bash command line ...

R -e 'library(devtools);document()'

Install from the bash command line ...

R -e 'library(devtools);document();setwd("..");install("MGMS2",upgrade=FALSE)'

Or from R with some manual checking with sample data ...

remove.packages("MGMS2")
library('devtools')
document()

setwd('..')
install('MGMS2',upgrade=FALSE)
library('MGMS2')
lsf.str("package:MGMS2")
"MGMS2" %in% rownames(installed.packages())



spectra.processed.A <- process_monospectra(
	file=system.file("extdata", "listA.txt", package="MGMS2"),
	mass.range=c(1000,2200))
spectra.processed.B <- process_monospectra(
	file=system.file("extdata", "listB.txt", package="MGMS2"),
	mass.range=c(1000,2200))
spectra.processed.C <- process_monospectra(
	file=system.file("extdata", "listC.txt", package="MGMS2"),
	mass.range=c(1000,2200))

spectra.mono.summary.A <- summarize_monospectra(
	processed.obj=spectra.processed.A,
	species='A', directory=tempdir())
spectra.mono.summary.B <- summarize_monospectra(
	processed.obj=spectra.processed.B,
	species='B', directory=tempdir())
spectra.mono.summary.C <- summarize_monospectra(
	processed.obj=spectra.processed.C,
	species='C', directory=tempdir())

mono.info=gather_summary(c(spectra.mono.summary.A, spectra.mono.summary.B, spectra.mono.summary.C))

gather_summary_file(directory=tempdir())

mixture.ratio <- list()
mixture.ratio['A']=1
mixture.ratio['B']=0.5
mixture.ratio['C']=0

sim.template <- create_insilico_mixture_template(mono.info)

insilico.spectrum <- simulate_poly_spectra(sim.template, mixture.ratio)

insilico.spectrums <- simulate_many_poly_spectra(mono.info, mixture.ratio=mixture.ratio, nsim=10 )







remove.packages("MGMS2")

ADD AUTOMATED TESTING

ADD AUTOMATED VERSIONING

Then commit and push to github repo

git commit -m "<LIST UPDATES>" -a
git push

https://cran.r-project.org/

https://xmpalantir.wu.ac.at/cransubmit/

Check for CRAN issues ...

R -e 'library(devtools);document();setwd("..");install("MGMS2",upgrade=FALSE)'
VERSION=$( awk '(/^Version/){print $2}' DESCRIPTION )
cd ..
R CMD build MGMS2
R CMD check MGMS2_${VERSION}.tar.gz
R CMD check --as-cran MGMS2_${VERSION}.tar.gz

If all is well, try to submit to CRAN

Packaging References

https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/

https://kbroman.org/pkg_primer/

https://aberdeenstudygroup.github.io/studyGroup/lessons/SG-T4-Rpackages/makingRpackages1_Intro/

http://r-pkgs.had.co.nz

https://r-pkgs.org/release.html.

Metadata

Version

1.0.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows