### R code from vignette source 'vignettes/Rsubread/inst/doc/Rsubread.Rnw' ################################################### ### code chunk number 1: Rsubread.Rnw:67-70 ################################################### library(Rsubread) ref <- system.file("extdata","reference.fa",package="Rsubread") buildindex(basename="reference_index",reference=ref) ################################################### ### code chunk number 2: Rsubread.Rnw:93-95 ################################################### reads <- system.file("extdata","reads.txt",package="Rsubread") align(index="reference_index",readfile1=reads,output_file="alignResults.SAM") ################################################### ### code chunk number 3: Rsubread.Rnw:102-106 ################################################### reads1 <- system.file("extdata","reads1.txt",package="Rsubread") reads2 <- system.file("extdata","reads2.txt",package="Rsubread") align(index="reference_index",readfile1=reads1,readfile2=reads2, output_file="alignResultsPE.SAM") ################################################### ### code chunk number 4: Rsubread.Rnw:123-133 ################################################### ann <- data.frame( GeneID=c("gene1","gene1","gene2","gene2"), Chr="chr_dummy", Start=c(100,1000,3000,5000), End=c(500,1800,4000,5500), Strand=c("+","+","-","-"), stringsAsFactors=FALSE) ann fc_SE <- featureCounts("alignResults.SAM",annot.ext=ann) fc_SE ################################################### ### code chunk number 5: Rsubread.Rnw:140-142 ################################################### fc_PE <- featureCounts("alignResultsPE.SAM",annot.ext=ann,isPairedEnd=TRUE) fc_PE ################################################### ### code chunk number 6: Rsubread.Rnw:162-164 ################################################### x <- qualityScores(filename=reads,input_format="FASTQ",offset=64,nreads=1000) x[1:10,1:10] ################################################### ### code chunk number 7: Rsubread.Rnw:173-179 ################################################### ## Fraction of A,T,G and C bases in all the reads x <- atgcContent(filename=reads) x ## Fraction of A,T,G and C bases at each read location xb <- atgcContent(filename=reads,basewise=TRUE) xb[,1:5] ################################################### ### code chunk number 8: Rsubread.Rnw:188-189 ################################################### propmapped("alignResults.SAM")