[Bioc-sig-seq] Plotting Coverage for inhouse genome

Pratap, Abhishek APratap at som.umaryland.edu
Thu Dec 3 01:52:59 CET 2009

Hi Patrick

Thanks for letting me know how to search doc efficiently. Picking up on
the coverage method, I tried the following. Also I would like to use
only one chr, in this case (K-10_OM_revised.fasta *). How can I change
the aln object to just one one specific chromosome. I tired few of my
beginner tricks (aln$ K-10_OM_revised.fasta,
aln[[K-10_OM_revised.fasta]] but dint work. I guess I am not using right
method on aln object.

cov_rLe <- coverage(x=aln, start=1, end=4832581, shift=0L,

Error: UserArgumentMismatch
  'names(shift)' (or 'names(start)') mismatch with
  see ?"AlignedRead-class"
In addition: Warning message:
  use 'shift'/'width'  instead of 'start'/'end'

Here 4832581 is the length of the genome.

Levels(chromosome(aln))  ======== Just to clear the confusion about the
chromosome name. 
175] "7:0:1"                 "7:1:0"                 "7:7:1"

[178] "8:0:0"                 "K-10_OM_revised.fasta" "NM"

[181] "QC"                   


-----Original Message-----
From: Patrick Aboyoun [mailto:paboyoun at fhcrc.org] 
Sent: Wednesday, December 02, 2009 6:19 PM
To: Pratap, Abhishek
Cc: Michael Lawrence; bioc-sig-sequencing at r-project.org
Subject: Re: [Bioc-sig-seq] Plotting Coverage for inhouse genome

To answer your first question, there is a coverage method for 
AlignedRead objects in the ShortRead package. S4 methods can be hard to 
find in R's help pages, particularly if the methods for a generic are 
stored across multiple packages. When I'm unsure what is around, I use 
the showMethods function to get a list of available methods for an S4 

 > suppressMessages(library(ShortRead))
 > showMethods("coverage")
Function: coverage (package IRanges)

 From there I use a help command of the form 

 > help("coverage,AlignedRead-method")

In that man page you will find information on how to use coverage for an

AlignedRead object.

Once you have the coverage vectors (in the form of an RleList), you can 
use the approach Michael outlined for plotting.


Michael Lawrence wrote:
> On Wed, Dec 2, 2009 at 2:31 PM, Pratap, Abhishek
> <APratap at som.umaryland.edu>wrote:
>> Hi All
>> After taking an exciting BioC course at FredHutch recently, I am
>> to dive into BioC world to make more sense of NGS data. I would also
>> like to thank the entire BioC team present there. You guys were
>> great. I appreciate you all patiently answering tons of questions and
>> taught some of the cool things we can do with BioC packages.
>> For my current problem I would like to generate coverage plots for a
>> small bacterial genome. I have the reads imported as a AlignedRead
>> object and I am not sure how to proceed next. The help for the
>> "coverage" method didn't get me very far. I am looking for some
>> to help me resolve the following questions.
>> 1. How to create a RLE list from the AlignRead object using coverage
>> method ?
>> 2. Do I need to pack my reference genome as BSgenome data package in
>> order to do this ? If yes I just have the sequence and no group II
>> file.
>> 3. Finally how to plot a RLE list.
> This is a pretty difficult question to answer. Do you want to see all
> chromosomes at once (like a karyotype plot)? An overview of entire
> chromosomes? Or do you want to explore the data in an interactive
> browser?
> There are many packages in Bioconductor for plotting this sort of
> including GenomeGraphs and HilbertVis. For genome browsers, there's
> rtracklayer and others.
> For example, with rtracklayer:
> session <- browserSession()
> session$coverage <- as(coverage, "RangedData")
>> Thanks!
>> -Abhi
>> _______________________________________________
>> Bioc-sig-sequencing mailing list
>> Bioc-sig-sequencing at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
> 	[[alternative HTML version deleted]]
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

More information about the Bioc-sig-sequencing mailing list