# HG changeset patch # User chris # Date 1424084898 -3600 # Node ID 9274c7b1e85c0d4443e78ec6ab933df6ac2b615e # Parent d613dbee3ce4de0d52aab45254b9b76d02d46028 Fixed issue: now the plot properly reflects a subset of analysed overlaps, i.e 5 to 15 nucleotides of overlap. Also added a working test case. ( and was missing, and output file must be references with file= and not value=). diff -r d613dbee3ce4 -r 9274c7b1e85c signature.xml --- a/signature.xml Mon Nov 03 10:29:28 2014 -0500 +++ b/signature.xml Mon Feb 16 12:08:18 2015 +0100 @@ -1,4 +1,4 @@ - + bowtie @@ -66,7 +66,8 @@ options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) signature = read.delim("${output}", header=TRUE) - signaturez=(signature[,2] -mean(signature[,2]))/sd(signature[,2]) + signaturez=data.frame(signature[,1], (signature[,2] -mean(signature[,2]))/sd(signature[,2])) + overlap_prob_z=data.frame(signature[,1], (signature[,3] -mean(signature[,3]))/sd(signature[,3])) YLIM=max(signature[,2]) ## Open output2 PDF file @@ -75,18 +76,14 @@ plot(signature[,1:2], type = "h", main="Numbers of pairs", cex.main=1, xlab="overlap (nt)", ylim=c(0,YLIM), ylab="Numbers of pairs", col="darkslateblue", lwd=4) - plot(signaturez, type = "l", main="Number of pairs Z-scores", cex.main=1, xlab="overlap (nt)", ylab="z-score", pch=19, cex=0.2, col="darkslateblue", lwd=2, cex.lab=1, cex.axis=1, xaxt="n") - axis(1, at=seq(from=1, to=length(signature[,1]), by=3) ) + plot(signaturez, type = "l", main="Number of pairs Z-scores", cex.main=1, xlab="overlap (nt)", ylab="z-score", pch=19, cex=0.2, col="darkslateblue", lwd=2) plot(signature[,1], signature[,3]*100, type = "l", main="Overlap probabilities", cex.main=1, xlab="overlap (nt)", ylab="Probability [%]", ylim=c(0,50), - pch=19, col="darkslateblue", lwd=2, cex.lab=1, cex.axis=1, xaxt="n") - axis(1, at=seq(from=1, to=length(signature[,1]), by=3) ) + pch=19, col="darkslateblue", lwd=2) - overlap_prob_z=(signature[,3] -mean(signature[,3]))/sd(signature[,3]) - plot(overlap_prob_z, type = "l", main="Overlap Probability Z-scores", cex.main=1, xlab="overlap (nt)", ylab="z-score", pch=19, cex=0.2, col="darkslateblue", lwd=2, cex.lab=1, cex.axis=1, xaxt="n") - axis(1, at=seq(from=1, to=length(signature[,1]), by=3) ) - + plot(overlap_prob_z, type = "l", main="Overlap Probability Z-scores", cex.main=1, xlab="overlap (nt)", ylab="z-score", pch=19, cex=0.2, col="darkslateblue", lwd=2) + mtext("Overlap Signatures of ${minquery}-${maxquery} against ${mintarget}-${maxtarget}nt small RNAs", outer = TRUE, cex=1) devname = dev.off() ## Close the PDF file @@ -99,7 +96,7 @@ options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) library(lattice) - print (xyplot(signature[,3]*100~signature[,1]|signature[,4], type = "l", xlim=c(1,26), main="ping-pong Signature of ${minquery}-${maxquery} against ${mintarget}-${maxtarget}nt small RNAs", + print (xyplot(signature[,3]*100~signature[,1]|signature[,4], type = "l", xlim=c(${minscope},${maxscope}), main="ping-pong Signature of ${minquery}-${maxquery} against ${mintarget}-${maxtarget}nt small RNAs", par.strip.text=list(cex=.5), strip=strip.custom(which.given=1, bg="lightblue"), scales=list(cex=0.5), cex.main=1, cex=.5, xlab="overlap (nt)", ylab="ping-pong signal [%]", pch=19, col="darkslateblue", lwd =1.5, cex.lab=1.2, cex.axis=1.2, @@ -108,7 +105,7 @@ } if (graph_type=="global") { - globalgraph() + globalgraph() } if(graph_type=="lattice") { @@ -132,21 +129,22 @@ + - - + + - - + + - - + + - +