[BioC] shortReads

Martin Morgan mtmorgan at fhcrc.org
Tue Feb 24 01:04:49 CET 2009


"Lana Schaffer" <schaffer at scripps.edu> writes:

> Martin,
>
> Is there an easy way to write BED files from 
> the filtered readAlign in shortReads?

Use the rtracklayer package to create RangedData object 'rd' and then
export this to a bed file, e.g.,

> rd <- RangedData(ranges, scores, space=chr)
> export(rd, "tmp.bed")

RangedData above has three components, though more are possible. The
first is the ranges on which some feature is marked, the second is a
(optional) variable (in this case, 'scores') whose value you'd like to
display at the corresponding range, and the third is the 'space',
(e.g., chromosome), on which you'd like the information to be
displayed. For instance

library(ShortRead)
library(rtracklayer)

dirPath <- system.file('extdata', 'maq', package='ShortRead')
aln <- readAligned(dirPath, type="MAQMapview")

ranges <- IRanges(position(aln), width=width(sread(aln)))
scores <- quality(alignQuality(aln))
rd <- RangedData(ranges, scores, space=chromosome(aln))
f <- file.path(tempdir(), "tmp.bed")
export(rd, f)

rtracklayer also allows interaction with a genome browser directly. I
haven't used these facilities extensively so others might have more
informed comment.

Martin


> Lana Schaffer
> Biostatistics/Informatics
> The Scripps Research Institute
> DNA Array Core Facility
> La Jolla, CA 92037
> (858) 784-2263
> (858) 784-2994
> schaffer at scripps.edu 
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

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

Location: Arnold Building M2 B169
Phone: (206) 667-2793



More information about the Bioconductor mailing list