Skip to content

Commit

Permalink
Update diann (#729)
Browse files Browse the repository at this point in the history
* Raise version

* Add option to load multiple FASTA files

* Add new test for multi-fasta

* Fix report.tsv not found when only speclib is generated

* Update test with speclib outputs

* Add speclib files to output

* Fix test and add test-data

* Fix for diann in docker

* Test datatype issue

* Test datatype

* Test datatype issue

* Test datatype issue

* Test datatype issue

* Test datatype issue
  • Loading branch information
npinter authored Oct 2, 2023
1 parent 42e5dfe commit c2518a1
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
46 changes: 40 additions & 6 deletions tools/diann/diann.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<description>is a software for DIA/SWATH data processing</description>
<macros>
<token name="@TOOL_VERSION@">1.8.1</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@VERSION_SUFFIX@">1</token>
</macros>
<requirements>
<container type="docker">biocontainers/diann:v@TOOL_VERSION@_cv1</container>
Expand All @@ -24,8 +24,13 @@
#end if
#end for
#set $fasta_file_str = ''
#for $fasta_file in $input.fasta_db_options.fasta
#set $fasta_file_str += '--fasta ' + str($fasta_file) + ' '
#end for
diann
#if len($input.f) > 0
#if $input.f != 'None'
'$infiles_str'
#end if
--dir ./
Expand All @@ -34,7 +39,9 @@
#else
--lib
#end if
#if $input.f != 'None'
--out ./report.tsv
#end if
#if $input.spectral_lib_options.gen_spec_lib
--out-lib ./report-lib.tsv
#end if
Expand All @@ -58,7 +65,9 @@
#end if
## FASTA database options
--fasta '$input.fasta_db_options.fasta'
#if $fasta_file_str != 'None'
'$fasta_file_str'
#end if
#if $input.fasta_db_options.fasta_filter
--fasta-filter '$input.fasta_db_options.fasta_filter'
#end if
Expand Down Expand Up @@ -218,6 +227,8 @@
#if $input.spectral_lib_options.gen_spec_lib
&& cp ./report-lib.tsv '$output_report_lib'
&& cp ./report-lib.tsv.speclib '$output_report_speclib'
&& cp ./report-lib.predicted.speclib '$output_report_pred_speclib'
#end if
]]></command>
<inputs>
Expand All @@ -238,7 +249,7 @@
</section>
<section name="fasta_db_options" title="FASTA database">
<!-- ToDo fasta: use multiple fasta commands to specify multiple databases -->
<param name="fasta" type="data" format="fasta" label="Sequence database" help="Specify a sequence database in FASTA format"/>
<param name="fasta" type="data" format="fasta" multiple="true" label="Sequence database" help="Specify a sequence database in FASTA format"/>
<param name="fasta_filter" type="data" format="txt" optional="true" label="Fasta filter" help="Only consider peptides matching the stripped sequences specified in the text file provided, when processing a sequence database"/>
<param name="fasta_search" type="boolean" truevalue="--fasta-search" falsevalue="" checked="false" label="Perform in silico digest of the sequence database" help="Instructs DIA-NN to perform an in silico digest of the sequence database"/>
</section>
Expand Down Expand Up @@ -399,15 +410,21 @@
</inputs>
<outputs>
<data format="tabular" name="output_report" label="${tool.name} on ${on_string}: report.tsv">
<filter>len(input['f']) > 0</filter>
<filter>input['f'] != None</filter>
</data>
<data format="tabular" name="output_report_lib" label="${tool.name} on ${on_string}: report-lib.tsv">
<filter>input['spectral_lib_options']['gen_spec_lib'] == True</filter>
</data>
<data format="data" name="output_report_speclib" label="${tool.name} on ${on_string}: report-lib.tsv.speclib">
<filter>input['spectral_lib_options']['gen_spec_lib'] == True</filter>
</data>
<data format="data" name="output_report_pred_speclib" label="${tool.name} on ${on_string}: report-lib.predicted.speclib">
<filter>input['spectral_lib_options']['gen_spec_lib'] == True</filter>
</data>
</outputs>
<tests>
<!-- test for default run -->
<test expect_num_outputs="2">
<test expect_num_outputs="4">
<section name="input">
<param name="f" value="small-peakpicking-cwt-allMS.mzML" />
<section name="spectral_lib_options">
Expand All @@ -429,6 +446,23 @@
<has_text text="PrecursorMz"/>
</assert_contents>
</output>
<output name="output_report_speclib" file="report-lib.tsv.speclib" compare="sim_size" delta="100"/>
<output name="output_report_pred_speclib" file="report-lib.predicted.speclib" compare="sim_size" delta="100"/>
</test>
<!-- test for multiple fastas -->
<test expect_num_outputs="1">
<section name="input">
<param name="f" value="small-peakpicking-cwt-allMS.mzML" />
<section name="fasta_db_options">
<param name="fasta" value="bsa.fasta,bsa2.fasta"/>
<param name="fasta_search" value="True"/>
</section>
</section>
<output name="output_report" file="report.tsv">
<assert_contents>
<has_text text="PG.Normalised"/>
</assert_contents>
</output>
</test>
<!-- test for Bruker data -->
<!-- <test expect_num_outputs="2">-->
Expand Down
7 changes: 7 additions & 0 deletions tools/diann/test-data/bsa2.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
>bsa_test sp|P02769|ALBU_BOVIN_TEST Serum albumin OS=Bos taurus OX=9913 GN=ALB PE=1 SV=4
MKWVTFISLLLLFSSAYSRGVFRRDTHKSEIAHRFKDLGEEHFKGLVLIAFSQYLQQCPF
DEHVKLVNELTEFAEDKDVCKNYQEAKDAFLGSFLYEYSRRHLVDEPQNLIKQNCDQFEK
HPEYAVSVLLRLAKEYEATLEECCAKDDPHACYSTVFDKLKHLVDEPQNLIKQNCDQFEK
LGEYGFQNALIVRYTRKVPQVSTPTLVEVSRSLGKVGTRCCTKPESERMPCTEDYLSLIL
NRLCVLHEKTPVSEKVTDTEKQIKKQTALVELLKHKPKATEEQLKTVMENFVAFVDKCCA
STQTALA
Binary file not shown.
Binary file added tools/diann/test-data/report-lib.tsv.speclib
Binary file not shown.

0 comments on commit c2518a1

Please sign in to comment.