ChIPpeakAnno-annotation of peaklist with gene names, creating heat maps
3
0
Entering edit mode
jmKeith • 0
@jmkeith-11960
Last seen 5.7 years ago

Hello, 

I apologise for all the questions, but I have two more!  

1) Is there a way to get gene names on the "peaklist" object obtained from the findOverlapOfPeaks function? I'm able to get the peaklist but it's just a very long list of all the peaks per comparison (ie: given peaksA, peaksB, peaksC, peaksD, I get A, A/B, A/B/C, B, B/C, etc.) but there aren't any annotations.  Any ideas?  

Code that I'm using from the ChIPpeakAnno package:

>ol <- findOverlapsOfPeaks(peaksA, peaksB, peaksC, peaksD, maxgap = 1000, minoverlap = 1L, ignore.strand = TRUE, connectedPeaks = "min")

>annotated.peaklist <- ol$peaklist

 

2) I'm having a problem building heatmaps of my data.  When I input the following code: 

> library(rtracklayer)
> files <- dir("C:/Users/jkeith/Desktop/R/", "bigwig")
> files

[1] "PeaksA.bigwig"  "PeaksB.bigwig"   "PeaksC.bigwig"  
[4] "PeaksD.bigwig"
> if(.Platform$OS.type != "windows"){
+   cvglists <- sapply(file.path("C:/Users/jkeith/Desktop/R/", files), import, 
+                      format="BIGWIG", 
+                      which=feature.recentered, 
+                      as="RleList")
+ }else{## rtracklayer can not import bigWig files on Windows
+   load(file.path("C:/Users/jkeith/Desktop/R/", "cvglist.rds"))
+ }

I get the following error which I'm not sure how to fix:

Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection

 

As always, any assistance is vastly appreciated!

Many thanks,

Julia

chippeakanno overlappingpeaks annotation • 1.8k views
ADD COMMENT
1
Entering edit mode
Ou, Jianhong ★ 1.3k
@ou-jianhong-4539
Last seen 6 days ago
United States

question1,

If you are using ChIPpeakAnno(ver >=3.8.5), you will get a list of all merged overlapping peaks or unique peaks in peaklist, unique peaks in uniquePeaks, merged overlapping peaks in mergedPeaks and original peaks involved in overlapping peaks in peaksInMergedPeaks. In peaksInMergedPeaks, annotations will be kept.

You can also try to use addMetadata to add annotations to peaklist of output of findOverlapsOfPeaks. See details by ?addMetadata.

question 2,

Are you using windows? We use import function of rtracklayer to import bigwig file. However, These functions do notwork on Windows. You can try to comvert the bw files into bedgraph files and do import.

ADD COMMENT
1
Entering edit mode
Ou, Jianhong ★ 1.3k
@ou-jianhong-4539
Last seen 6 days ago
United States

Hi Julia,

Please have a try following codes:

features <- ol$peaklist[[length(ol$peaklist)]]
feature.recentered <- reCenterPeaks(features, width=4000)
library(trackViewer)
files <- dir("C:/Users/jkeith/Desktop/R/d5 IL2 MACS2/", "bedgraph")
cvglists <- sapply(file.path(path, files), importData, format="begGraph", ranges=features)

The error you got is caused by import function from rtracklayer. For begGraph file, rtracklayer::import.bedGraph does not accept as parameter.

Please let me known if there are any question when running the code above.

ADD COMMENT
0
Entering edit mode
jmKeith • 0
@jmkeith-11960
Last seen 5.7 years ago

Hello again,

First, thank you very very much for the assistance and putting up with me.  

I haven't had any luck in annotating my "peaklist" nor in the "peaksInMergedPeaks" lists.  I have also gone through the user's guide and the problem that I see is that both objects are of list class and the annotation functions, annotatePeaksinBatch or addGeneIDs both require GRanges objects as input rather than lists.  I have yet to figure out how to work around this issue.  So "peaklist" has a list of chromosomes and ranges, thus I should be able to use a concatenate function to join an annotation set with the list is what I'm thinking. 

Is there a more detailed description of the heatmapping function somewhere that I can access? The user's guide is pretty sparse on info for this part.  I'm unclear as to what all of the code is doing and I'm running into problems left and right.  I have my bedgraph files but I am not able to get the Rlelists from them.  Perhaps you could tell me where I'm going wrong?

> features <- ol$peaklist[[length(ol$peaklist)]]
> wid <- width(features)
> feature.recentered <- feature.center <- features
> start(feature.center) <- start(features) + floor(wid/2)
> width(feature.center) <- 1
> start(feature.recentered) <- start(feature.center) - 2000
> end(feature.recentered) <- end(feature.center) + 2000
> library(rtracklayer)
> files <- dir("C:/Users/jkeith/Desktop/R/d5 IL2 MACS2/", "bedgraph")
> files
[1] "MACS2_d5_IL2_k27Ac.bedgraph"  "MACS2_d5_IL2_k4m1.bedgraph"  
[3] "MACS2_d5_IL2_p300.bedgraph"   "MACS2_d5_IL2_STAT5b.bedgraph"
> cvglists <- sapply(file.path("C:/Users/jkeith/Desktop/R/d5 IL2 MACS2/", files), import, format="BEDGRAPH", which=feature.recentered, as="RleList")
Error in .local(con, format, text, ...) : 
  unused argument (as = "RleList")

 

Any pointers are much appreciated!  

Many thanks,

Julia

 

ADD COMMENT

Login before adding your answer.

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