| filter_low_coverage | R Documentation |
Removes columns (SNPs) or rows (samples) whose proportion of missing values
(NAs) exceeds pcent. Writes result to a new dataset.
When out_group/out_dataset are NULL (default) the result
is written alongside the input dataset with the suffix "_filtered".
filter_low_coverage(x, ...)
## S3 method for class 'HDF5Matrix'
filter_low_coverage(
x,
out_group = NULL,
out_dataset = NULL,
pcent = 0.05,
by_cols = TRUE,
overwrite = FALSE,
...
)
x |
An |
... |
Ignored. |
out_group |
Output group. |
out_dataset |
Output dataset name. |
pcent |
Numeric in [0,1]. Maximum allowed NA proportion
(default |
by_cols |
Logical. Filter columns ( |
overwrite |
Logical. Overwrite existing output. Default |
HDF5Matrix pointing to the filtered dataset.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.