Skip to content
Snippets Groups Projects
CreatePerCycleReadQuality.R 538 B
Newer Older
  • Learn to ignore specific revisions
  • kohleman's avatar
    kohleman committed
    library(ShortRead)
    args <- commandArgs(TRUE)
    reads <- readFastq(args[1])
    if (length(reads) > 1000000) {
    	reads <- sample(reads,1000000) # if more than a million reads, sample randomly
    }
    qual <- FastqQuality(quality(quality(reads))) # get quality scores
    readM <- as(qual, "matrix") # convert scores to matrix
    pdf(file=paste(args[1],"boxplot.pdf", sep="_")) # Save box plot as boxplot.pdf in current folder
    boxplot(readM, outline = FALSE, main="Per Cycle Read Quality", sub=args[1], xlab="Cycle", ylab="Phred Quality", col="grey")
    dev.off()