Skip to content

TaxR, R utils for taxonomy

Matteo Chialva edited this page Dec 21, 2018 · 3 revisions

TaxR.R

My R script collection to manipulate and reformat OTUs/features tables

filter_reads

The function filter count tables keeping rows where at least X samples (columns) have at least Y reads and outputs the processed data.frame adding the taxid column. The miniumum samples and reads number to keep can be set.

filter_reads(counts_table, min.sample, min.reads)

LCA_level

Cuts counts table at given taxonomic rank (sum reads below given level). In samples_column argument the column range where counts are must be set.

LCA_level(counts_table, rank, samples_column)

reduce_taxa

Trasposes, order for reads number and select N top-taxa. Counts of not considered taxa are grouped under "Other" category. Input counts table must contain taxa as rows and samples as columns.

reduce_taxa<-function(counts_table, N)

Clone this wiki locally