[BioC] export Views of Rle in rtracklayer

Martin Morgan mtmorgan at fhcrc.org
Wed Nov 23 04:43:03 CET 2011


On 11/22/2011 09:39 AM, Jason Lu wrote:
> Hi list,
>
> I have a question and would like to get your help.
> What I would like to get is to show the read coverage in the exon
> regions (only) in the ucsc genome browser. My question is how to
> export the Views so I can load into ucsc browser.
> Here is what I have:
>
> #
>> cvg = coverage(ranges(ss))
>> cvg.view = Views(cvg,ranges(exon.gr))  # exon.gr is a GRanges
>> cvg.view
> Views on a 22109556-length Rle subject
>
> views:
>          start      end width
>   [1] 22109317 22109688   372 [5 5 7 5 6 6 6 5 5 5 5 5 4 4 5 8 8 8 9 9 9 9 ...]
>   [2] 22084156 22084276   121 [4 4 4 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 ...]
>   [3] 22083039 22083195   157 [2 1 1 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 2 3 3 4 ...]
>   [4] 22079485 22079612   128 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 ...]
>   [5] 22079020 22079144   125 [6 6 6 6 7 7 7 7 7 7 7 7 7 7 6 6 6 6 6 6 5 4 ...]
>
> I don't know how to modify this view such as adding chromosome info
> and export this 'cvg.view' in rtracklayer.

Hi Jason -- not my strength, but I think you can

  fl <- paste(tempfile(), "gff", sep=".")
  export(ranges(cvg.view), fl)

at a minimum, or add annotations through arguments to specific export 
functions (e.g., ?export.gff) or creating a richer object, e.g.,

   RangedData(ranges(cvf.view), space="chr1")

Hope that helps, and is not too misleading,

Martin

> Thanks in advance.
> Jason
>
>> sessionInfo()
> R version 2.14.0 (2011-10-31)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
> [1] C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
>   [1] rtracklayer_1.14.3    RCurl_1.7-0           bitops_1.0-4.1
>   [4] Rsamtools_1.6.2       Biostrings_2.22.0     GenomicFeatures_1.6.4
>   [7] AnnotationDbi_1.16.4  Biobase_2.14.0        GenomicRanges_1.6.3
> [10] IRanges_1.12.2        BiocInstaller_1.2.1
>
> loaded via a namespace (and not attached):
> [1] BSgenome_1.22.0 DBI_0.2-5       RSQLite_0.10.0  XML_3.4-3
> [5] biomaRt_2.10.0  tools_2.14.0    zlibbioc_1.0.0
>>
>
> _______________________________________________
> 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


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioconductor mailing list