/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
- <tool name="Extract data from Bed" id="bed_for_chrom">
- <description>Extract data for certain chromosome from a BED file</description>
- <command interpreter="command">/bin/bash $shscript</command>
- <inputs>
- <param ftype="bed" format="bed" name="bfile" type="data" label="BED file"/>
- <param name="chrom" type="text" label="Chromosome" optional="false" />
- </inputs>
- <outputs>
- <data format="bed" name="output" />
- </outputs>
- <configfiles>
- <configfile name="shscript">
- #!/bin/bash
- #set $dollar = chr(36)
- #set $gt = chr(62)
- #set $lt = chr(60)
- #set $ad = chr(38)
- #set $up = chr(94)
- chromlength=`echo $chrom |awk '{print length(${dollar}0)}'`
- if [[ ${dollar}chromlength -gt 255 ]];then
- echo "Chromosome exceed the limit of 255 characters!" ${gt}${ad}2;
- exit;
- fi
- if [[ ${dollar}chromlength -eq 0 ]];then
- echo "Chromosome is required!" ${gt}${ad}2;
- exit;
- fi
- grep -w ${up}${chrom} $bfile ${ad}${gt} $output
- </configfile>
- </configfiles>
- <tests>
- <test maxseconds="3600" name="BedExtract_1">
- <param name="bfile" value="bedfile.bed" />
- <param name="chrom" value="chrX" />
- <output name="output" file="bedextract_1/bedextract_1.bed" />
- </test>
- <test maxseconds="3600" name="BedExtract_2">
- <param name="bfile" value="bedfile.bed" />
- <param name="chrom" value="chr1" />
- <output name="output" file="bedextract_2/bedextract_2.bed" />
- </test>
- </tests>
- <help>
- This tool can extract the scores for a certain chromosome with a big
- BED file.
- -----
- **Parameters**
- - **BED file** is selected from history.
- - **Chromosome** on which the regions will be extracted from the BED
- file.
- -----
- **Output**
- - **BED file** only contains the scores for a certain chromosome.
- </help>
- </tool>