View source: R/analyseTaxaInA.R
analyseTaxaInA | R Documentation |
The function expects an interaction matrix with taxon names given as row and column names and their assignment to a higher taxonomic level given in the first column (can be generated with assignTaxonLevelsToA). Either the edge number or the p-value of the edge number given the number of taxa in both higher-level taxon groups is reported. The p-value is computed by randomizing the interaction matrix while preserving the total number of its entries. Entries (i,j) and (j,i) in the interaction matrix are counted as one interaction by default.
analyseTaxaInA(taxonA, count.entries = FALSE, count.loops = FALSE, report.pval = FALSE, report.rand = FALSE, pos.only = FALSE, neg.only = FALSE, iters = 100, p.threshold = 0.05, sig = FALSE)
taxonA |
an interaction matrix with taxonomy (first column contains higher-level taxa) |
count.entries |
instead of interactions, count links (so entries (i,j) and (j,i) are not combined, but counted separately) |
count.loops |
count link of a node to itself |
report.pval |
if true, entries in the resulting interaction matrix are p-values of edge number between taxonomic groups, else edge numbers |
report.rand |
return the mean number of links found in randomized matrices |
pos.only |
only consider positive entries in taxonA |
neg.only |
only consider negative entries in taxonA |
iters |
number of randomizations for report.pval |
p.threshold |
only report higher-level links with p-values below given threshold |
sig |
convert p-values into significances |
an interaction matrix with as many rows and columns as there are distinct higher-level taxa in the first column of the input
data("david_stool_lineages") # make a random OTU interaction matrix as an example N=30 A=generateA(N=N,c=0.1) randomOTUIndices=sample(1:nrow(david_stool_lineages))[1:N] rownames(A)=david_stool_lineages[randomOTUIndices,1] colnames(A)=rownames(A) A.otu=assignTaxonLevelsToA(A,lineages=david_stool_lineages, taxon.level="genus",no.merge=TRUE) A.phylum=analyseTaxaInA(A.otu,count.loops=TRUE, count.entries=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.