changeset 1:9274c7b1e85c

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. (<tests> and </tests> was missing, and output file must be references with file= and not value=).
author chris <drosofff@gmail.com>
date Mon, 16 Feb 2015 12:08:18 +0100
parents d613dbee3ce4
children 2b30861d95f4
files signature.xml
diffstat 1 files changed, 17 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
-<tool id="signature" name="Small RNA Signatures" version="2.0.0">
+<tool id="signature" name="Small RNA Signatures" version="2.0.1">
 	<description></description>
 	<requirements>
         	<requirement type="package" version="0.12.7">bowtie</requirement>
@@ -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 @@
 
         </help>
 
+<tests>
   <test>
       <param name="genomeSource" value="history" />
-      <param name="ownFile" value ="transposons.fasta" ftype="fasta" />
-      <param name="input" value="sr_bowtie.output" ftype="tabular" />
+      <param name="ownFile" value ="ensembl.fa" ftype="fasta" />
+      <param name="input" value="sr_bowtie.bam" ftype="bam" />
       <param name="minquery" value="23" />
       <param name="maxquery" value="29" />
       <param name="mintarget" value="23" />
       <param name="maxtarget" value="29" />
-      <param name="minscope" value="1" />
-      <param name="maxscope" value="26" />
+      <param name="minscope" value="5" />
+      <param name="maxscope" value="15" />
       <param name="graph_type" value="global" />
-      <output name="readmap_dataframe" ftype="tabular" value="signature_data_frame.tab"/>
-      <output name="readmap_PDF" ftype="pdf" value="Overlap_probabilities.pdf"/>
+      <output name="output" ftype="tabular" file="signature.tab"/>
+      <output name="output2" ftype="pdf" file="signature.pdf"/>
   </test>
-
+</tests>
 
 
 </tool>