[,TreeIndex,ANY,ANY,ANY-method {scTreeViz} | R Documentation

## Subset TreeIndex

### Description

Subset TreeIndex

Generic method to get nodes at a tree level

Method to get nodes at a tree level

Generic method for possible node states

Method to get possible node states a node state is 0 if removed, 1 if expanded to show children & 2 if counts are aggregated to the node

Generic method to split the tree

splitAt divides the TreeIndex into groups defined by the level, node selections and filters(start, end)

Show the TreeIndex object

### Usage

    ## S4 method for signature 'TreeIndex,ANY,ANY,ANY'
    x[i, j, ..., drop = FALSE]

    getNodes(x, ...)

    ## S4 method for signature 'TreeIndex'
    getNodes(x, selectedLevel = NULL)

    getNodeStates(x)

    ## S4 method for signature 'TreeIndex'
    getNodeStates(x)

    splitAt(x, ...)

    ## S4 method for signature 'TreeIndex'
    splitAt(
      x,
      selectedLevel = 3,
      selectedNodes = NULL,
      start = 1,
      end = NULL,
      format = "list"
    )

    ## S4 method for signature 'TreeIndex'
    show(object)

### Arguments

`x` | TreeIndex object
`i, j` | indices to subset or keep
`...` | other parameters
`drop` | drop the dimensions of the object. defaults to FALSE
`selectedLevel` | tree level to select nodes from
`selectedNodes` | used to set states on individual nodes to define a cut on the tree
`start, end` | indices to filter nodes by
`format` | return format can be one of "list" or "TreeIndex"
`object` | TreeIndex object

### Value

a 'TreeIndex' subset object

a generic

levels at node cut

node state

node states

a generic

a 'TreeIndex' object or type set in format

object description of the 'TreeIndex' object

### Examples

    library(metagenomeSeq)
    data(mouseData)
    counts <- MRcounts(mouseData)
    hierarchy <- fData(mouseData)
    tree <- TreeIndex(hierarchy)
    getNodes(tree)
    library(metagenomeSeq)
    data(mouseData)
    counts <- MRcounts(mouseData)
    hierarchy <- fData(mouseData)
    tree <- TreeIndex(hierarchy)
    getNodes(tree)

    library(metagenomeSeq)
    data(mouseData)
    counts <- MRcounts(mouseData)
    hierarchy <- fData(mouseData)
    tree <- TreeIndex(hierarchy)
    splitAt(tree)

    library(metagenomeSeq)
    data(mouseData)
    counts <- MRcounts(mouseData)
    hierarchy <- fData(mouseData)
    tree <- TreeIndex(hierarchy)
    splitAt(tree)

[Package scTreeViz version 1.0.0 Index]