[BioC] BigWig Import by Chromosome
Martin Morgan
mtmorgan at fhcrc.org
Thu Mar 6 02:51:07 CET 2014
On 03/05/2014 05:00 PM, Dario Strbenac wrote:
> Hello,
>
> Is there a neater way to import an entire chromosome ?
>
> uniqueness <- import("mapabilityAlign36mer.bigWig", which = GRanges("chr5", IRanges(1, end = .Machine$integer.max - 1)))
>
> GenomicSelection requires a correctly specified genome argument, which I'm unsure of how to obtain from the bigWig file in R.
>
A BigWigFile knows about seqinfo(), so
test_bw <- system.file("tests", "test.bw", package = "rtracklayer")
xx = import(test_bw, which=seqinfo(BigWigFile(test_bw))["chr19"])
> xx
GRanges with 4 ranges and 1 metadata column:
seqnames ranges strand | score
<Rle> <IRanges> <Rle> | <numeric>
[1] chr19 [1501, 1800] * | 0.25
[2] chr19 [1801, 2100] * | 0.5
[3] chr19 [2101, 2400] * | 0.75
[4] chr19 [2401, 2700] * | 1
---
seqlengths:
chr2 chr19
243199373 59128983
Martin
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
>
> _______________________________________________
> 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: Arnold Building M1 B861
Phone: (206) 667-2793
More information about the Bioconductor
mailing list