view getfastaBed.xml @ 46:64e2edfe7a2c draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 3e7bf5ae62de3520635d75e3825701960b9722e4
author iuc
date Sat, 18 May 2024 23:28:38 +0000
parents 07e8b80f278c
children
line wrap: on
line source

<tool id="bedtools_getfastabed" name="bedtools getfasta" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
    <description>use intervals to extract sequences from a FASTA file</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools" />
    <expand macro="requirements" />
    <expand macro="stdio" />
    <command><![CDATA[
#if str($fasta_source.fasta_source_selector) == 'history':
    #set $fasta_file = $fasta_source.fasta
#else
    #set $fasta_file = $fasta_source.fasta_id.fields.path
    ln -s '${fasta_file}.fai' 'input.fasta.fai' &&
#end if
ln -s '$fasta_file' 'input.fasta' &&
bedtools getfasta
$name
$nameOnly
$tab
$strand
$split
-fi 'input.fasta'
-bed '$input'
-fo '$output'
    ]]></command>
    <inputs>
        <param name="input" argument="-bed" type="data" format="@STD_BEDTOOLS_INPUTS@" label="@STD_BEDTOOLS_INPUT_LABEL@ file" />
        <conditional name="fasta_source">
            <param name="fasta_source_selector" type="select" label="Choose the source for the FASTA file">
                <option value="history" selected="true">History</option>
                <option value="preloaded">Server indexed files</option>
            </param>
            <when value="history">
                <param name="fasta" argument="-fi" type="data" format="fasta" label="FASTA file" />
            </when>
            <when value="preloaded">
               <param name="fasta_id" type="select">
                  <options from_data_table="fasta_indexes" />
               </param>
            </when>
        </conditional>
        <param argument="-name" type="boolean" truevalue="-name" falsevalue="" checked="false"
            label="Use the 'name' column in the BED file and the coordinates for the FASTA headers in the output FASTA file" />
        <param argument="-nameOnly" type="boolean" truevalue="-nameOnly" falsevalue="" checked="false"
            label="Use the 'name' column in the BED file for the FASTA headers in the output FASTA file" />
        <param argument="-tab" type="boolean" truevalue="-tab" falsevalue="" checked="false"
            label="Report extract sequences in a tab-delimited format instead of in FASTA format" />
        <param name="strand" argument="-s" type="boolean" truevalue="-s" falsevalue="" checked="false"
            label="Force strandedness"
            help="If the feature occupies the antisense strand, the sequence will be reverse complemented" />
        <expand macro="split" />
    </inputs>
    <outputs>
        <data name="output" format="fasta">
            <change_format>
                <when input="tab" value="-tab" format="tabular" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input" value="nucBed1.bed" ftype="bed" />
            <param name="fasta" value="nucBed1.fasta" ftype="fasta" />
            <param name="tab" value="False" />
            <param name="split" value="False" />
            <param name="nameOnly" value="False" />
            <output name="output" file="getfastaBed_result1.bed" ftype="fasta" />
        </test>
        <test>
            <param name="input" value="nucBed1.bed" ftype="bed" />
            <param name="fasta" value="nucBed1.fasta" ftype="fasta" />
            <param name="tab" value="True" />
            <param name="split" value="False" />
            <param name="nameOnly" value="False" />
            <output name="output" file="getfastaBed_result2.tabular" ftype="tabular" />
        </test>
        <test>
            <param name="input" value="nucBed1.bed" ftype="bed" />
            <param name="fasta" value="nucBed1.fasta" ftype="fasta" />
            <param name="tab" value="False" />
            <param name="split" value="False" />
            <param name="name" value="True" />
            <output name="output" file="getfastaBed_result3.bed" ftype="fasta" />
        </test>
        <test>
            <param name="input" value="nucBed2.bed" ftype="bed" />
            <param name="fasta" value="nucBed1.fasta" ftype="fasta" />
            <param name="tab" value="False" />
            <param name="split" value="False" />
            <param name="nameOnly" value="True" />
            <output name="output" file="getfastaBed_result4.bed" ftype="fasta" />
        </test>
        <test>
            <param name="input" value="nucBed2.bed" ftype="bed" />
            <param name="fasta_source_selector" value="preloaded"/>
            <param name="fasta_id" value="testid" />
            <param name="tab" value="False" />
            <param name="split" value="False" />
            <param name="nameOnly" value="True" />
            <output name="output" file="getfastaBed_result4.bed" ftype="fasta" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

bedtools 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>”.

.. image:: $PATH_TO_IMAGES/getfasta-glyph.png

.. class:: warningmark

1. The headers in the input FASTA file must exactly match the chromosome column in the BED file.

2. 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.

@REFERENCES@
    ]]></help>
    <expand macro="citations" />
</tool>