transformcounts: Transform abundance data in an 'otu_table', sample-by-sample.

Description Usage Arguments Value See Also Examples

Description

This function transforms the sample counts of a taxa abundance matrix according to a user-provided function. The counts of each sample will be transformed individually. No sample-sample interaction/comparison is possible by this method.

Usage

1
2
3

Arguments

physeq

(Required). phyloseq-class of otu_table-class.

fun

(Required). A single-argument function that will be applied to the abundance counts of each sample. Can be an anonymous function.

...

(Optional). Additional, optionally-named, arguments passed to fun during transformation of abundance data.

Value

A transformed otu_table – or phyloseq object with its transformed otu_table. In general, trimming is not expected by this method, so it is suggested that the user provide only functions that return a full-length vector. Filtering/trimming can follow, for which the genefilter_sample and prune_taxa functions are suggested.

See Also

threshrankfun, rank, log

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12

Example output

OTU Table:          [10 taxa and 3 samples]
                     taxa are rows
           B  C  D
59_8_22 57.0 55 53
59_5_13 50.0 50 50
59_8_12 50.0 53 50
65_3_22 50.0 50 50
65_5_1  50.0 50 50
65_1_10 50.0 50 50
65_7_12 50.5 50 55
59_6_1  50.0 50 50
65_2_17 53.0 50 50
65_9_26 50.0 50 50
OTU Table:          [10 taxa and 3 samples]
                     taxa are rows
           B  C    D
59_8_22 57.0 55 53.0
59_5_13 15.5 38 10.5
59_8_12 46.5 53 10.5
65_3_22 15.5 38 31.5
65_5_1  15.5 13 31.5
65_1_10 15.5 13 31.5
65_7_12 50.5 38 55.0
59_6_1  15.5 30 10.5
65_2_17 53.0 30 50.0
65_9_26 15.5 13 50.0
[1] FALSE
OTU Table:          [10 taxa and 3 samples]
                     taxa are rows
               B        C        D
59_8_22 4.007333 3.178054 2.302585
59_5_13 1.609438 1.945910 1.609438
59_8_12 1.945910 2.890372 1.609438
65_3_22 1.609438 1.945910 1.791759
65_5_1  1.609438 1.609438 1.791759
65_1_10 1.609438 1.609438 1.791759
65_7_12 2.079442 1.945910 2.639057
59_6_1  1.609438 1.791759 1.609438
65_2_17 2.397895 1.791759 2.079442
65_9_26 1.609438 1.609438 2.079442
OTU Table:          [10 taxa and 3 samples]
                     taxa are rows
           B   C   D
59_8_22 5467 651  34
59_5_13    0   5   0
59_8_12    5 282   0
65_3_22    0   5   1
65_5_1     0   0   1
65_1_10    0   0   1
65_7_12   11   5 126
59_6_1     0   1   0
65_2_17   52   1  11
65_9_26    0   0  11

phyloseq documentation built on Nov. 8, 2020, 6:41 p.m.