view spectrast_import.xml @ 3:7f02fc51bddf draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/spectrast commit 379705f578f9a0465f497894c7d2b5f68b6a55e6-dirty
author jjohnson
date Wed, 25 Jul 2018 10:58:17 -0400
parents 4e23dcad9087
children c9bfe6adb7cd
line wrap: on
line source

<tool id="spectrast_import" name="SpectraST Import" version="@VERSION@.0">
    <description>Spectral Library from ms2, msp, or hlf</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        ## Symlink dataset to name with recognized ext
        #import re
        #set $ext = '.' + str($input.extension)
        #set $input_name = $re.sub('[.](ms2|msp|hlf)$','',$input.display_name.split('/')[-1]) + $ext
        ln -s '$input' '$input_name' &&
        mkdir -p libdir &&
        spectrast -cN'libdir/library' '$input_name' | tee '$output' &&
        mkdir -p '$output.files_path' &&
        for i in library.splib library.sptxt library.spidx library.pepidx; do if [ -e outdir/${i} ]; then cp -p outdir/${i} '$output.files_path'; fi; done
    ]]></command>
    <inputs>
        <param name="input" type="data" format="ms2,msp,hlf" label="Spectral library ms2, msp, or hlf" 
             help="BiblioSpec .ms2,  NIST .msp,  or X!Hunter .hlf"/>
        <param name="bin" type="boolean" truevalue="" falsevalue="-c_BIN!" checked="true" 
            label="Write library in binary format, which enables quicker search."/>
    </inputs>
    <outputs>
        <data name="output" format="splib"/>
    </outputs>
    <tests>
        <test>
            <param name="input" ftype="ms2" value="test.ms2"/>
            <output name="output">
                <assert_contents>
                    <has_text_matching expression="Total number of spectra in library: 1" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Imports a spectral library from the following formats:

    NIST (National Institute of Standards and Technology)'s .msp format 
    X!Hunter's .hlf format 
    BiblioSpec's .ms2 format 

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