[BioC] IRanges: the width argument of the coverage function

Hervé Pagès hpages at fhcrc.org
Tue Jul 3 19:47:44 CEST 2012


Hi Nico,

On 07/03/2012 07:39 AM, Nicolas Delhomme wrote:
> Hi,
>
> I thought I saw a mention on the mailing list that coverage and similar functions would support a named vector for providing the width instead of just a list. The documentation states so too:
>

Mmmh, I thought so too. But apparently this works for GRanges objects
but not for RangesList objects.

> For RangesList and RangedData objects, a list or vector of
>            the same length as ‘x’ to be used for the corresponding
>            element in ‘x’.
>
> However, using a named vector does not work (my aln.ranges is a RangesList object):
>
>> class(aln.ranges)
> [1] "CompressedIRangesList"
> attr(,"package")
> [1] "IRanges"
>
>> coverage(aln.ranges,width=chrSize(obj))
> Error in .local(x, shift, width, weight, ...) :
>    'width' must be a non-empty list
>
>> str(chrSize(obj)) # that's my width
>   Named int [1:2518] 48367220 21538349 8012 10863 7999 7999 7991 8236 7962 8324 ...
>   - attr(*, "names")= chr [1:2518] "scaffold_1" "scaffold_10" "scaffold_1000" "scaffold_1001" ...
>
> Changing the width to a list works:
>> coverage(aln.ranges,width=as.list(chrSize(obj)))
>
> So, I'm just curious what the status is.

Will fix the "coverage" method for RangesList (and its man page) so
it's consistent with the method for GRanges.

Thanks,
H.

>
> Thanks,
>
> Nico
>
>> sessionInfo()
> R version 2.15.1 (2012-06-22)
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> locale:
>   [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
>   [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
>   [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8
>   [7] LC_PAPER=C                 LC_NAME=C
>   [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] parallel  stats     graphics  grDevices utils     datasets  methods
> [8] base
>
> other attached packages:
>   [1] easyRNASeq_1.3.6       ShortRead_1.15.9       latticeExtra_0.6-19
>   [4] RColorBrewer_1.0-5     lattice_0.20-6         Rsamtools_1.9.18
>   [7] DESeq_1.9.7            locfit_1.5-8           BSgenome_1.25.3
> [10] GenomicRanges_1.9.28   Biostrings_2.25.6      edgeR_2.7.24
> [13] limma_3.13.7           biomaRt_2.13.1         Biobase_2.17.6
> [16] genomeIntervals_1.13.2 intervals_0.13.3       IRanges_1.15.17
> [19] BiocGenerics_0.3.0
>
> loaded via a namespace (and not attached):
>   [1] annotate_1.35.3       AnnotationDbi_1.19.15 bitops_1.0-4.1
>   [4] DBI_0.2-5             genefilter_1.39.0     geneplotter_1.35.0
>   [7] grid_2.15.1           hwriter_1.3           RCurl_1.91-1
> [10] RSQLite_0.11.1        splines_2.15.1        stats4_2.15.1
> [13] survival_2.36-14      tools_2.15.1          XML_3.9-4
> [16] xtable_1.7-0          zlibbioc_1.3.0
>
>
> ---------------------------------------------------------------
> Nicolas Delhomme
>
> Genome Biology Computational Support
>
> European Molecular Biology Laboratory
>
> Tel: +49 6221 387 8310
> Email: nicolas.delhomme at embl.de
> Meyerhofstrasse 1 - Postfach 10.2209
> 69102 Heidelberg, Germany
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>


-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioconductor mailing list