diff hicup_mapper.xml @ 4:99dd0efa992b draft

planemo upload for repository https://github.com/joachimwolff/galaxytools/tree/hicup/tools/hicup commit 22eec1b3b20b788e762837c02488f332f831fab3
author bgruening
date Fri, 25 May 2018 17:48:10 -0400
parents 320a2d826a00
children 396e8c4ebfee
line wrap: on
line diff
--- a/hicup_mapper.xml	Thu Nov 09 11:16:29 2017 -0500
+++ b/hicup_mapper.xml	Fri May 25 17:48:10 2018 -0400
@@ -4,55 +4,66 @@
         <import>hicup_macros.xml</import>
     </macros>
     <expand macro="requirements_hicup" />
-    <expand macro="stdio" />
-
-    <command><![CDATA[
+    <command detect_errors="exit_code"><![CDATA[
         BOWTIE_PATH_BASH="\$(which bowtie2)" &&
         #set index_path = ''
         #if str($reference_genome.source) == "history":
-           bowtie2-build "$reference_genome.own_file" genome &&
-           ln -s "$reference_genome.own_file" genome.fa &&
+           bowtie2-build '$reference_genome.own_file' genome &&
+           ln -s '$reference_genome.own_file' genome.fa &&
            #set index_path = 'genome'
         #else:
            #set index_path = $reference_genome.index.fields.path
         #end if
-        hicup_mapper
-        --index '$index_path' 
-        --bowtie2 \$BOWTIE_PATH_BASH
 
-        $input_first_sequence $input_second_sequence
+        ##Dealing with fastq and fastq.gz
+        #if $input_first_sequence.is_of_type("fastq.gz", "fastqsanger.gz"):
+           ln -s $input_first_sequence dataset1.gz &&
+           #set input1='dataset1.gz'
+        #else
+           ln -s $input_first_sequence dataset1 &&
+           #set input1='dataset1'
+        #end if
 
-        ## output handling
-        && mv hicup_mapper_summary* hicup_mapper_summary.txt
-        && mv *.pair.sam result.pair.sam
-        && trunc_result_1=\$(echo '$input_first_sequence' | rev | cut -d'/' -f1 | rev)
-        && trunc_result_2=\$(echo '$input_second_sequence' | rev | cut -d'/' -f1 | rev)
-        && mv \$trunc_result_1*.mapper_barchart.svg dataset1.mapper_barchart.svg
-        && mv \$trunc_result_2*.mapper_barchart.svg dataset2.mapper_barchart.svg
-        && echo \$trunc_result_1.mapper_barchart.svg
-        && echo \$trunc_result_2.mapper_barchart.svg
+        #if $input_second_sequence.is_of_type("fastq.gz", "fastqsanger.gz"):
+           ln -s $input_second_sequence dataset2.gz &&
+           #set input2='dataset2.gz'
+        #else
+           ln -s $input_second_sequence dataset2 &&
+           #set input2='dataset2'
+        #end if
+
+
+        hicup_mapper
+            --zip
+            --threads \${GALAXY_SLOTS:-1}
+            --index '$index_path'
+            --bowtie2 \$BOWTIE_PATH_BASH
+            $input1
+            $input2
+
     ]]></command>
     <inputs>
         <expand macro="input_files" />
         <expand macro="reference_genome_macro" />
     </inputs>
     <outputs>
-        <expand macro="mapper_output" />
+        <data name="hicup_mapper_summary" format="txt" from_work_dir="hicup_mapper_summary*" label="hicup_mapper_summary.txt"/>
+        <data name="result_pair" format="qname_sorted.bam" from_work_dir="*pair.bam" label="pair.bam"/>
+        <data name="dataset1_mapper_barchart" format="svg" from_work_dir="dataset1*.mapper_barchart.svg" label="Mapper Dataset1 Barchart.svg" />
+        <data name="dataset2_mapper_barchart" format="svg" from_work_dir="dataset2*.mapper_barchart.svg" label="Mapper Dataset2 Barchart.svg" />
     </outputs>
      <tests>
         <test>
-            <param name="input_first_sequence" value="dataset1.trunc.fastq" ftype="fastq"/>
-            <param name="input_second_sequence" value="dataset2.trunc.fastq" ftype="fastq"/>
-            
+            <param name="input_first_sequence" value="dataset1.trunc.fastq.gz" ftype="fastq.gz"/>
+            <param name="input_second_sequence" value="dataset2.trunc.fastq.gz" ftype="fastq.gz"/>
             <conditional name="reference_genome">
                 <param name="source" value="history" />
-                <param name="own_file" value="chr1.fa"/>
+                <param name="own_file" value="chr21And22FromHg38.fasta"/>
             </conditional>
             <output name="hicup_mapper_summary" file="hicup_mapper_summary.txt" lines_diff="4"/>
-            <output name="result_pair" file="result.pair.sam" lines_diff="8"/>
+            <output name="result_pair" file="dataset1_2.pair.bam" lines_diff="8" ftype="qname_sorted.bam" />
             <output name="dataset1_mapper_barchart" file="dataset1.mapper_barchart.svg" ftype="svg" lines_diff="1000"/>
             <output name="dataset2_mapper_barchart" file="dataset2.mapper_barchart.svg" ftype="svg" lines_diff="1000"/>
-  
         </test>
     </tests>
     <help><![CDATA[