Custom Annotation With Chippeakanno
1
0
Entering edit mode
12.5 years ago
KCC ★ 4.1k

I am trying to figure out how to make a custom annotation that I can feed into the annotatePeakInBatch function which is part of the ChIPpeakAnno package for Bioconductor.

The usage is something like this,

annotatePeakInBatch(myPeakList, AnnotationData) where myPeakList is a list of peaks derived from a ChIP-seq exeperiment.

I want to be able to create a set of custom annotations for C. elegans.

I would like to be able to make use of data like the human gene ortholog, the wormbase gene name.

I assume the getBM function for BiomaRt might be of help. However, I haven't been able to figure out how to get this to produce the annotations for all genes of a particular species, nor how to convert the output to something that is suitable for annotatePeakInBatch.

bioconductor r • 4.3k views
ADD COMMENT
2
Entering edit mode
12.5 years ago
seidel 11k

If you can make a data frame of your custom annotations (i.e. a table), then you can simply convert the relevant fields to a RangedData object for ChIPpeakAnno. For instance, if you want to get all c elegans genes, you can grab them using the biomaRt library in R with just a few lines of code:

library(biomaRt)
library(ChIPpeakAnno)

# create a biomart object and select a mart to use
ensembl <- useDataset("celegans_gene_ensembl", mart=useMart("ensembl"))

# what kind of attributes can we retrieve?
listAttributes(ensembl)

# set the properties to extract
props <- c("ensembl_gene_id", "external_gene_id", "transcript_biotype", "chromosome_name", "start_position", "end_position", "strand")

# get the information
genes <- getBM(attributes=props, mart=ensembl)

# create a RangedData object with my custom annotations
myCustomAnno <- RangedData(IRanges(start=genes[,"start_position"], end=genes[,"end_position"], names=genes[,"external_gene_id"]), space=genes[,"chromosome_name"], strand=genes[,"strand"])

# annotate my peaks with my custom annotations
annotatedPeaks <- annotatePeakInBatch(myPeakList, AnnotationData=myCustomAnno)

There are quite a few things you can look up in biomart, or you can curate your own table. The trick is simply getting the information into the form of a RangedData object, which may seem a little scary, but as you can see in the example above, is actually pretty straightforward.

ADD COMMENT
0
Entering edit mode

This looks good. Thanks!

ADD REPLY

Login before adding your answer.

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