Bioconductor / AnnotationHub

Client for the Bioconductor AnnotationHub web resource
17 stars 13 forks source link

how to get CpGs for hg38 ? #42

Closed sahuno closed 1 year ago

sahuno commented 1 year 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 1 year 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 1 year 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 1 year ago

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