view hicup_hicup.xml @ 3:246aed60d62f draft

planemo upload for repository https://github.com/joachimwolff/galaxytools/tree/hicup/tools/hicup commit e6a9507eb198c6bf2c63ddae387c262bfc8dbd16
author bgruening
date Thu, 09 Nov 2017 11:16:16 -0500
parents e96cb39c3f8e
children bd1594d55a38
line wrap: on
line source

<tool id="hicup_hicup" name="Hicup Pipeline" version="@VERSION@.0">
    <description>controls the other programs in the HiCUP pipeline.</description>
    <macros>
        <import>hicup_macros.xml</import>
    </macros>
    <expand macro="requirements_hicup" />
    <expand macro="stdio" />

    <command><![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 &&
            #set index_path = 'genome'
        #else:
            #set index_path = $reference_genome.index.fields.path
        #end if
        hicup_digester --re1 '$re1' --genome '$genome'
        #if $advanced_options.re2:
            --re2 '$advanced_options.re2'
        #end if
        #for $file in $input_files_digest:
            $file
        #end for
        && mv *Digest_* digest_file.txt
        && hicup 
        --digest digest_file.txt
        --index '$index_path'
        --bowtie2 \$BOWTIE_PATH_BASH
        $advanced_options.nofill --keep
        
        #if $advanced_options.longest:
            --longest '$advanced_options.longest'
        #end if

        #if $advanced_options.shortest:
            --shortest '$advanced_options.shortest'
        #end if
        
        $input_first_sequence $input_second_sequence
       
        ## process truncater files
        && ls -la
       
        && mv hicup_truncater_summary_* hicup_truncater_summary.txt
        && trunc_result_1=\$(echo '$input_first_sequence' | rev | cut -d'/' -f1 | rev)
        && mv \$trunc_result_1.truncation_barchart.svg dataset1.truncation_barchart.svg
        && mv \$trunc_result_1.trunc.fastq dataset1.trunc.fastq
        && trunc_result_2=\$(echo '$input_second_sequence' | rev | cut -d'/' -f1 | rev)
        && mv \$trunc_result_2.truncation_barchart.svg dataset2.truncation_barchart.svg
        && mv \$trunc_result_2.trunc.fastq dataset2.trunc.fastq

        && echo \$trunc_result_1
        && echo \$trunc_result_2
        
        ## process mapper
        && mv hicup_mapper_summary* hicup_mapper_summary.txt
        && mv *.pair.sam result.pair.sam
        
        && mv \$trunc_result_1.trunc.fastq.mapper_barchart.svg dataset1.mapper_barchart.svg
        && mv \$trunc_result_2.trunc.fastq.mapper_barchart.svg dataset2.mapper_barchart.svg
        

        ## process filter
        && mv hicup_filter_ditag_rejects* hicup_filter_ditag_rejects
        && ls -la hicup_filter_ditag_rejects/
        && mv *filt.sam dataset.filt.sam
        && mv hicup_filter_summary* hicup_filter_summary.txt
        && mv hicup_filter_ditag_rejects/*contiguous.filter.sam hicup_filter_ditag_rejects/dataset.contiguous.filter.sam
        && mv hicup_filter_ditag_rejects/*re_ligation.filter.sam  hicup_filter_ditag_rejects/dataset.re_ligation.filter.sam 
        && mv hicup_filter_ditag_rejects/*same_dangling_ends.filter.sam hicup_filter_ditag_rejects/dataset.same_dangling_ends.filter.sam
        && mv hicup_filter_ditag_rejects/*invalid.filter.sam hicup_filter_ditag_rejects/dataset.invalid.filter.sam 
        && mv hicup_filter_ditag_rejects/*same_circularised.filter.sam hicup_filter_ditag_rejects/dataset.same_circularised.filter.sam
        && mv hicup_filter_ditag_rejects/*same_internal.filter.sam hicup_filter_ditag_rejects/dataset.same_internal.filter.sam
        #if $advanced_options.longest or $advanced_options.shortest: 
            && mv hicup_filter_ditag_rejects/*wrong_size.filter.sam hicup_filter_ditag_rejects/dataset.wrong_size.filter.sam
        #end if
        && mv *pair.sam.filter_piechart.svg filter_piechart.svg

        ## deduplicator
        && mv *filt.sam.deduplicator_cis_trans_piechart.svg deduplicator_cis_trans_piechart.svg
        && mv *filt.sam.deduplicator_uniques_barchart.svg deduplicator_uniques_barchart.svg
        && mv hicup_deduplicator_summary*.txt hicup_deduplicator_summary.txt
       
        ## process general output of hicup
        && mv *.hicup.* dataset.hicup
        && mv *.html results.html
        && mv HiCUP_summary_report*.txt HiCUP_summary_report.txt
        && ls -la
        && ls -la hicup_filter_ditag_rejects/
    ]]></command>
    <inputs>
        <expand macro="input_files" />
        <expand macro="digester_input" />
        <expand macro="re1" />
        <expand macro="reference_genome_macro" />
        <section name="advanced_options" title="Advanced options">
            <expand macro="re2" />
            <expand macro="filter_longest_shortest" />
            <expand macro="no_fill" />
        </section>
    </inputs>
    <outputs>
        <!-- Regular output of hicup -->
        <data name="hicup_results" format="html" from_work_dir="results.html" label="HiCUP results"/>
        <data name="hicup_report" format="txt" from_work_dir="HiCUP_summary_report.txt" label="HiCUP report" />
        <data name="dataset_hicup" format="bam,sam" from_work_dir="dataset.hicup" label="HiCUP data result"/>

        <collection name="intermediate_results" label="HiCUP intermediate results" type="list">
            <!-- Output of the truncater step -->
            <expand macro="truncater_output" />
            <!-- Output of the mapper step -->
            <expand macro="mapper_output" />
            <!-- Output of the filter step -->
            <expand macro="filter_output" />
            <!-- Output of the deduplicator step -->
            <expand macro="deduplicator_output" />
        </collection>
    </outputs>
    <tests>
         <test>
            <!-- inputs -->
            <param name="input_first_sequence" value="dataset1.fastq" ftype="fastq"/>
            <param name="input_second_sequence" value="dataset2.fastq" ftype="fastq"/>
            <param name="re1" value="A^AGCTT"/>
            <param name="input_files_digest" value="chr1.fa"/>
            <param name="genome" value="human"/>
            <conditional name="reference_genome">
                <param name="source" value="history" />
                <param name="own_file" value="chr1.fa"/>
            </conditional>

            <!-- outputs -->
            <output name="hicup_results" file="results.html" ftype="html" lines_diff="10000"/>
            <output name="dataset_hicup" file="dataset.hicup.sam" lines_diff="10" />
            <output name="hicup_report" file="HiCUP_summary_report.txt" lines_diff="2"/>
            
            <output_collection name="intermediate_results">
                <!-- truncater step-->
                <element name="hicup_truncater_summary" file="hicup_truncater_summary.txt" lines_diff="8"/>
                <element name="dataset1_trunc" file="dataset1.trunc.fastq" lines_diff="8" />
                <element name="dataset2_trunc" file="dataset2.trunc.fastq" lines_diff="8"/>
                <element name="dataset1_truncater_barchart" file="dataset1.truncation_barchart.svg" ftype="svg" lines_diff="1000" />
                <element name="dataset2_truncater_barchart" file="dataset2.truncation_barchart.svg" ftype="svg" lines_diff="1000" />
                
                <!-- mapper step -->
                <element name="hicup_mapper_summary" file="hicup_mapper_summary.txt" lines_diff="4"/>
                <element name="result_pair" file="result.pair.sam" lines_diff="8"/>
                <element name="dataset1_mapper_barchart" file="dataset1.mapper_barchart.svg" ftype="svg" lines_diff="1000"/>
                <element name="dataset2_mapper_barchart" file="dataset2.mapper_barchart.svg" ftype="svg" lines_diff="1000"/>
    
                <!-- filter step-->
                <element name="hicup_filter_summary" file="hicup_filter_summary.txt" lines_diff="12"/>
                <element name="dataset_filt" file="dataset.filt.sam" lines_diff="8" />
                <element name="contiguous_filter" file="dataset.contiguous.filter.sam" lines_diff="8" />
                <element name="re_ligation_filter" file="dataset.re_ligation.filter.sam" lines_diff="8" />
                <element name="same_dangling_ends_filter" file="dataset.same_dangling_ends.filter.sam" lines_diff="8" />
                <element name="invalid_filter" file="dataset.invalid.filter.sam"  lines_diff="8" />
                <element name="same_circularised_filter" file="dataset.same_circularised.filter.sam" lines_diff="8" />
                <element name="same_internal_filter" file="dataset.same_internal.filter.sam" lines_diff="8" />
                <element name="filter_piechart" file="filter_piechart.svg" ftype="svg" lines_diff="1000" />

                <!-- deduplicator step-->
                <element name="cis_trans_piechart" file="deduplicator_cis_trans_piechart.svg" ftype="svg" lines_diff="1000"/>
                <element name="uniques_barchart" file="deduplicator_uniques_barchart.svg" ftype="svg" lines_diff="1000"/>
                <element name="hicup_deduplicator_summary" file="hicup_deduplicator_summary.txt" lines_diff="2"/>
            </output_collection>
        </test>
    </tests>
    <help><![CDATA[

    For help please consult the documentation of HiCUP: http://www.bioinformatics.babraham.ac.uk/projects/hicup/overview/

    To get more information about the pipeline visit: http://www.bioinformatics.babraham.ac.uk/projects/hicup/scripts_description/#HiCUP
    ]]></help>
    <expand macro="citation_hicup" />
</tool>