Bioconductor / AnnotationHub

Client for the Bioconductor AnnotationHub web resource
15 stars 12 forks source link

how to get CpGs for hg38 ? #42

Closed sahuno closed 10 months ago

sahuno commented 11 months ago

Hi,

I can't retrieve CpGs file for hg38. can someone pls point me in the right direction ? thanks

#### get CpG locations for hg38
library(AnnotationHub)
hub_hg38 <- AnnotationHub()
query(hub_hg38, c("cpg","hg38"))

AnnotationHub with 0 records
# snapshotDate(): 2021-10-20
lshep commented 10 months ago

AnnotationHub relies on data contributed from the community and it appears that there hasn't been any submitted. Perhaps the ramwas package might be useful? https://bioconductor.org/packages/devel/bioc/vignettes/ramwas/inst/doc/RW2_CpG_sets.html#constructing-a-custom-cpg-set

hpages commented 10 months ago

A simple alternative is to use the rtracklayer package to retrieve the CpG data directly from the UCSC Genome Browser:

library(rtracklayer)

session <- browserSession()
genome(session) <- "hg38"

query <- ucscTableQuery(session, table="cpgIslandExt")
cpg_islands <- track(query)  # GRanges object

query <- ucscTableQuery(session, table="cpgIslandExtUnmasked")
all_cpg_islands <- track(query)  # GRanges object

See CpG Islands Tracks details at https://genome.ucsc.edu/cgi-bin/hgTrackUi?db=hg38&g=cpgIslandSuper

H.

sahuno commented 10 months ago

i didn't know that! thank you all for your help!!!