Peak plots using R
1
1
Entering edit mode
10.2 years ago

Can any one tell me how to generate peak plots using R.

I have the chromosome start and end positions. Based on those peak start and end position. How can i generate a plot. Can anyone advice on it.

Thanks

ChIP-Seq • 5.0k views
ADD COMMENT
0
Entering edit mode

Do you just want to plot the position of the peaks on the genome or their positions relative to some feature (e.g., the transcription start site)?

ADD REPLY
0
Entering edit mode

I want to plot the read counts with respective to the position of the peaks.

ADD REPLY
0
Entering edit mode

Within an individual peak or summed across all peaks? In the latter case, I assume you want the peak width to be normalized (otherwise it'd be difficult to compare things).

ADD REPLY
0
Entering edit mode

It's within an individual peak and plot has to be generated chromosome wise

ADD REPLY
0
Entering edit mode

Yaa I saw the manual. there are lot of information. Thanks.

But I would like to know how to go about with bed file.

What information should I have in bed file.

ADD REPLY
0
Entering edit mode

The bed file should just have the locations of the peaks.

ADD REPLY
0
Entering edit mode
f1.bam <-system.file("1.bed", "sample.bam", package="biovizBase")
autoplot(f1.bam)
Error in import(FileForFormat(con), ...) :
  error in evaluating the argument 'con' in selecting a method for function 'import': Error in FileForFormat(con) : Format '' unsupported

I think I am doing something wrong.Can you please correct me.

ADD REPLY
0
Entering edit mode

f1.bam is just a character vector, trying to autoplot it like that won't make much sense. A better example would be something like:

library(ggbio)
library(Rsamtools)
bam_file <- BamFile(system.file("sample.bam", package="biovizBase"))
open(bam_file)
autoplot(bam_file)

No, this isn't using a BED file to get the regions, but this should be a short enough example to get you started.

ADD REPLY
2
Entering edit mode
10.2 years ago

You could pretty easily do this with either Gviz or ggbio (they're bioconductor packages). With ggbio, the general idea is to use the autoplot() function with a BED file of peaks that could just be subset (or split) by chromosome and the coordinate sorted and indexed BAM file with the alignments. See section 2.4 of the ggbio vignette for an example of this.

ADD COMMENT

Login before adding your answer.

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