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