I have not worked much with R before. And it's not just about plotting. But I would like to know from scratch what should be done with the bam alignment file to get how the reads are mapped to different regions. I have no idea of how to get the read counts at different regions?
How can I get a density plot to get an idea of reads mapping to different regions of the genome.
I see that only 40% of the reads maps to CDS and around 60% mapping to UTR's or some other non-coding RNA. I have generated a bam file after mapping the reads to genome. I could like to visualize this by generating a plot kind. Since I am new-bie to this, it would be helpful if someone could help me out with what tools could be used to get this estimate and how to plot them.
I see from other posts that picard tools can be used. Also wiggle format can be used to solve this problem. Is there any reccomendation or how to get this done?
Thanks,
Bio
2 answers
ggplot2 is IMO the best tool for plotting. Here's a nice resource.. From the same source you can find out e.g. how to read tables into R. I very much recommend that you install RStudio. Also, don't expect to master it in minutes. This will take hours/days/weeks depending on your level of expertise. Good news is that Google will know the answer to pretty much any question you might have..
If you are comfortable with R, there are several packages which will make this task easy.
You can convert Bam file (which contains information about mapped reads) to Bed file (which retains read location information per read per line) using bamToBed and then can use one of the above tools. Otherwise, have look at bedTools which can be used to intersect bam files with genomic files (ex UTR, promoters etc) to give what you are essentially asking for.
Log in to answer this question.