boolean type param (for an input tickbox) does not work correctly
Hello The boolean widget in the following tool config always works as if not ticked while the select drop-down box in the same situation (teh commented out xml) works ok. What's wrong with my tickbox? <tool id="bam_to_fastq" name="BAM-to-FASTQ" version="1.0.0"> <requirements> <requirement type="package">picard</requirement> </requirements> <description>converts BAM format to FASTQ format</description> <command> java -jar ${GALAXY_DATA_INDEX_DIR}/shared/jars/SamToFastq.jar VALIDATION_STRINGENCY=SILENT QUIET=true INPUT=$bam_in FASTQ=$fastq1_out #if $sPaired == "paired": SECOND_END_FASTQ=$fastq2_out #end if </command> <inputs> <param name="sPaired" type="boolean" truevalue="paired" falsevalue="single" checked="yes" label="Reads are paired" /> <!--<param name="sPaired" type="select" label="Is this library mate-paired?"> <option value="single">Single-end</option> <option value="paired">Paired-end</option> </param>--> <param name="bam_in" type="data" format="bam" label="BAM File to Convert" /> </inputs> <outputs> <data name="fastq1_out" format="fastqsanger" /> <data name="fastq2_out" format="fastqsanger" > <filter>sPaired == "paired"</filter> </data> </outputs> <tests> </tests> <help> </help> </tool> Regards Marina Gourtovaia -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
On Wed, Dec 15, 2010 at 5:15 PM, Marina Gourtovaia <mg8@sanger.ac.uk> wrote:
Hello
The boolean widget in the following tool config always works as if not ticked while the select drop-down box in the same situation (teh commented out xml) works ok. What's wrong with my tickbox?
<tool id="bam_to_fastq" name="BAM-to-FASTQ" version="1.0.0"> <requirements> <requirement type="package">picard</requirement> </requirements> <description>converts BAM format to FASTQ format</description> <command> java -jar ${GALAXY_DATA_INDEX_DIR}/shared/jars/SamToFastq.jar VALIDATION_STRINGENCY=SILENT QUIET=true INPUT=$bam_in FASTQ=$fastq1_out #if $sPaired == "paired": SECOND_END_FASTQ=$fastq2_out #end if </command>
Just a guess, but have you tried this - based on similar issues I had writing the NCBI BLAST+ wrappers: #if str($sPaired) == "paired": SECOND_END_FASTQ=$fastq2_out #end if The sPaired object isn't actually a string, its a proxy object with the __str__ method defined. Peter
On 15/12/2010 17:23, Peter wrote:
On Wed, Dec 15, 2010 at 5:15 PM, Marina Gourtovaia<mg8@sanger.ac.uk> wrote:
Hello
The boolean widget in the following tool config always works as if not ticked while the select drop-down box in the same situation (teh commented out xml) works ok. What's wrong with my tickbox?
<tool id="bam_to_fastq" name="BAM-to-FASTQ" version="1.0.0"> <requirements> <requirement type="package">picard</requirement> </requirements> <description>converts BAM format to FASTQ format</description> <command> java -jar ${GALAXY_DATA_INDEX_DIR}/shared/jars/SamToFastq.jar VALIDATION_STRINGENCY=SILENT QUIET=true INPUT=$bam_in FASTQ=$fastq1_out #if $sPaired == "paired": SECOND_END_FASTQ=$fastq2_out #end if </command> Just a guess, but have you tried this - based on similar issues I had writing the NCBI BLAST+ wrappers:
#if str($sPaired) == "paired": SECOND_END_FASTQ=$fastq2_out #end if
The sPaired object isn't actually a string, its a proxy object with the __str__ method defined.
Peter
Thanks a lot for the tip, Peter. Also, had to use a different filter expression (sPaired is True) BTW, I am making a wrapper around Picard http://picard.sourceforge.net/command-line-overview.shtml#Overview. Is there enough interest to this to submit this to the core Galaxy? In Sanger, our Illumina pipeline end up with BAM files, so the end users need a BAM-FASTQ converter, hence this binding I am making Marina Gourtovaia -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
On Thu, Dec 16, 2010 at 1:48 PM, Marina Gourtovaia <mg8@sanger.ac.uk> wrote:
Thanks a lot for the tip, Peter. Also, had to use a different filter expression (sPaired is True)
Great.
BTW, I am making a wrapper around Picard http://picard.sourceforge.net/command-line-overview.shtml#Overview. Is there enough interest to this to submit this to the core Galaxy? In Sanger, our Illumina pipeline end up with BAM files, so the end users need a BAM-FASTQ converter, hence this binding I am making
I'm sure a Picard wrapper would be useful. For this particular case, BAM to unaligned FASTQ you may have other options. I'd take a look at pysam, the Python wrapper for the samtools C API if I were you, but then I don't speak Java ;) Also EMBOSS has some BAM support nowadays, and I've got some experimental code on a Biopython branch which was partly written for recovering unaligned paired end FASTQ files from BAM in order to remap them to a different reference. Peter
Marina: Yes, these would be very useful. PLease consider committing them to Galaxy Tool Shed at http://usegalaxy.org/community Thanks! anton
BTW, I am making a wrapper around Picard http://picard.sourceforge.net/command-line-overview.shtml#Overview. Is there enough interest to this to submit this to the core Galaxy? In Sanger, our Illumina pipeline end up with BAM files, so the end users need a BAM-FASTQ converter, hence this binding I am making
Anton Nekrutenko http://usegalaxy.org
participants (3)
-
Anton Nekrutenko
-
Marina Gourtovaia
-
Peter