Mercurial > repos > jesse-erdmann > tapdance
comparison lib/insert_vis.R @ 0:1437a2df99c0
Uploaded
| author | jesse-erdmann |
|---|---|
| date | Fri, 09 Dec 2011 11:56:56 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:1437a2df99c0 |
|---|---|
| 1 args <- commandArgs(trailingOnly = TRUE) | |
| 2 libdata <- read.table(args[2], header=TRUE, sep=",", row.names="Library") | |
| 3 pdf(args[4]) | |
| 4 boxplot (libdata[, 2:8], main="Library Sequences", ylab="Raw Count", xlab="Sequence Type", names=c(1:7)) | |
| 5 legend("topright", c("1:Barcoded sequences", "2:Sequences with mutagen", "3:Mappable sequences", "4:Unique, mappable sequences", "5:Sequences mapped to reference", "6:Unique sequences mapped to reference", "7:Non redundant insertions"), cex=0.7) | |
| 6 | |
| 7 regiondata <- read.table(args[3], header=TRUE, sep=",", row.names="Library") | |
| 8 sortedregiondata <- regiondata[order(regiondata[,1], decreasing=TRUE),] | |
| 9 sortedregionmatrix <- data.matrix(sortedregiondata) | |
| 10 barplot(height=t(sortedregionmatrix[c(1:10,(nrow(sortedregionmatrix)-9):nrow(sortedregionmatrix)),1:2]), ylab="Raw Count", beside=TRUE, col=c("blue", "red"), main="Mappable Sequences by Library (Top 10 vs. Bottom 10)", las=2, cex.names=0.7) | |
| 11 legend("topright", c("Mappable sequences", "Sequences with a mapping"), fill=c("blue", "red"), cex=0.7) | |
| 12 abline(v=30.5, lty=2) | |
| 13 axis(1, lab=F, at=(c(0:19)*3)+2) | |
| 14 | |
| 15 matrixcalcs <- cbind(sortedregionmatrix, sortedregionmatrix[,2]/sortedregionmatrix[,1]) | |
| 16 sortedregionmatrix <- matrixcalcs[order(matrixcalcs[,7], decreasing=TRUE), ] | |
| 17 barplot(height=t(sortedregionmatrix[c(1:10,(nrow(sortedregionmatrix)-9):nrow(sortedregionmatrix)),1:2]), ylab="Raw Count", beside=TRUE, main="Successful Mappings by Library (Top 10 vs. Bottom 10)", las=2, cex.names=0.7, col=c("blue", "red")) | |
| 18 legend("topright", c("Mappable sequences", "Sequences with a mapping"), fill=c("blue", "red"), cex=0.7) | |
| 19 abline(v=30.5, lty=2) | |
| 20 axis(1, lab=F, at=(c(0:19)*3)+2) | |
| 21 | |
| 22 matrixcalcs <- cbind(matrixcalcs, matrixcalcs[,6]/matrixcalcs[,1]) | |
| 23 sortedregionmatrix <- matrixcalcs[order(matrixcalcs[,8], decreasing=TRUE), ] | |
| 24 barplot(height=t(sortedregionmatrix[c(1:10,(nrow(sortedregionmatrix)-9):nrow(sortedregionmatrix)),c(1,6)]), ylab="Raw Count", beside=TRUE, main="Redundancy of Mapped Regions by Library (Top 10 vs. Bottom 10)", las=2, cex.names=0.7, col=c("blue", "red")) | |
| 25 legend("topright", c("Mappable sequences", "Distinct regions mapped"), fill=c("blue", "red"), cex=0.7) | |
| 26 abline(v=30.5, lty=2) | |
| 27 axis(1, lab=F, at=(c(0:19)*3)+2) | |
| 28 | |
| 29 dev.off() | |
| 30 | |
| 31 |
