link_recomb | R Documentation |
Adds recombination data to a 'locus' object by querying UCSC genome browser.
link_recomb(loc, genome = loc$genome, table = NULL, recomb = NULL)
loc |
Object of class 'locus' generated by |
genome |
Either |
table |
Optional character value specifying which recombination table to use. |
recomb |
Optional |
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.
A list object of class 'locus'. Recombination data is added as list
element recomb
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.