Plot Reads Against Coordinates
2
0
Entering edit mode
12.0 years ago
Vikas Bansal ★ 2.4k

Hi,

I have 2 files - bed file (chromosome, start and end) and second file is mapped reads which are in sam file. I want to plot reads against coordinates from my bed file. Example my bed file contains-

chr4   50    100
chr4   100   150
chr4   150   200
chr4   200   250

With this bed file, I can extract reads from sam file which are mapped between chr4: 50 and 250 positions. In the end, I want a plot like this (image taken from internet but I modified it little bit). Each read is shown according to its start position and length of the bar represents read length. I found this image and about python and matlab here. But I want to do this in R. The thing is, I have about 40 bed files and with the help of par(mfrow) in R, I will make 40 plots on same sheet. Any suggestions how would you do it or any R package will be great. I would really appreciate your help.

Thanks and Best regards,

Vikas

read plot coordinates r • 3.7k views
ADD COMMENT
1
Entering edit mode
12.0 years ago
Neilfws 49k

(1) There are very similar plots in the documentation (PDF) for the R/Bioconductor package ggbio. I've linked to v2.9 since documentation for the newer 2.10 is not yet written in full.

(2) I would not put 40 plots on the same "sheet".

ADD COMMENT
0
Entering edit mode

Thanks. You are right, it is not a good idea to put 40 plots on same sheet.

ADD REPLY
0
Entering edit mode
12.0 years ago

This does not produce a "publication quality" set of figures, but you could use the SRAdb bioconductor package to control the IGV browser to automatically make snapshots of any regions of interest. There is an example in the SRAdb vignette or in the "Accomplishing Exome Sequencing Data Tasks with Bioconductor" tutorial on this page.

ADD COMMENT

Login before adding your answer.

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