compositionGenomesMetaT: Define the species composition of all samples in a...

Description Usage Arguments Details Value References Examples

View source: R/read_distribution_genomes.R

Description

compositionGenomesMetaT returns a composition matrix with rows as species/ genomes and columns as samples (cases or controls)

Usage

1
2
3
4
5
6
7
8
9
compositionGenomesMetaT(
  composition = c("custom", "empirical", "even"),
  empiricalSeed = NULL,
  genomes,
  compositionMatrix = NULL,
  nReads = 1e+06,
  nReplicates = 10,
  seed = 42
)

Arguments

composition

A character string indicating which method to use to determine the composition of the matrix. Any of "custom", "empirical" or "even" can be used. See "details"

empiricalSeed

A single number or a numeric vector of length equal to nReplicates. Indicates the random seed to assign the reads to different species in each sample. If NULL or a single number, the same seed will be applied to all samples so that they will have the same composition, with differences only due to random sampling

genomes

Character vector of genome names or genome IDs for the genomes to include in the simulation

compositionMatrix

A composition matrix predefined by the user, in which rows represent species and columns represent samples. Id user provides a composition matrix, this function only performs the random sampling to scale to the number of reads desired. Defaults to NULL

nReads

An integer, indicating the number of reads to simulate per sample.

nReplicates

An integer, indicating the total samples (cases and controls).

seed

An integer, sets the random seed for the read distribution.

Details

There are three options to distribute the total reads among the different species to simulate: - custom: requires that the user provides a custom composition matrix and scales it via random sampling (with replacement) to the specified number of reads in nReads - even: reads are distributed evenly among all the species listed in the genomes argument. - empirical: fits a negative binomial distribution (Vandeputte D. et al, 2017) to a real dataset (Martinez X. et al, 2016) of metatranscriptomics data. Uses this distribution to generate a composition matrix from the species listed in the genomes argument.

Value

A microbial composition matrix of nReplicates columns and nrow(genomes) rows.

References

Martinez X. et al (2016): MetaTrans: an open source pipeline for metatranscriptomics Scientific Reports 6, Article number: 26447 Vandeputte D. et al (2017): Quantitative microbiome profiling links gut community variation to microbial load. Nature 551:507–511

Examples

1
2
3
4
5
6
# define a list of genomes to simulate
genomesToSimulate <- c("F. prausnitzii", "R. intestialis", "L. lactis", "E. faecalis",
                       "R. obeum")
# obtain the empirical composition matrix for this 5 species
compositionGenomesMetaT(composition="empirical", empiricalSeed=1,
                        genomes=genomesToSimulate, nReads=500000,nReplicates=10)

vllorens/metaester documentation built on April 26, 2020, 6:55 p.m.