% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_omics.R
\name{filter_low_coverage}
\alias{filter_low_coverage}
\alias{filter_low_coverage.HDF5Matrix}
\title{Remove high-missingness features from an HDF5Matrix}
\usage{
filter_low_coverage(x, ...)

\method{filter_low_coverage}{HDF5Matrix}(
  x,
  out_group = NULL,
  out_dataset = NULL,
  pcent = 0.05,
  by_cols = TRUE,
  overwrite = FALSE,
  ...
)
}
\arguments{
\item{x}{An \code{HDF5Matrix} containing SNP data.}

\item{...}{Ignored.}

\item{out_group}{Output group. \code{NULL} (default) = same group as input.}

\item{out_dataset}{Output dataset name. \code{NULL} (default) = input name + \code{"_filtered"}.}

\item{pcent}{Numeric in [0,1]. Maximum allowed NA proportion
(default \code{0.05}). Features above this are removed.}

\item{by_cols}{Logical. Filter columns (\code{TRUE}, default) or rows.}

\item{overwrite}{Logical. Overwrite existing output. Default \code{FALSE}.}
}
\value{
\code{HDF5Matrix} pointing to the filtered dataset.
}
\description{
Removes columns (SNPs) or rows (samples) whose proportion of missing values
(NAs) exceeds \code{pcent}. Writes result to a new dataset.

When \code{out_group}/\code{out_dataset} are \code{NULL} (default) the result
is written alongside the input dataset with the suffix \code{"_filtered"}.
}
\examples{
\donttest{
fn <- tempfile(fileext = ".h5")
snps <- matrix(sample(c(0, 1, 2, NA), 200, replace = TRUE,
                       prob = c(.25, .25, .25, .25)), 20, 10)
X   <- hdf5_create_matrix(fn, "geno/raw", data = snps)

# Filter with auto output path (adds "_filtered" suffix)
out <- filter_low_coverage(X, pcent = 0.1)

# Filter with explicit output
out2 <- filter_low_coverage(X, out_group = "geno",
                             out_dataset = "filtered", overwrite = TRUE)
hdf5_close_all()
unlink(fn)
}

}
