[Bioc-devel] IGV VCF demo, other suggestions? [was Re: IGV - a new package in preparation]
You could look at the rtracklayer API. For example, using gets functions like track<-() and range<-() to set track and region may be more natural to R users. Then again, if there were endomorphic functions add_track() and set_range(), the API would support chaining. There should be no need to explicitly construct a track; just rely on dispatch and class semantics, i.e., passing a VCF object to add_track() would create a variant track automatically. On Mon, Mar 12, 2018 at 5:20 PM, Paul Shannon <
paul.thurmond.shannon at gmail.com> wrote:
Gabe and Levi made a good case for supporting GRanges in IGV. Looking at
the GenomicRanges vignettes, it appears that many of Herve?s introductory
examples have GC content as the mcols column of interest. Would that be a
good test and demo for IGV? Or perhaps some other genomic quantity, one
for which sample data is already present in some Bioconductor package?s
extdata?
The IGV VCF track now works, using GenomicRanges and VariantAnnotation.
It might be of interest, maybe lead to more useful suggestions which would
be good for me to hear at this stage. Here is a code chunk using default
parameters for colors, track height and etc. Homozygous non-reference
calls are rendered in light blue, heterozygous in dark blue, reference in
gray.
library(IGV)
library(VariantAnnotation)
igv <- IGV(portRange=9000:9020)
setGenome(igv, ?hg19")
setBrowserWindowTitle(igv, ?VCF demo?)
f <- system.file("extdata", "chr22.vcf.gz", package=?VariantAnnotation?)
chrom <- ?22"
start <- 50586118
end <- 50633733
rng <- GRanges(seqnames=chrom, ranges=IRanges(start=start, end=end))
vcf.sub <- readVcf(f, "hg19", param=rng)
track <- VariantTrack(?chr22-tiny", vcf.sub)
displayTrack(igv, track)
showGenomicRegion(igv, sprintf("chr22:%d-%d", start-1000, end+1000))
Suggestions?
On Mar 9, 2018, at 4:15 AM, Levi Waldron <lwaldron.research at gmail.com>
wrote:
Definitely +1 for supporting GenomicRanges, including what's in genome()
and mcols(). There's a demo of an rtracklayer -> GRanges -> UCSC
_______________________________________________ Bioc-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel