Source code

Download source archive ↓

upstream-extended/iuc/tools/bedtools/getfastaBed.xml

1<tool id="bedtools_getfastabed" name="bedtools getfasta" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
2    <description>use intervals to extract sequences from a FASTA file</description>
3    <macros>
4        <import>macros.xml</import>
5    </macros>
6    <expand macro="bio_tools" />
7    <expand macro="requirements" />
8    <expand macro="stdio" />
9    <command><![CDATA[
10#if str($fasta_source.fasta_source_selector) == 'history':
11    #set $fasta_file = $fasta_source.fasta
12#else
13    #set $fasta_file = $fasta_source.fasta_id.fields.path
14    ln -s '${fasta_file}.fai' 'input.fasta.fai' &&
15#end if
16ln -s '$fasta_file' 'input.fasta' &&
17bedtools getfasta
18$name
19$nameOnly
20$tab
21$strand
22$split
23-fi 'input.fasta'
24-bed '$input'
25-fo '$output'
26    ]]></command>
27    <inputs>
28        <param name="input" argument="-bed" type="data" format="@STD_BEDTOOLS_INPUTS@" label="@STD_BEDTOOLS_INPUT_LABEL@ file" />
29        <conditional name="fasta_source">
30            <param name="fasta_source_selector" type="select" label="Choose the source for the FASTA file">
31                <option value="history" selected="true">History</option>
32                <option value="preloaded">Server indexed files</option>
33            </param>
34            <when value="history">
35                <param name="fasta" argument="-fi" type="data" format="fasta" label="FASTA file" />
36            </when>
37            <when value="preloaded">
38               <param name="fasta_id" type="select">
39                  <options from_data_table="fasta_indexes" />
40               </param>
41            </when>
42        </conditional>
43        <param argument="-name" type="boolean" truevalue="-name" falsevalue="" checked="false"
44            label="Use the 'name' column in the BED file and the coordinates for the FASTA headers in the output FASTA file" />
45        <param argument="-nameOnly" type="boolean" truevalue="-nameOnly" falsevalue="" checked="false"
46            label="Use the 'name' column in the BED file for the FASTA headers in the output FASTA file" />
47        <param argument="-tab" type="boolean" truevalue="-tab" falsevalue="" checked="false"
48            label="Report extract sequences in a tab-delimited format instead of in FASTA format" />
49        <param name="strand" argument="-s" type="boolean" truevalue="-s" falsevalue="" checked="false"
50            label="Force strandedness"
51            help="If the feature occupies the antisense strand, the sequence will be reverse complemented" />
52        <expand macro="split" />
53    </inputs>
54    <outputs>
55        <data name="output" format="fasta">
56            <change_format>
57                <when input="tab" value="-tab" format="tabular" />
58            </change_format>
59        </data>
60    </outputs>
61    <tests>
62        <test>
63            <param name="input" value="nucBed1.bed" ftype="bed" />
64            <param name="fasta_source|fasta" value="nucBed1.fasta" ftype="fasta" />
65            <param name="tab" value="False" />
66            <param name="split" value="False" />
67            <param name="nameOnly" value="False" />
68            <output name="output" file="getfastaBed_result1.bed" ftype="fasta" />
69        </test>
70        <test>
71            <param name="input" value="nucBed1.bed" ftype="bed" />
72            <param name="fasta_source|fasta" value="nucBed1.fasta" ftype="fasta" />
73            <param name="tab" value="True" />
74            <param name="split" value="False" />
75            <param name="nameOnly" value="False" />
76            <output name="output" file="getfastaBed_result2.tabular" ftype="tabular" />
77        </test>
78        <test>
79            <param name="input" value="nucBed1.bed" ftype="bed" />
80            <param name="fasta_source|fasta" value="nucBed1.fasta" ftype="fasta" />
81            <param name="tab" value="False" />
82            <param name="split" value="False" />
83            <param name="name" value="True" />
84            <output name="output" file="getfastaBed_result3.bed" ftype="fasta" />
85        </test>
86        <test>
87            <param name="input" value="nucBed2.bed" ftype="bed" />
88            <param name="fasta_source|fasta" value="nucBed1.fasta" ftype="fasta" />
89            <param name="tab" value="False" />
90            <param name="split" value="False" />
91            <param name="nameOnly" value="True" />
92            <output name="output" file="getfastaBed_result4.bed" ftype="fasta" />
93        </test>
94        <test>
95            <param name="input" value="nucBed2.bed" ftype="bed" />
96            <param name="fasta_source|fasta_source_selector" value="preloaded"/>
97            <param name="fasta_source|fasta_id" value="testid" />
98            <param name="tab" value="False" />
99            <param name="split" value="False" />
100            <param name="nameOnly" value="True" />
101            <output name="output" file="getfastaBed_result4.bed" ftype="fasta" />
102        </test>
103    </tests>
104    <help><![CDATA[
105**What it does**
106
107bedtools getfasta will extract the sequence defined by the coordinates in a BED interval and create a new FASTA entry in the output file for each extracted sequence. By default, the FASTA header for each extracted sequence will be formatted as follows: “>chrom>:&lt;start>-&lt;end>”.
108
109.. image:: $PATH_TO_IMAGES/getfasta-glyph.png
110
111.. class:: warningmark
112
1131. The headers in the input FASTA file must exactly match the chromosome column in the BED file.
114
1152. You can use the UNIX fold command to set the line width of the FASTA output. For example, fold -w 60 will make each line of the FASTA file have at most 60 nucleotides for easy viewing.
116
117@REFERENCES@
118    ]]></help>
119    <expand macro="citations" />
120</tool>