refseq {phyloseq} | R Documentation

## Retrieve reference sequences (`XStringSet`-class) from object.

### Description

This is the suggested method for accessing the phylogenetic tree, (`XStringSet`-class) from a phyloseq data object (`phyloseq-class`). Like other accessors (see See Also, below), the default behavior of this method is to stop with an error if `physeq` is a `phyloseq-class` but does not contain reference sequences (the component data type you are trying to access in this case).

### Usage

    refseq(physeq, errorIfNULL=TRUE)

    ## S4 method for signature 'ANY'
    refseq(physeq, errorIfNULL = TRUE)

    ## S4 method for signature 'XStringSet'
    refseq(physeq)

### Arguments

`physeq` | (Required). An instance of phyloseq-class that contains a phylogenetic tree. If physeq is a phylogenetic tree (a component data class), then it is returned as-is.
`errorIfNULL` | (Optional). Logical. Should the accessor stop with an error if the slot is empty (`NULL`)? Default `TRUE`.

### Value

The `phylo`-class object contained within `physeq`; or NULL if `physeq` does not have a tree. This method stops with an error in the latter NULL case be default, which can be over-ridden by changing the value of `errorIfNULL` to `FALSE`.

### See Also

`otu_table`, `sample_data`, `tax_table` `phy_tree`, `phyloseq`, `merge_phyloseq`

### Examples

     data(GlobalPatterns)
     refseq(GlobalPatterns, FALSE)

[Package phyloseq version 1.30.0 Index]