normfact2absTMM: Convert a count or alignment table into a MANTA object

Description Usage Arguments Value See Also Examples

View source: R/Summary.R

Description

This function converts a table of alignment data (BLAST for example) where each record is a read and each column is some parameter of the blast(s). The function will perform a cross-tabulation of the annotated reads into count data using (at the very least) an aggregation index column and a condition column. Alternatively, the input can be pre-tabulated counts and a corresponding annotation table. The two tableMeta helper functions (called by the x2manta functions) are also documented here.

Usage

1
normfact2absTMM(x, pair, f=nv(x$samples, 'norm.factors'), sums=colSums(x$counts))

Arguments

x

The manta object (can be NULL if f and sums are specified independently).

pair

A named vector indicating the condition names and the corresponding the reference or observation status of each.

f

The Normalization factors. By default uses the norm.factors column of the sample dataframe in x.

sums

The column sums of the counts. By default uses the column sums of the x$counts table.

Value

a scalar normalization factor

See Also

manta, mantaMethod

Examples

1
2
3
4
5
conditions <- caroline::nv(factor(x=1:2, labels=c('ambient','plusFe')) ,c('ref','obs'))
manta.path <- system.file("extdata","PapaGO-BLAST.results-diatoms.Rdata", package="manta")
load(manta.path)

x$mm <- normfact2absTMM(x=x, pair=conditions)

armbrustlab/manta documentation built on Dec. 17, 2019, 12:06 a.m.