view crossmap_vcf.xml @ 9:18f7e96459d2 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/crossmap commit e10d34b547557b2bd4f0be69e31204bd5703e422"
author iuc
date Thu, 20 Jan 2022 04:32:23 +0000
parents 6e96c77f5824
children d4965adac10c
line wrap: on
line source

<tool id="crossmap_vcf" name="CrossMap VCF" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05">
    <description>Convert genome coordinates or annotation files between genome assemblies</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>

    <command detect_errors="aggressive"><![CDATA[
#set $input_file = str($seq_source.input)

ln -s '${seq_source.input_fasta}' 'genome.fasta' &&

CrossMap.py vcf

#if $seq_source.index_source_s == "cached"
    ## This is the 2nd dbkey, and the corresponding value has to be looked up
    "${filter(lambda x: str( x[1] ) == str($seq_source.chain_source.input_chain ), $__app__.tool_data_tables['liftOver'].get_fields())[0][2] }"
#else
    '${seq_source.chain_source.input_chain}'
#end if

'${input_file}'
'genome.fasta'
$no_comp_alleles
output
    ]]></command>

    <inputs>
        <conditional name="seq_source">
            <param name="index_source_s" type="select" label="Source for Input Data">
                <option value="cached">Local data (in galaxy)</option>
                <option value="history">From History</option>
            </param>
            <when value="cached">
                <param name="input" type="data" format="vcf" label="VCF file">
                    <!--
                    <validator type="unspecified_build"/>
                    -->
                    <!-- Gives error in tests
                    <validator type="dataset_metadata_in_file" filename="liftOver.loc" metadata_name="dbkey" metadata_column="0" message="LiftOver mapping (chain file) is not available for the specified build."/>
                    -->
                </param>
                <param name="input_fasta" type="select" label="Lift Over To (FASTA file)" help="The FASTA file must be on the same build (dbkey) as the LiftOver chain file">
                    <options from_data_table="all_fasta"/>
                </param>

                <expand macro="chain" />
            </when>

            <when value="history">
                <param name="input" type="data" format="vcf" label="VCF file"/>
                <param name="input_fasta" type="data" format="fasta" label="Full genome FASTA file"/>

                <expand macro="chain" />
            </when>
        </conditional>
        <param argument="--no-comp-alleles" type="boolean" truevalue="" falsevalue="--no-comp-alleles" checked="true" label="Check if the reference allele is different from the alternate allele"/>
    </inputs>

    <outputs>
        <data name="output" format="vcf" label="${tool.name} on ${on_string}" from_work_dir="output" />
        <data name="output_unmapped" format="vcf" label="${tool.name} (unmapped) on ${on_string}" from_work_dir="output.unmap" />
    </outputs>

    <tests>
        <test>
            <param name="index_source_s" value="history"/>
            <param name="input" value="test_vcf_01_input.vcf" ftype="vcf"/>
            <param name="index_source" value="history"/>
            <param name="input_fasta" value="test_vcf_01.fasta" ftype="fasta"/>
            <param name="input_chain" value="test_vcf_01.over.chain" ftype="csv"/>

            <output name="output">
                <assert_contents>
                    <has_text text="##fileformat=VCFv4.2"/>
                    <has_text_matching expression="##liftOverProgram=&lt;CrossMap,version=[0-9.]+,website=https://sourceforge.net/projects/crossmap&gt;"/>
                    <has_text text="##targetRefGenome="/>
                    <has_text text="#CHROM"/>
                    <has_text_matching expression="2.*?rs11449.*?PASS"/>
                    <has_text_matching expression="2.*?rs84825.*?PASS"/>
                </assert_contents>
            </output>
            <output name="output_unmapped" file="test_vcf_01_output.vcf.unmap"/>
        </test>
    </tests>
    <help><![CDATA[
@HELP_GENERAL@

VCF
---

VCF (variant call format) is a flexible and extendable line-oriented
text format developed by the 1000 Genome Project. It is useful for
representing single nucleotide variants, indels, copy number
variants, and structural variants. Chromosomes, coordinates, and
reference alleles are updated to a new assembly, and all the other
fields are not changed.

Notes:

- Genome coordinates and reference allele will be updated to target assembly.
- Reference genome is genome sequence of target assembly.
- If the reference genome sequence file (../database/genome/hg18.fa) was
  not indexed, CrossMap will automatically indexed it (only the first time
  you run CrossMap).
- In the output VCF file, whether the chromosome IDs contain “chr” or not
  depends on the format of the input VCF file.
    ]]></help>

    <citations>
        <citation type="doi">10.1093/bioinformatics/btt730</citation>
    </citations>
</tool>