\name{aldex.clr-class}
\docType{class}

\alias{aldex.clr-class}

\title{The aldex.clr class}

\description{
  The aldex.clr S4 class is a class which stores the data generated by the aldex.clr method.
}

\section{Methods}{
  In the code below, \code{x} is an \code{aldex.clr} object, and \code{i}
  is a numeric whole number.
  \describe{
    \item{}{
      \code{getMonteCarloInstances(x)}:
      Returns \code{x}'s Monte Carlo Dirichlet instances.
    }
    \item{}{
      \code{getSampleIDs(x)}:
      Returns the names of the samples. These can be used to access the
      original reads, as in \code{reads\$sampleID} (if the reads are a data frame).
    }
    \item{}{
      \code{getFeatures(x)}:
      Returns the names of the features as a vector.
    }
    \item{}{
      \code{numFeatures(x)}:
      Returns the number of features associated with the data.
    }
    \item{}{
      \code{numMCInstances(x)}:
      Returns the names of the \code{keys} that can be used to subset the
      data rows. The \code{keys} values are the rsid's.
    }
    \item{}{
      \code{getFeatureNames(x)}:
      Returns the names of the \code{keys} that can be used to subset the
      data rows. The \code{keys} values are the rsid's.
    }
    \item{}{
      \code{getReads(x)}:
      Returns the names of the \code{keys} that can be used to subset the
      data rows. The \code{keys} values are the rsid's.
    }
    \item{}{
      \code{numConditions(x)}:
      Returns the names of the \code{keys} that can be used to subset the
      data rows. The \code{keys} values are the rsid's.
    }
    \item{}{
      \code{getMonteCarloReplicate(x, i)}:
      Returns the names of the \code{keys} that can be used to subset the
      data rows. The \code{keys} values are the rsid's.
    }
  }
}

\details{
  An aldex.clr object contains the Monte Carlo Dirochlet instances derived
  from estimating the technical variance of the raw read count data. It is
  created by the \code{aldex.clr.function}, which is invoked by the aldex.clr method.
  It consists of four attributes: the sample names, the feature names,
  the conditions vector (assigns each sample to a condition),
  and the Monte Carlo Dirochlet instances themselves. These can be accessed,
  along with information about the length of some attributes. A single Monte Carlo
  instance can also be retrieved.
}
\value{
    The aldex.clr object contains the clr transformed values for each Monte-Carlo Dirichlet instance, which can be accessed through \code{getMonteCarloInstances(x)}, where \code{x} is the \code{clr} function output. Each list element is named by the sample ID. \code{getFeatures(x)} returns the features, \code{getSampleIDs(x)} returns sample IDs, and \code{getFeatureNames(x)} returns the feature names.
}

\references{
  Please use the citation given by \code{citation(package="ALDEx")}.}
  \author{
      Greg Gloor, Ruth Grace Wong, Andrew Fernandes, Jia Rong Wu and Matt Links
      contributed to this code
  }
  \seealso{
    \code{\link{aldex.clr.function}}
  }

\examples{

    # The 'reads' data.frame or
    # SummarizedExperiment object should have
    # row and column names that are unique,
    # and looks like the following:
    #
    #              T1a T1b  T2  T3  N1  N2  Nx
    #   Gene_00001   0   0   2   0   0   1   0
    #   Gene_00002  20   8  12   5  19  26  14
    #   Gene_00003   3   0   2   0   0   0   1
    #   Gene_00004  75  84 241 149 271 257 188
    #   Gene_00005  10  16   4   0   4  10  10
    #   Gene_00006 129 126 451 223 243 149 209
    #       ... many more rows ...

    data(selex)
    #subset for efficiency
    selex <- selex[1201:1600,]
    conds <- c(rep("NS", 7), rep("S", 7))

    # x is an object of type aldex.clr
    x <- aldex.clr(selex, conds, mc.samples = 2, denom="all", verbose = FALSE)

    # get all of the Monte Carlo Dirochlet instances
    monteCarloInstances <- getMonteCarloInstances(x)

    # get sample names
    sampleIDs <- getSampleIDs(x)

    # get features
    features <- getFeatures(x)

    # get number of features
    numFeatures <- numFeatures(x)

    # get number of Monte Carlo Dirochlet instances
    numInstances <- numMCInstances(x)

    # get names of features
    featureNames <- getFeatureNames(x)

    # get number of conditions
    conditions <- numConditions(x)

    # get number of conditions
    reads <- getReads(x)

    # retrieve the first Monte Carlo Dirochlet instance.
    monteCarloInstance <- getMonteCarloReplicate(x,1)

}

\keyword{classes}
\keyword{methods}

