How to get gene names from CpG islands coordinates with R/Bioconductor
1
0
Entering edit mode
9.7 years ago
newscient ▴ 20

I have a dataframe with chromosome name , start position, end position (only! no other identifier) of CpG islands from the mouse genome (mm10 coordinates). Is there a function with which I can retrieve the related ensembl gene ids?

I suppose getBM from the bioMart package would do the job , but how should I use it with no identifier as a value or filter?

Maybe it's a really simple question but I am kind of stacked here!

Thanks in advance!

annotation CpG • 7.4k views
ADD COMMENT
0
Entering edit mode

I guess i have to make a mapping of my CpG coordinates with a mouse gene annotation, that's what i am missing, right? And then find the gene_ids from there!

ADD REPLY
0
Entering edit mode

Can I get a copy of your dataframe? I am looking for Cpgislands in mm9 for my analysis, but don't really know how or where to get the data. If you could save your dataframe as a .Rds file (R binarization), then I can download it. Thanks

ADD REPLY
5
Entering edit mode
9.7 years ago
Martin Morgan ★ 1.6k

Consider asking questions about Bioconductor packages on the Bioconductor support forum.

Load the mouse ensGene 'TxDb' package, and get gene coordinates

library(TxDb.Mmusculus.UCSC.mm10.ensGene)
genes = genes(TxDb.Mmusculus.UCSC.mm10.ensGene)

Coerce your data.frame to a GRanges object, maybe with

gr = makeGRangesFromDataFrame(cpg)

or

gr = GRanges(cpg$chrname, IRanges(cpg$start, cpg$end))

Then find the nearest genes

genes[nearest(gr, genes)]

or maybe the genes that precede / follow your cpg islands

genes[precede(gr, genes)]
ADD COMMENT
0
Entering edit mode

Hello,

I have used package called DMRcate to analyse 450k data. I want to find the gene which associates the DMRs.And I met some questions.The outputs include gene_assoc, group, hg19coord, no.probes, minpval, meanpval and maxbetafc,when I used the old version to analyse 450k data.

But when I update the package,the outputs became coord, no.cpgs, minfdr, Stouffer, maxbetafc,meanbetafc.There is no result of "gene_assoc". I want to find the gene names associating "coord",can you help me? Can you please tel me how to associate the gene by using the newest DMRcate packages.

There follow the output results of the newest DMRcate.

 coord no.cpgs minfdr Stouffer  maxbetafc  meanbetafc
63999  chr6:33156164-33181870     265      0        0 -0.5008031 -0.02648790
63997  chr6:33128825-33149777     150      0        0  0.4176126  0.08611966
63917  chr6:32144195-32161004     128      0        0 -0.2574513 -0.03184096
63914  chr6:32114490-32123701     124      0        0 -0.4377015 -0.06195576
63889  chr6:31935801-31940855     101      0        0 -0.1555205 -0.02401999
12564 chr11:31817810-31841980     100      0        0 -0.4611059 -0.17113506
ADD REPLY

Login before adding your answer.

Traffic: 2562 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6