Create a filtered methylation file from an existing one.
Value
invisibly returns 'output_file' if x is a file path, otherwise returns NanoMethResult object with methy(x) replaced with filtered value.
Examples
nmr <- load_example_nanomethresult()
output_file <- paste0(tempfile(), ".tsv.bgz")
filter_methy(nmr, output_file = output_file, chr == "chrX")
#> 21,798 of 224,267 (9.72%) entries kept after filtering
#> results written to '/tmp/RtmpkcGR9F/file17066c7d3a43.tsv.bgz' along with index file '/tmp/RtmpkcGR9F/file17066c7d3a43.tsv.bgz.tbi'
filter_methy(methy(nmr), output_file = output_file, chr == "chrX")
#> 21,798 of 224,267 (9.72%) entries kept after filtering
#> results written to '/tmp/RtmpkcGR9F/file17066c7d3a43.tsv.bgz' along with index file '/tmp/RtmpkcGR9F/file17066c7d3a43.tsv.bgz.tbi'