PageRenderTime 12ms CodeModel.GetById 6ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/peakcalling/nps.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 201 lines | 172 code | 29 blank | 0 comment | 0 complexity | b6fa26ceaa9d37e5d120864c3eb9543a MD5 | raw file
  1<tool name="NPS" id="peakcalling_nps">
  2    <description>Nucleosome Positioning from Sequencing</description>
  3    <command interpreter="command">/bin/bash $shscript</command>
  4    <inputs>
  5      <param format="bed" name="bfile" type="data" label="BED file(center will be aligned, 35,000,000 lines max)" />
  6      <param name="use_wavelet" type="boolean" label="use wavelet to denoising?" checked="no" truevalue="yes" falsevalue="no" /> 
  7
  8      <conditional name="pre">
  9        <param name="pre_select" type="select" label="------- Preprocessing Options -------">
 10          <option value="no">Use defaults</option>
 11          <option value="yes">Show settings</option>
 12        </param>
 13        <when value="yes">
 14          <param name="fragment_size" type="integer" label="The estimate fragment size (bp)" value="150">
 15            <validator type="in_range" max="400" min="75" message="Extension shoube in range 75 - 400" />
 16          </param>
 17          <param name="sort" type="boolean" label="sort the tags?" checked="yes" truevalue="yes" falsevalue="no"/>
 18          <param name="tag_thread" type="integer" label="minimum tag count to declare as a peak" value="2" />
 19        </when>
 20        <when value="no">
 21          <param name="fragment_size" type="hidden" value="150"/>
 22          <param name="sort" type="hidden" value="yes"/>
 23          <param name="tag_thread" type="hidden" value="2"/>
 24        </when>
 25      </conditional>
 26
 27      <conditional name="wavelet">
 28        <param name="wavelet_select" type="select" label="------- Wavelet Denoising Options (Better use default.) -------">
 29          <option value="no">Use defaults</option>
 30          <option value="yes">Show settings</option>
 31        </param>
 32        <when value="yes">
 33          <param name="wav_decomp_level" type="integer" label="which level of wavelet decomposition" value="2" />
 34          <param name="wav_method" type="select" label="use what kind of wavelet denosing?">
 35            <option value="coif4">coif4</option>
 36          </param>
 37          <param name="wav_threshold_est" type="select" label="Use what for denoising threshold selection?">
 38            <option value="heursure">heursure</option>
 39          </param>
 40          <param name="wav_threshold_type" type="select" label="type of threshold?">
 41            <option value="soft">soft</option>
 42          </param>
 43          <param name="wav_scale" type="text" label="scale of denosing" value="mln" />
 44        </when>
 45        <when value="no">
 46          <param name="wav_decomp_level" type="hidden" value="2"/>
 47          <param name="wav_method" type="hidden" value="coif4"/>
 48          <param name="wav_threshold_est" type="hidden" value="heursure"/>
 49          <param name="wav_threshold_type" type="hidden" value="soft"/>
 50          <param name="wav_scale" type="hidden" value="mln"/>
 51        </when>
 52      </conditional>
 53
 54      <conditional name="peakfind">
 55        <param name="peakfind_select" type="select" label="------- Peak Finding Options -------">
 56          <option value="no">Use defaults</option>
 57          <option value="yes">Show settings</option>
 58        </param>
 59        <when value="yes">
 60          <param name="peakf_pvalue" type="text" label="p value cut-off for identifying nucleosomes" value="1e-5" />
 61          <param name="peakf_min_w" type="integer" label="minimum peak width" value="80" />
 62          <param name="peakf_max_w" type="integer" label="maximum peak width" value="250" />
 63          <param name="peakf_PIR" type="text" label="minimum peak to inflection point ratio" value="1.2" />
 64          <param name="peakf_bios_ratio" type="float" label="allowable ratio between + tags and – tags" value="4" />
 65        </when>
 66        <when value="no">
 67          <param name="peakf_pvalue" type="hidden" value="1e-5"/>
 68          <param name="peakf_min_w" type="hidden" value="80"/>
 69          <param name="peakf_max_w" type="hidden" value="250"/>
 70          <param name="peakf_PIR" type="hidden" value="1.2"/>
 71          <param name="peakf_bios_ratio" type="hidden" value="4"/>
 72        </when>
 73      </conditional>
 74    </inputs>
 75    <outputs>
 76      <data format="bed" name="outputbed" label="NPS peak output for ${bfile.name}" />
 77      <data format="wig" name="outputwig" label="NPS wig output for ${bfile.name}" />
 78      <data format="txt" name="log" label="NPS log" />
 79      <data format="txt" name="tagfile" label="NPS tag file" />
 80    </outputs>
 81    <configfiles>
 82      <configfile name="tag_file">
 83#import sys
 84#import os
 85
 86#set $dollar = chr(36)
 87#set $gt = chr(62)
 88#set $lt = chr(60)
 89#set $ad = chr(38)
 90
 91###set $static_library_path = os.path.abspath($__app__.config.cistrome_static_library_path)
 92
 93#if $bfile.metadata.dbkey == "hg18"
 94#set $genome_len = str(2770000000)
 95#end if
 96#if $bfile.metadata.dbkey == "hg19"
 97#set $genome_len = str(2790000000)
 98#end if
 99#if $bfile.metadata.dbkey == "mm8"
