Remove reads (columns) that contain only NA values from a read-level
assay (DataFrame of NaArrays).
Arguments
- x
A
DataFramewithNaArrayobjects in its columns (typically a read-level assay as returned byreadModBam).- prune
A logical scalar. If
TRUE(the default), samples (columns of theDataFrame) for which the NA-read filtering retains none of the reads will be completely removed. IfFALSE, such samples are retained as a zero-columnNAMatrix).
Examples
library(SummarizedExperiment)
modbamfile <- system.file("extdata", "6mA_1_10reads.bam",
package = "SingleMoleculeGenomicsIO")
se <- readModBam(bamfiles = modbamfile, regions = "chr1:6940000-6955000",
modbase = "a", verbose = FALSE,
BPPARAM = BiocParallel::SerialParam())
removeAllNAReads(assay(se[1:10, ], "mod_prob"))
#> DataFrame with 10 rows and 1 column
#> s1
#> <NaMatrix>
#> 1 0
#> 2 0
#> 3 0
#> 4 0
#> 5 0.275390625
#> 6 0.076171875
#> 7 0
#> 8 0
#> 9 0
#> 10 0