FEAST: A scalable algorithm for quantifying the origins of complex...

Description Usage Arguments Value Examples

View source: R/FEAST.R

Description

FEAST performs microbial source tracking. As input, it takes a count matrix C of size m by n and a metadata table, of size m by 3, where m is the number samples and n is the number of taxa. The rownames of both C and the metadata table are the unique sample ids.

Usage

1
2
FEAST(C, metadata, EM_iterations = 1000, COVERAGE = NULL,
  different_sources_flag = 1)

Arguments

C

An m by n count matrix, where m is the number samples and n is the number of taxa.

metadata

An m by 3 table, where m is the number samples. The metadata table has three colunms (i.e., 'Env', 'SourceSink', 'id'). The first column is a description of the sampled environment (e.g., human gut), the second column indicates if this sample is a source or a sink (can take the value 'Source' or 'Sink'). The fourth column is the Sink-Source id. When using multiple sinks, each tested with the same group of sources, only the rows with 'SourceSink' = Sink will get an id (between 1 - number of sinks in the data). In this scenatio, the sources ids are blank. When using multiple sinks, each tested with a distinct group of sources, each combination of sink and its corresponding sources should get the same id (between 1 - number of sinks in the data). Note that these names must be respected.

EM_iterations

A numeric value indicating the number of EM iterations (default 1000).

COVERAGE

A numeric value indicating the rarefaction depth (default = minimal sequencing depth within each group of sink and its corresponding sources).

different_sources_flag

A boolian value indicating the source-sink assignment. different_sources_flag = 1 if different sources are assigned to each sink , otherwise = 0.

Value

P - an S1 by S2 matrix, where S1 is the number sinks and S2 is the number of sources (including an unknown source). Each row in matrix P sums to 1. Pij is the contribution of source j to sink i. If Pij == NA it indicateds that source j was not used in the analysis of sink i.

Examples

1
2
3
4
5
6
7
8
#Load metadata table

#Load count matrix

#Calculate the sources' contributions to
#each sink sample in the data
FEAST_output <- FEAST(count_matrix = otus, metadata = metadata,
                     different_sources_flag = 1)

wsteenhu/FEAST documentation built on Jan. 14, 2022, 6:06 a.m.