100#set $genome_len = str(1870000000)
101#end if
102#if $bfile.metadata.dbkey == "mm9"
103#set $genome_len = str(1910000000)
104#end if
105#if $bfile.metadata.dbkey == "ce4"
106#set $genome_len = str(90300000)
107#end if
108#if $bfile.metadata.dbkey == "ce6"
109#set $genome_len = str(90300000)
110#end if
111#if $bfile.metadata.dbkey == "dm2"
112#set $genome_len = str(119000000)
113#end if
114#if $bfile.metadata.dbkey == "dm3"
115#set $genome_len = str(152000000)
116#end if
117
118
119#set $shiftsize = (int($pre.fragment_size.value)-75)/2
120
121\# Parameters for ChIP Sequence data analysis.
122
123
124\# Input and output files
125
126INFILE = $bfile
127OUTFILE = $outputbed
128OUTFILEWIG = $outputwig
129
130\# Preprocessing
131
132SPENAME = $bfile.metadata.dbkey
133EXTENSION = 75
134SHIFT = $shiftsize
135WANT_SORT = $pre.sort
136TAG_THR = $pre.tag_thread
137
138\# Wavelet denoising
139
140WANT_DENOISE = $use_wavelet
141DECOMP_LEVEL = $wavelet.wav_decomp_level
142WAVELET = $wavelet.wav_method
143THRESHOLD_EST = $wavelet.wav_threshold_est
144THRESHOLD_TYPE = $wavelet.wav_threshold_type
145SCALE = $wavelet.wav_scale
146
147\# Peak finding
148
149INTERVAL = 10
150GENOME_LEN = $genome_len
151PVALUE = $peakfind.peakf_pvalue
152TAG_NUM = NEED_TO_FILE_IN_LATER
153LOG = 3
154SLOPE = 2
155MIN_WIDTH = $peakfind.peakf_min_w
156MAX_WIDTH = $peakfind.peakf_max_w
157MIN_HEIGHT = 0
158MAX_HEIGHT = 10000
159PEAK_INFLECTION_RATIO = $peakfind.peakf_PIR
160MED_WSIZE = 5
161BIAS_RATIO = $peakfind.peakf_bios_ratio
162
163      </configfile>
164      <configfile name="shscript">
165#set $gt = chr(62)
166#set $ad = chr(38)
167#set $dollar = chr(36)
168
169tagnum=`grep -c -v ^\# $bfile`
170perl -pi -e s/NEED_TO_FILE_IN_LATER/${dollar}tagnum/ $tag_file
171if [[ ${dollar}tagnum -gt 35000000 ]];then
172    echo "bed file is too big! 35M lines is the maximum!" ${gt}${ad} $log
173    exit;
174fi
175
176SeqTag.py $tag_file ${ad}${gt} $log
177cp $tag_file $tagfile
178      </configfile>
179    </configfiles>
180    <help>
181NPS
182
183Please find instruction and parameters here.
184http://liulab.dfci.harvard.edu/NPS/
185
186.. class:: warningmark
187
188**NEED IMPROVEMENT**
189
190-----
191
192**Outputs**
193
194- **BED file** for nucleosome locations in BED format
195- **LOG file** job log. If you see errors, please attach this in
196  the bug report
197- **TAG file** with all the information input into the tool
198
199    </help>
200</tool>
201