Learn R Programming

OTUbase (version 1.22.0)

clusterSamples: clusterSamples

Description

This function is a wrapper for the vegan function vegedist and hclust. It allows the user to cluster samples using a number of different distance measure and clustering methods. Please see the documentation for vegedist and hclust for a more indepth explanation.

Usage

clusterSamples(object, ...)

Arguments

object
An OTUset or a TAXset object
...
Additional arguments. These will depend on if the object is an OTUset or a TAXset object.

Details

These are other arguments passed to clusterSamples. For further information on specific arguments, please see abundance, vegdist, or hclust.
  • taxCol Column of the tax slot dataframe on which to cluster (unique to TAXset objects). Passed to the abundance function.
  • assignmentCol Column of the assignmentData dataframe used to classify sequences for clustering. This overrides the default of using the OTUs to cluster samples. This is passed to the abundance function.
  • collab Specifies a column of the sampleData dataframe that will provide the sample lables for the cluster analysis. This is passed to the abundance function.
  • distmethod The distance method to be used. This value is passed to the vegedist function. The default is the Bray-Curtis distance.
  • clustermethod The clustering method to be used. This value is passed to the hclust function. The default is complete clustering.

Examples

Run this code

## locate directory with data
dirPath <- system.file("extdata/Sogin_2006", package="OTUbase")

## read in data into OTUset object
soginOTU <- readOTUset(dirPath=dirPath, level="0.03", samplefile="sogin.groups", fastafile="sogin.fasta", otufile="sogin.unique.filter.fn.list", sampleADF="sample_metadata.txt")

## cluster samples
clusterSamples(soginOTU, collab="Site", distmethod="jaccard")

Run the code above in your browser using DataLab