query_methy: Query methylation data

View source: R/query_methy.R

query_methyR Documentation

Query methylation data

Description

Query methylation data

Usage

query_methy(
  x,
  chr,
  start,
  end,
  simplify = TRUE,
  force = FALSE,
  truncate = TRUE,
  site_filter = getOption("NanoMethViz.site_filter", 3L)
)

Arguments

x

the NanoMethResults object or a path to the methylation data (tabix-bgzipped).

chr

the vector of chromosomes

start

the vector of start positions

end

the vector of end positions

simplify

whether returned results should be row-concatenated

force

whether to force empty output when query region 'chr' does not appear in data. Without 'force', an empty result indicates that the requested 'chr' appears in the data but no data overlaps with requested region, and an invalid 'chr' will cause an error.

truncate

when querying from ModBamFiles, whether or not to truncate returned results to only those within the specified region. Otherwise methylation data for entire reads overlapping the region will be returned.

site_filter

the minimum amount of coverage to report a site. This filters the queried data such that any site with less than the filter is not returned. The default is 1, which means that all sites are returned. This option can be set globally using the options(site_filter = ...) which will affect all plotting functions in NanoMethviz.

Details

The argument site_filter can be set globally using the options(site_filter = ...) command. The same data entry may appear multiple times in the output if it overlaps multiple regions.

Value

A table containing the data within the queried regions. If simplify is TRUE (default) then returns all data in a single table, otherwise returns a list of tables where each table is the data from one region.

Examples

nmr <- load_example_nanomethresult()
query_methy(methy(nmr), "chr7", 6703892, 6730431)


Shians/NanoMethViz documentation built on Dec. 17, 2024, 8:56 a.m.