link_recomb: Query UCSC for Recombination data

View source: R/link_recomb.R

link_recombR Documentation

Description

Adds recombination data to a 'locus' object by querying UCSC genome browser.

Usage

link_recomb(loc, genome = loc$genome, table = NULL, recomb = NULL)

Arguments

loc

Object of class 'locus' generated by locus()

genome

Either "hg38" or "hg19"

table

Optional character value specifying which recombination table to use.

recomb

Optional GRanges class object of recombination data.

Details

Uses the rtracklayer package to query UCSC genome browser for recombination rate data.

Possible options for table for hg19 are "hapMapRelease24YRIRecombMap", "hapMapRelease24CEURecombMap", "hapMapRelease24CombinedRecombMap" (the default). The only option for table for hg38 is "recomb1000GAvg" (the default).

If you are doing many queries, it may be much faster to download the entire recombination track data (around 30 MB for hg38) from the Recombination Rate Tracks page at UCSC genome browser. The link to the hg38 download folder is http://hgdownload.soe.ucsc.edu/gbdb/hg38/recombRate/ and for hg19 is http://hgdownload.soe.ucsc.edu/gbdb/hg19/decode/. These .bw files can be converted to useable GRanges objects using rtracklayer::import.bw() (see the vignette).

Sometimes rtracklayer generates intermittent API errors or warnings: try calling link_recomb() again. If warnings persist restart your R session. Errors are handled gracefully using try() to allow users to wrap link_recomb() in a loop without quitting halfway. Error messages are still shown. Successful API calls are cached using memoise to reduce API requests.

Value

A list object of class 'locus'. Recombination data is added as list element recomb.


myles-lewis/locuszoomr documentation built on Oct. 25, 2024, 7:24 p.m.