Mercurial > repos > drosofff > msp_sr_signature
annotate signature.xml @ 7:46405fd09d06 draft
planemo upload for repository https://bitbucket.org/drosofff/gedtools/
author | mvdbeek |
---|---|
date | Sun, 21 Jun 2015 16:04:56 -0400 |
parents | 741cc1d16813 |
children | 4c546f1e6fa2 |
rev | line source |
---|---|
7
46405fd09d06
planemo upload for repository https://bitbucket.org/drosofff/gedtools/
mvdbeek
parents:
4
diff
changeset
|
1 <tool id="signature" name="Small RNA Signatures" version="2.0.3"> |
2 | 2 <description /> |
3 <requirements> | |
4 <requirement type="package" version="0.12.7">bowtie</requirement> | |
5 <requirement type="package" version="0.1.18">samtools</requirement> | |
6 <requirement type="package" version="0.7.7">pysam</requirement> | |
7
46405fd09d06
planemo upload for repository https://bitbucket.org/drosofff/gedtools/
mvdbeek
parents:
4
diff
changeset
|
7 <requirement type="package" version="3.1.2">R</requirement> |
2 | 8 <requirement type="package" version="2.14">biocbasics</requirement> |
9 <requirement type="package" version="1.9">numpy</requirement> | |
10 </requirements> | |
11 <command interpreter="python"> | |
0 | 12 signature.py |
13 --input $refGenomeSource.input | |
14 --inputFormat $refGenomeSource.input.ext | |
15 --minquery $minquery | |
16 --maxquery $maxquery | |
17 --mintarget $mintarget | |
18 --maxtarget $maxtarget | |
19 --minscope $minscope | |
20 --maxscope $maxscope | |
21 --outputOverlapDataframe $output | |
22 #if $refGenomeSource.genomeSource == "history": | |
23 --referenceGenome $refGenomeSource.ownFile | |
24 #else: | |
25 #silent reference= filter( lambda x: str( x[0] ) == str( $input.dbkey ), $__app__.tool_data_tables[ 'bowtie_indexes' ].get_fields() )[0][-1] | |
26 --referenceGenome $reference | |
27 --extract_index | |
28 #end if | |
29 --graph $graph_type | |
30 --rcode $sigplotter | |
31 </command> | |
2 | 32 <inputs> |
33 <conditional name="refGenomeSource"> | |
34 <param help="Built-ins were indexed using default options" label="Will you select a reference genome from your history or use a built-in index?" name="genomeSource" type="select"> | |
35 <option value="indexed">Use a built-in index</option> | |
36 <option value="history">Use one from the history</option> | |
37 </param> | |
38 <when value="indexed"> | |
39 <param format="tabular,sam,bam" label="Compute signature from this bowtie standard output" name="input" type="data"> | |
40 <validator message="database not set for this bowtie output. Select the database(=genome used for matching) manually, or select a reference fasta from your history." metadata_column="0" metadata_name="dbkey" table_name="bowtie_indexes" type="dataset_metadata_in_data_table" /> | |
41 </param> | |
42 </when> | |
43 <when value="history"> | |
44 <param format="fasta" label="Select the fasta reference" name="ownFile" type="data" /> | |
45 <param format="tabular,sam,bam" label="Compute signature from this bowtie standard output" name="input" type="data" /> | |
46 </when> | |
47 </conditional> | |
48 <param help="'23' = 23 nucleotides" label="Min size of query small RNAs" name="minquery" size="3" type="integer" value="23" /> | |
49 <param help="'29' = 29 nucleotides" label="Max size of query small RNAs" name="maxquery" size="3" type="integer" value="29" /> | |
50 <param help="'23' = 23 nucleotides" label="Min size of target small RNAs" name="mintarget" size="3" type="integer" value="23" /> | |
51 <param help="'29' = 29 nucleotides" label="Max size of target small RNAs" name="maxtarget" size="3" type="integer" value="29" /> | |
52 <param help="'1' = 1 nucleotide overlap" label="Minimal relative overlap analyzed" name="minscope" size="3" type="integer" value="1" /> | |
53 <param help="'1' = 1 nucleotide overlap" label="Maximal relative overlap analyzed" name="maxscope" size="3" type="integer" value="26" /> | |
54 <param help="Signature can be computed globally or by item present in the alignment file" label="Graph type" name="graph_type" type="select"> | |
55 <option selected="True" value="global">Global</option> | |
56 <option value="lattice">Lattice</option> | |
57 </param> | |
58 </inputs> | |
59 <outputs> | |
60 <data format="tabular" label="signature data frame" name="output" /> | |
61 <data format="pdf" label="Overlap probabilities" name="output2" /> | |
62 </outputs> | |
63 <tests> | |
64 <test> | |
65 <param name="genomeSource" value="history" /> | |
66 <param ftype="fasta" name="ownFile" value="ensembl.fa" /> | |
67 <param ftype="bam" name="input" value="sr_bowtie.bam" /> | |
68 <param name="minquery" value="23" /> | |
69 <param name="maxquery" value="29" /> | |
70 <param name="mintarget" value="23" /> | |
71 <param name="maxtarget" value="29" /> | |
72 <param name="minscope" value="5" /> | |
73 <param name="maxscope" value="15" /> | |
74 <param name="graph_type" value="global" /> | |
75 <output file="signature.tab" ftype="tabular" name="output" /> | |
76 <output file="signature.pdf" ftype="pdf" name="output2" /> | |
77 </test> | |
78 </tests> | |
79 <help> | |
0 | 80 |
2 | 81 **What it does** |
82 | |
83 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. | |
84 The numerical options set the min and max size of both the query small rna class and the target small rna class. | |
85 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. | |
0 | 86 |
2 | 87 </help> |
88 <citations> | |
89 <citation type="doi">10.1007/978-1-4939-0931-5_12</citation> | |
90 </citations> | |
91 <configfiles> | |
92 <configfile name="sigplotter"> | |
0 | 93 graph_type = "${graph_type}" |
94 | |
95 globalgraph = function () { | |
96 ## Setup R error handling to go to stderr | |
97 options( show.error.messages=F, | |
98 error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) | |
99 signature = read.delim("${output}", header=TRUE) | |
1
9274c7b1e85c
Fixed issue: now the plot properly reflects a subset of analysed overlaps, i.e 5 to 15 nucleotides of overlap.
chris <drosofff@gmail.com>
parents:
0
diff
changeset
|
100 signaturez=data.frame(signature[,1], (signature[,2] -mean(signature[,2]))/sd(signature[,2])) |
9274c7b1e85c
Fixed issue: now the plot properly reflects a subset of analysed overlaps, i.e 5 to 15 nucleotides of overlap.
chris <drosofff@gmail.com>
parents:
0
diff
changeset
|
101 overlap_prob_z=data.frame(signature[,1], (signature[,3] -mean(signature[,3]))/sd(signature[,3])) |
0 | 102 YLIM=max(signature[,2]) |
4 | 103 |
0 | 104 |
105 ## Open output2 PDF file | |
106 pdf( "${output2}" ) | |
4 | 107 if (YLIM!=0) { |
108 par(mfrow=c(2,2),oma = c(0, 0, 3, 0)) | |
0 | 109 |
4 | 110 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) |
0 | 111 |
4 | 112 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) |
113 | |
114 plot(signature[,1], signature[,3]*100, type = "l", main="Overlap probabilities", | |
0 | 115 cex.main=1, xlab="overlap (nt)", ylab="Probability [%]", ylim=c(0,50), |
1
9274c7b1e85c
Fixed issue: now the plot properly reflects a subset of analysed overlaps, i.e 5 to 15 nucleotides of overlap.
chris <drosofff@gmail.com>
parents:
0
diff
changeset
|
116 pch=19, col="darkslateblue", lwd=2) |
0 | 117 |
4 | 118 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) |
1
9274c7b1e85c
Fixed issue: now the plot properly reflects a subset of analysed overlaps, i.e 5 to 15 nucleotides of overlap.
chris <drosofff@gmail.com>
parents:
0
diff
changeset
|
119 |
4 | 120 mtext("Overlap Signatures of ${minquery}-${maxquery} against ${mintarget}-${maxtarget}nt small RNAs", outer = TRUE, cex=1) |
121 } | |
0 | 122 devname = dev.off() |
123 ## Close the PDF file | |
124 } | |
125 | |
126 treillisgraph = function () { | |
127 ## Open output2 PDF file | |
128 pdf( "${output2}", paper="special", height=11.69, width=8.2677 ) | |
129 signature = read.delim("${output}", header=TRUE) | |
130 options( show.error.messages=F, | |
131 error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) | |
132 library(lattice) | |
1
9274c7b1e85c
Fixed issue: now the plot properly reflects a subset of analysed overlaps, i.e 5 to 15 nucleotides of overlap.
chris <drosofff@gmail.com>
parents:
0
diff
changeset
|
133 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", |
0 | 134 par.strip.text=list(cex=.5), strip=strip.custom(which.given=1, bg="lightblue"), scales=list(cex=0.5), |
135 cex.main=1, cex=.5, xlab="overlap (nt)", ylab="ping-pong signal [%]", | |
136 pch=19, col="darkslateblue", lwd =1.5, cex.lab=1.2, cex.axis=1.2, | |
137 layout=c(4,12), as.table=TRUE, newpage = T) ) | |
138 devnname = dev.off() | |
139 } | |
140 | |
141 if (graph_type=="global") { | |
1
9274c7b1e85c
Fixed issue: now the plot properly reflects a subset of analysed overlaps, i.e 5 to 15 nucleotides of overlap.
chris <drosofff@gmail.com>
parents:
0
diff
changeset
|
142 globalgraph() |
0 | 143 |
144 } | |
145 if(graph_type=="lattice") { | |
146 treillisgraph() | |
147 } | |
148 </configfile> | |
2 | 149 </configfiles> |
0 | 150 </tool> |