liftover probe annotation from hg19 to hg38 for methylation array data using minfi (EPIC methylation array data)
1
0
Entering edit mode
@brendanmiller-20310
Last seen 5.1 years ago

Hello, I am trying to construct an annotation file and convert hg19 coordinates to hg38. The start of my code is as follows:

library(minfi)    
library(rtracklayer)
library(GenomicRanges)
allAnn=getAnnotation(hgscNorm)

However, I receive the following error:

> allAnn=getAnnotation(hgscNorm)
Error in is(object, "MethylSet") : object 'hgscNorm' not found

I have tried installing hgscNorm with:

> BiocManager::install("hgscNorm")

but I get the following output:

Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.3 (2019-03-11)
Installing package(s) 'hgscNorm'
installation path not writeable, unable to update packages: Matrix, mgcv
Warning message:
package ‘hgscNorm’ is not available (for R version 3.5.3)

I have also tried:

> BiocInstaller::biocLite(c("hgscNorm"))

but get the following output:

BioC_mirror: http://bioconductor.org
Using Bioconductor version 2.13 (BiocInstaller 1.32.1), R version 3.5.3.
Temporarily using Bioconductor version 2.13
Installing package(s) 'hgscNorm'
Warning: unable to access index for repository http://bioconductor.org/packages/2.13/bioc/bin/macosx/el-capitan/contrib/3.5:
  cannot open URL 'http://bioconductor.org/packages/2.13/bioc/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
Warning: unable to access index for repository http://bioconductor.org/packages/2.13/data/annotation/bin/macosx/el-capitan/contrib/3.5:
  cannot open URL 'http://bioconductor.org/packages/2.13/data/annotation/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
Warning: unable to access index for repository http://bioconductor.org/packages/2.13/data/experiment/bin/macosx/el-capitan/contrib/3.5:
  cannot open URL 'http://bioconductor.org/packages/2.13/data/experiment/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
Warning: unable to access index for repository http://bioconductor.org/packages/2.13/extra/bin/macosx/el-capitan/contrib/3.5:
  cannot open URL 'http://bioconductor.org/packages/2.13/extra/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
Warning messages:
1: package ‘hgscNorm’ is not available (for R version 3.5.3) 
2: installed directory not writable, cannot update packages 'Matrix', 'mgcv'

Do you know what the problem is and how I can install hgscNorm?

Thank you, Brendan

annotation probe software error EPIC methylation array • 2.1k views
ADD COMMENT
0
Entering edit mode
shepherl 3.8k
@lshep
Last seen just now
United States

Your are trying to pass into a function something that has not been defined yet. hgscNorm is not the name of a package. In should be the input to the function getAnnotation.

library(minfi)    
library(rtracklayer)
library(GenomicRanges)
allAnn=getAnnotation(hgscNorm)
Error in is(object, "MethylSet") : object 'hgscNorm' not found

hgscNorm has not been defined in the code you provide. It should be a minfi object. You will need to look at the minfi help pages to figure out how to create this object from the data files you have.

ADD COMMENT
0
Entering edit mode

Thank you. You're absolutely right. To clarify for others who may view this:

My previous code was the following:

### install packages
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install("BiocInstaller", version = "3.8")
BiocManager::install("GenomicFeatures")
BiocManager::install("rtracklayer")
BiocManager::install("minfi")
BiocManager::install("IlluminaHumanMethylationEPICmanifest", version = "3.8")
BiocManager::install("IlluminaHumanMethylationEPICanno.ilm10b4.hg19", version = "3.8")
library(minfi) # https://bioconductor.org/packages/release/bioc/vignettes/minfi/inst/doc/minfi.html
library(rtracklayer)
library(GenomicRanges)

Read in IDAT methylation array data to build minfi object:

targets=read.metharray.sheet("data") # "data" = top level directory that contains 'slides' and IDAT files within (see minfi vignette)
targets$Basename=file.path(".","data",targets$Slide,paste(targets$Slide,targets$Array,sep="_"))
RGset=read.metharray.exp(targ = targets) # read in IDAT data and make minfi object

### RGset is minfi object with probe beta values and annotation information

annotation(RGset)["array"]="IlluminaHumanMethylationEPIC"
annotation(RGset)["annotation"]="ilm10b2.hg19"
getManifest(RGset) # needs "IlluminaHumanMethylationEPICmanifest" package

prob=preprocessIllumina(RGset)
probF=preprocessFunnorm(RGset) # needs "IlluminaHumanMethylationEPICanno.ilm10b4.hg19" package
beta=getBeta(probF) # beta values

Now I can liftover the annotation from hg19 to hg38 (what I was originally trying to do):

allAnn=getAnnotation(RBset) #previously was: allAnn=getAnnotation(hgscNorm) but 'hgscNorm' should actually be RBset; I actually want the annotation of this object...
annRanges= makeGRangesFromDataFrame(allAnn[,1:4],
                              keep.extra.columns=T,
                              ignore.strand=FALSE,
                              seqinfo=NULL,
                              seqnames.field=c("seqnames", "seqname",
                                               "chromosome", "chrom",
                                               "chr", "chromosome_name",
                                               "seqid"),
                              start.field="pos",
                              end.field="pos",
                              strand.field="strand",
                              starts.in.df.are.0based=FALSE)

chain=import.chain("hg19ToHg38.Over.chain") # file downloaded from UCSC
hg38Locs=liftOver(annRanges,chain)
hg38LocsDF=data.frame(hg38Locs)
rownames(hg38LocsDF)=hg38LocsDF$group_name
pos38=start(unlist(hg38Locs))
allAnn=data.frame(allAnn,"pos.hg19"=allAnn$pos)
allAnn$pos=rep(NA,dim(allAnn)[1])
allAnn[hg38LocsDF$Name,"pos"]=hg38LocsDF[,"start"]
ADD REPLY

Login before adding your answer.

Traffic: 885 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