% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/FilterDataset.R
\name{FilterDataSet}
\alias{FilterDataSet}
\title{Filter the CrcBiomeScreenObject dataset based on a specific label}
\usage{
FilterDataSet(
  CrcBiomeScreenObject = NULL,
  label = NULL,
  condition_col = "study_condition"
)
}
\arguments{
\item{CrcBiomeScreenObject}{A \code{CrcBiomeScreenObject} containing normalized microbiome data and sample metadata.}

\item{label}{A character vector specifying the label(s) to filter the dataset by.}

\item{condition_col}{A character string indicating the column in the SampleData that contains the condition labels (default is "study_condition").}
}
\value{
A A \code{CrcBiomeScreen} object. with filtered data based on the specified label.
}
\description{
Filter the CrcBiomeScreenObject dataset based on a specific label
}
\examples{
# Create toy normalized data (5 samples, 2 taxa)
norm_data <- data.frame(
  TaxaA = c(10, 20, 15, 30, 10),
  TaxaB = c(5, 7, 6, 8, 6)
)
rownames(norm_data) <- paste0("S", 1:5)

# Create sample metadata
sample_info <- data.frame(
  study_condition = c("control", "CRC", "control", "CRC", "Adenoma"),
  country = c("US", "US", "UK", "UK", "US"),
  row.names = paste0("S", 1:5),
  stringsAsFactors = FALSE
)

# Construct a minimal CrcBiomeScreen object
toy_obj <- new(
  "CrcBiomeScreen",
  AbsoluteAbundance   = data.frame(),
  RelativeAbundance   = data.frame(),
  TaxaData            = data.frame(),
  SampleData          = sample_info,
  NormalizedData      = norm_data,
  TaxaLevelData       = NULL,
  OriginalNormalizedData = NULL,
  ValidationData      = NULL,
  ModelData           = NULL,
  ModelResult         = NULL,
  EvaluateResult      = list(),
  PredictResult       = NULL
)

# Filter to keep only CRC and control samples
filtered_obj <- FilterDataSet(
  toy_obj,
  label = c("CRC", "control"),
  condition_col = "study_condition"
)

# Inspect filtered SampleData
getSampleData(filtered_obj)
}
