PageRenderTime 64ms CodeModel.GetById 55ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/filters/randomlines.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 66 lines | 56 code | 9 blank | 1 comment | 0 complexity | b93b4aca8684865b8f7aef33451af347 MD5 | raw file
 1<tool id="random_lines1" name="Select random lines" version="2.0.1">
 2  <description>from a file</description>
 3  <command interpreter="python">random_lines_two_pass.py "${input}" "${out_file1}" "${num_lines}"
 4  #if str( $seed_source.seed_source_selector ) == "set_seed":
 5      --seed "${seed_source.seed}"
 6  #end if
 7  </command>
 8  <inputs>
 9    <param name="num_lines" size="5" type="integer" value="1" label="Randomly select" help="lines"/>
10    <param format="txt" name="input" type="data" label="from"/>
11    <conditional name="seed_source">
12      <param name="seed_source_selector" type="select" label="Set a random seed">
13        <option value="no_seed" selected="True">Don't set seed</option>
14        <option value="set_seed">Set seed</option>
15      </param>
16      <when value="no_seed">
17        <!-- Do nothing here -->
18      </when>
19      <when value="set_seed"> 
20        <param name="seed" type="text" label="Random seed" />
21      </when>
22    </conditional>
23  </inputs>
24  <outputs>
25    <data format="input" name="out_file1" metadata_source="input"/>
26  </outputs>
27  <tests>
28    <test>
29      <param name="num_lines" value="65"/>
30      <param name="input" value="1.bed"/>
31      <param name="seed_source_selector" value="no_seed"/>
32      <output name="out_file1" file="1.bed"/>
33    </test>
34    <test>
35      <param name="num_lines" value="1"/>
36      <param name="input" value="1.bed"/>
37      <param name="seed_source_selector" value="set_seed"/>
38      <param name="seed" value="asdf"/>
39      <output name="out_file1" file="1_bed_random_lines_1_seed_asdf_out.bed"/>
40    </test>
41  </tests>
42  <help>
43
44**What it does**
45
46This tool selects N random lines from a file, with no repeats, and preserving ordering.
47
48-----
49
50**Example**
51
52Input File::
53
54    chr7  56632  56652   D17003_CTCF_R6  310  +
55    chr7  56736  56756   D17003_CTCF_R7  354  +
56    chr7  56761  56781   D17003_CTCF_R4  220  +
57    chr7  56772  56792   D17003_CTCF_R7  372  +
58    chr7  56775  56795   D17003_CTCF_R4  207  +
59
60Selecting 2 random lines might return this::
61
62    chr7  56736  56756   D17003_CTCF_R7  354  +
63    chr7  56775  56795   D17003_CTCF_R4  207  +
64
65    </help>
66</tool>