PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/liftover/bed_chrom.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 67 lines | 55 code | 12 blank | 0 comment | 0 complexity | ad0c502f0a3348563a149087006b2074 MD5 | raw file
 1<tool name="Extract data from Bed" id="bed_for_chrom">
 2  <description>Extract data for certain chromosome from a BED file</description>
 3  <command interpreter="command">/bin/bash $shscript</command>
 4  <inputs>
 5    <param ftype="bed" format="bed" name="bfile" type="data" label="BED file"/>
 6    <param name="chrom" type="text" label="Chromosome" optional="false" />
 7  </inputs>
 8  <outputs>
 9    <data format="bed" name="output" />
10  </outputs>
11  <configfiles>
12    <configfile name="shscript">
13#!/bin/bash
14
15#set $dollar = chr(36)
16#set $gt = chr(62)
17#set $lt = chr(60)
18#set $ad = chr(38)
19#set $up = chr(94)
20
21chromlength=`echo $chrom |awk '{print length(${dollar}0)}'`
22if [[ ${dollar}chromlength -gt 255 ]];then
23    echo "Chromosome exceed the limit of 255 characters!" ${gt}${ad}2;
24    exit;
25fi
26if [[ ${dollar}chromlength -eq 0 ]];then
27    echo "Chromosome is required!" ${gt}${ad}2;
28    exit;
29fi
30
31grep -w ${up}${chrom} $bfile ${ad}${gt} $output
32
33     </configfile>
34  </configfiles>
35<tests>
36  <test maxseconds="3600" name="BedExtract_1">
37    <param name="bfile" value="bedfile.bed" />
38    <param name="chrom" value="chrX" />
39    <output name="output" file="bedextract_1/bedextract_1.bed" />
40  </test>
41  <test maxseconds="3600" name="BedExtract_2">
42    <param name="bfile" value="bedfile.bed" />
43    <param name="chrom" value="chr1" />
44    <output name="output" file="bedextract_2/bedextract_2.bed" />
45  </test>
46</tests>
47  <help>
48This tool can extract the scores for a certain chromosome with a big
49BED file.
50
51-----
52
53**Parameters**
54
55- **BED file** is selected from history. 
56- **Chromosome** on which the regions will be extracted from the BED
57  file.
58
59-----
60
61**Output**
62
63- **BED file** only contains the scores for a certain chromosome.
64
65  </help>
66
67</tool>