# PSTr-class: Nested representation of a probabilistic suffix tree In PST: Probabilistic Suffix Trees and Variable Length Markov Chains

## Description

An object of class "PSTr" is a node of a probabilistic suffix tree (PST). The slot prob contains one or several probability distributions (if the PST is segmented) and the slot counts contains the empirical - possibly weighted - counts from which the probabilities are computed. The slot leaf indicates whether the node (segment) is a terminal node (segment). The 'flat' representation of a PST is an object of class "PSTf"), that is a list that contains one element for each level of the tree. Each element of the list is itself a list whose elements are nodes, that is objects of class PSTr. The 'nested' representation of a probabilistic suffix tree (PST) is a nested list whose elements are children nodes of class "PSTr". This representation is used for printing and plotting PST, in which case the flat representation of a PST, i.e., an object of class "PSTf" is turned into an object of class "PSTr" by using the as function.

## Objects from the Class

Objects are created when calling the pstree function.

## Slots

.Data:

Object of class "list". In the nested representation of a PST, the elements of the list are the children nodes. Otherwise the list is empty.

alphabet:

Object of class "character". Alphabet on which the sequences, and the PST are built. This slot is non-empty only for the root node of the nested representation of a PST.

labels:

Object of class "character" containing the long state labels. This slot is non-empty only for the root node of the nested representation of a PST.

cpal:

Object of class "character". Color palette used to represent each state of the alphabet. This slot is non-empty only for the root node of the nested representation of a PST.

index:

Object of class "matrix". When the PST is segmented, indicates the id of the segment corresponding to each group.

counts:

Object of class "matrix". The counts to which the probability distributions are computed.

n:

Object of class "matrix". The number of occurrences of the context in the learning sample, see cprob.

prob:

Object of class "matrix". The probability distributions computed from the counts.

path:

Object of class "character". The node label, i.e. the context which is the path from the node to the root node of the tree.

order:

Object of class "integer". The depth of the node in the tree, i.e., the order of the probability distribution(s) stored in the node.

leaf:

Object of class "matrix". Indicates whether the node (segment) is a terminal node (segment).

pruned:

Object of class "matrix". If the PST was pruned with the delete=FALSE option, indicates whether the node (segment) is actually pruned. See prune.

## Extends

Class "list", from data part. Class "vector", by class "list", distance 2.

## Methods

[[

signature(x = "PSTr"): extract sub-branches of a nested representation of a PST.

plot

signature(x = "PSTr", y = "ANY"): plot a PST, see plot,PSTr,ANY-method.

print

signature(x = "PSTr"): print a PST, see print,PSTr-method.

summary

signature(object = "PSTr"): see summary,PSTr-method.