# HG changeset patch # User drosofff # Date 1403510967 14400 # Node ID a8844a18de0d43317909b1ed9cc76dc15efc7052 Uploaded diff -r 000000000000 -r a8844a18de0d piRNAsignature.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/piRNAsignature.xml Mon Jun 23 04:09:27 2014 -0400 @@ -0,0 +1,122 @@ + + + + piRNAsignature.py $refGenomeSource.input $refGenomeSource.input.ext $minquery $maxquery $mintarget $maxtarget $minscope $maxscope $output + #if $refGenomeSource.genomeSource == "history": + $refGenomeSource.ownFile + --do_not_extract_index + #else: + #silent reference= filter( lambda x: str( x[0] ) == str( $input.dbkey ), $__app__.tool_data_tables[ 'bowtie_indexes' ].get_fields() )[0][-1] + $reference + --extract_index + #end if + $graph_type + $sigplotter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + graph_type = "${graph_type}" + + globalgraph = function () { + ## Setup R error handling to go to stderr + options( show.error.messages=F, + error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) + signature = read.delim("${output}", header=TRUE) + ## Open output1 PDF file + pdf( "${output1}" ) + signaturez=(signature[,2] -mean(signature[,2]))/sd(signature[,2]) + plot(signaturez, type = "b", main="signature", cex.main=2, xlab="overlap (nt)", ylab="z-score", pch=19, cex=0.8, col="darkslateblue", lwd=3, cex.lab=1.5, cex.axis=1.4, xaxt="n") + axis(1, at=seq(from=1, to=length(signature[,1]), by=3) ) + devname = dev.off() + ## Close the PDF file + ## Open output2 PDF file + pdf( "${output2}" ) + YLIM=max(signature[,2]) + plot(signature[,1:2], type = "h", xlab="overlap (nt)", ylim=c(0,YLIM), ylab="number of pairs", col="darkslateblue", lwd=7) + devname = dev.off() + ## Close the PDF file + ## Open output3 PDF file + pdf( "${output3}" ) + plot(signature[,1], signature[,3]*100, type = "l", main="ping-pong Signature of ${minquery}-${maxquery} against ${mintarget}-${maxtarget}nt small RNAs", + cex.main=1, xlab="overlap (nt)", ylab="ping-pong signal [%]", ylim=c(0,50), + pch=19, col="darkslateblue", lwd =4, cex.lab=1.2, cex.axis=1, xaxt="n") + axis(1, at=seq(from=1, to=length(signature[,1]), by=3) ) + devname = dev.off() + ## Close the PDF file + } + + treillisgraph = function () { + ## Open output3 PDF file + pdf( "${output3}", paper="special", height=11.69, width=8.2677 ) + signature = read.delim("${output}", header=TRUE) + 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", + 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, + layout=c(4,12), as.table=TRUE, newpage = T) ) + devnname = dev.off() + } + + if (graph_type=="global") { + globalgraph() + + } + if(graph_type=="lattice") { + treillisgraph() + } + + + + + + + (graph_type == "global") + + + (graph_type == "global") + + + + + + +**What it does** + +This tool computes the number of pairs by overlap classes (in nt) from a bowtie output file, the z-score calculated from these numbers of pairs, and the ping-pong signal as described in Brennecke et al (2009) Science. +The numerical options set the min and max size of both the query small rna class and the target small rna class +Three type of signals are plotted in separate pdf files, the number of pairs founds, the z-score calculated from these numbers of pairs, and the ping-pong signal as described in Brennecke et al (2009) Science. + + +