From c1af38fd4afbfd097e2bb10939689677e93440dc Mon Sep 17 00:00:00 2001 From: kohleman <kohleman> Date: Wed, 11 May 2011 15:20:57 +0000 Subject: [PATCH] initial check-in SVN: 21247 --- .../source/R/numberOfOccurrences.R | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 deep_sequencing_unit/source/R/numberOfOccurrences.R diff --git a/deep_sequencing_unit/source/R/numberOfOccurrences.R b/deep_sequencing_unit/source/R/numberOfOccurrences.R new file mode 100644 index 00000000000..4183dd9eb2b --- /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 -- GitLab