## Example 1
library(GenomicFeatures)
txdbFile <- system.file("extdata", "sacCer2_sgdGene.sqlite",
package="yeastNagalakshmi")
## either use a txdb file quaried from UCSC or use existing TxDb packages.
txdb <- loadDb(txdbFile)
grl <- exonsBy(txdb, by="gene")
file <- system.file("extdata", "SRR002051.chrI-V.bam",
package="yeastNagalakshmi")
s <- spViewPerFeature(GRL=grl, name="YAL001C", files=file)
## Example 2
## multi-files: using 'BamFileList' and setting up the 'DataFrame'
## holding the phenotype data
bfiles <- BamFileList(c(a=file, b=file))
values(bfiles) <- DataFrame(sampleGroup=factor(c("normal", "tumor")))
values(bfiles)
s <- spViewPerFeature(GRL=grl, name="YAL001C",
files=bfiles, multi.levels=TRUE, fac="sampleGroup")
Run the code above in your browser using DataLab