diff --git a/deep_sequencing_unit/source/R/numberOfOccurrences.R b/deep_sequencing_unit/source/R/numberOfOccurrences.R new file mode 100644 index 0000000000000000000000000000000000000000..4183dd9eb2b42a6a9527dddfa65af6053e976062 --- /dev/null +++ b/deep_sequencing_unit/source/R/numberOfOccurrences.R @@ -0,0 +1,19 @@ +# Taken from http://www.bioconductor.org/help/workflows/high-throughput-sequencing/ + +## Load packages; also loads Biostrings, IRanges, ... +library(multicore) +library(ShortRead) + +args <- commandArgs(TRUE) +seq <- readFastq(args[1]) + +pdf(file=paste(args[1],"NumberOfOccurrences.pdf", sep="_")) + +## Calculate and plot cumulative reads vs. occurrences +tbl <- tables(seq)[[2]] +xyplot(cumsum(nReads * nOccurrences) ~ nOccurrences, tbl, +scales=list(x=list(log=TRUE)), main=args[1], type="b", pch=20, +xlab="Number of Occurrences", +ylab="Cumulative Number of Reads") + +dev.off() \ No newline at end of file