Last data update: 2014.03.03

R: Convert a count or alignment table into a MANTA object
in2mantaR Documentation

Convert a count or alignment table into a MANTA object

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

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)

Arguments

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()

Value

A MANTA object

See Also

manta

Examples


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'))



Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(manta)
Loading required package: edgeR
Loading required package: limma
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/manta/in2manta.Rd_%03d_medium.png", width=480, height=480)
> ### Name: in2manta
> ### Title: Convert a count or alignment table into a MANTA object
> ### Aliases: in2manta align2manta counts2manta tableMetas tableMetaSums
> 
> ### ** Examples
> 
> 
> 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'))
Warning message:
In estimateCommonDisp.DGEList(obj) :
  There is no replication, setting dispersion to NA.
> 
> 	
> 
> 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'))
Warning message:
In estimateCommonDisp.DGEList(obj) :
  There is no replication, setting dispersion to NA.
> 
> 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>