in2manta {manta} | R Documentation |
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.
align2manta(x, cond.clmn, agg.clmn, gene.clmns, meta.clmns, weight.clmn=NULL, tag.clmn=NULL, ...) counts2manta(x, annotation, a.merge.clmn, agg.clmn, gene.clmns=NULL, meta.clmns=NULL, ...) tableMetaSums(x, meta.clmns, cond.clmn=NULL, count.clmns=NULL) tableMetas(x, agg.clmn, meta.clmns, cond.clmn=NULL, count.clmns=NULL)
x |
The alignment or counts table. |
cond.clmn |
A string indicating which column contains the conditions. (only two different levels two allowed) |
agg.clmn |
A string indicating which column in the annotation table contains the aggregation index. |
annotation |
An annotation table with genes and/or meta information. |
a.merge.clmn |
A stringn indicating which column in the annotation table on which to merge. These should correspond to the row names of the counts table. |
gene.clmns |
A vector of strings indicating which column contains gene annotation information. |
meta.clmns |
A vector of strings indicating which column contains meta/taxinomic information. |
weight.clmn |
A string indicating which column contains weighting information. |
count.clmns |
A string indicating which column in a pre-cross-tabulated meta annotation table contains counts. These counts are multiplied by the result of tableMetas()'s cross-tabulated counts to genereate the meta tables. |
tag.clmn |
A string indicating which column corresponds to individual read names. Only necessary when a single read has multiple annotation records in the table. |
... |
additional parameters passed along to manta() |
A MANTA object
manta
align.path <- system.file("extdata","PapaGO-BLAST.results-diatoms.tab", package="manta") a <- read.delim(align.path, stringsAsFactors=FALSE) x <- align2manta(a, cond.clmn='treatment', agg.clmn='what_def', gene.clmns=c('what_def','kid','pathway'), meta.clmns=c('family','genus_sp')) cts.path <- system.file("extdata","PapaGO-BWA.counts-diatoms.tab", package="manta") cts <- read.delim(cts.path) cts.annot.path <- system.file("extdata","PapaGO-BWA.annot-diatoms.tab", package="manta") cts.annot <- read.delim(cts.annot.path, stringsAsFactors=FALSE) x <- counts2manta(cts, annotation=cts.annot, a.merge.clmn='query_seq', agg.clmn='what_def', meta.clmns=c('family','genus_sp'), gene.clmns=c('what_def','kid','pathway'))