## ----ShortRead-fastq----------------------------------------------------- library(ShortRead) strm = FastqStreamer("bigdata/SRR1039508_1.fastq.gz", 100000) fq = yield(strm) fq sread(fq) quality(fq) ## ----r-intro------------------------------------------------------------- x = rnorm(1000) y = x + rnorm(1000, sd=.5) df = data.frame(x=x, y=y) plot(y ~ x, df) fit = lm(y ~ x, df) class(fit) methods(class=class(fit)) methods("anova") ## ----help, eval=FALSE---------------------------------------------------- ## ?log ## ?plot # generic 'plot' ## ?plot.lm # plot for objects of class 'lm' ## ----S4------------------------------------------------------------------ library(ShortRead) strm = FastqStreamer("bigdata/SRR1039508_1.fastq.gz", 100000) fq = yield(strm) # 'ShortReadQ' S4 class class(fq) # introspection methods(class=class(fq)) reads = sread(fq) # accessor -- get the reads reads # 'DNAStringSet' S4 class methods(class=class(reads)) gc = letterFrequency(reads, "GC", as.prob=TRUE) hist(gc) ## ----S4-help, eval=FALSE------------------------------------------------- ## ?DNAStringSet # class, and often frequently used methods ## ?letterFrequency # generic ## methods("letterFrequency") ## ?"letterFrequency,XStringSet-method"