view hicup2juicer.xml @ 1:b4e7244246e2 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/hicup commit 398a2e3e845ada656b3a7e0a6542e1668a8bcf17
author bgruening
date Thu, 23 Feb 2023 18:05:02 +0000
parents f8cb84c49623
children
line wrap: on
line source

<tool id="hicup2juicer" name="Hicup to juicer converter" version="@VERSION@+galaxy0">
    <description></description>
    <macros>
        <import>hicup_macros.xml</import>
    </macros>
    <expand macro="requirements_hicup" />
    <command detect_errors="exit_code"><![CDATA[
        #if $input_file.ext != 'sam':
            #set ext='bam'
        #else:
            #set ext='sam'
        #end if
        ln -s '$input_file' input.$ext &&
        hicup2juicer
        #if str($digester.provide_digester) == 'yes':
            --digest '${digester.digester_file}'
            '${digester.usemid}'
        #end if
        input.$ext
    ]]>
    </command>
    <inputs>
        <param name="input_file" type="data" format="qname_sorted.bam,sam" label="Output of HiCUP to convert" />
        <conditional name="digester">
            <param name="provide_digester" type="select" label="Provide digester file" help="With digester file you have correct fragment id and can use option -usemid">
                <option value="yes">Yes</option>
                <option value="no">No</option>
            </param>
            <when value="yes">
                <param name="digester_file" type="data" format="tabular" label="Digester file: Output of HiCUP Digester" />
                <param argument="--usemid" type="boolean" truevalue="--usemid" falsevalue="" checked="false" label="Use middle of fragments instead of 5' of reads" />                
            </when>
            <when value="no"/>
        </conditional>
    </inputs>
    <outputs>
        <data name="output" format="tabular" label="${tool.name} on ${on_string}: Pairs in juicebox format" from_work_dir="*.prejuicer" />
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_file" value="dataset1_2.hicup.bam"/>
            <conditional name="digester">
                <param name="provide_digester" value="no"/>
            </conditional>
            <output name="output" value="dataset1_2.hicup.bam.prejuicer1"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_file" value="dataset1_2.hicup.bam"/>
            <conditional name="digester">
                <param name="provide_digester" value="yes"/>
                <param name="digester_file" value="digest_file.txt" ftype="tabular"/>
                <param name="usemid" value="true"/>
            </conditional>
            <output name="output" value="dataset1_2.hicup.bam.prejuicer2"/>
        </test>
    </tests>
    <help><![CDATA[

HiCUP homepage: www.bioinformatics.babraham.ac.uk/projects/hicup

The hicup2juicer script converts HiCUP BAM/SAM files to a format compatible 
with Juicer and JuiceBox( https://github.com/aidenlab/juicer ).
Outputfiles generated by this script may be converted to Juicer ".hic" files 
using the "pre" command as described at: https://github.com/aidenlab/juicer/wiki/Pre

The script does not use restriction site coordinates when generating output.

FUNCTION

HiCUP generates SAM/BAM files of mapped, filtered paired-end reads 
constituting the sequenced valid Hi-C di-tags. These may then be analysed by a 
variety of specialised tools, but before this is possible the datasets will 
need parsing into an appropriate format.

The hicup2juicer script converts HiCUP BAM/SAM files to a tab-delimited format 
comprising 7 columns, with read pairs on the same line:

<readname> <str1> <chr1> <pos1> <frag1> <str2> <chr2> <pos2> <frag2> <mapq1> <mapq2>
str = strand (0 for forward, anything else for reverse)
chr = chromosome (must be a chromosome in the genome)
pos = position
frag = restriction site fragment
mapq = mapping quality score

Column1: Readpair index number (starting at 1)
Column2: forward read strand (0 = positive strand, 1 = negative strand)
Column3: forward read chromosome name
Column4: forward read position
Column5: forward read fragment id (set to the dummy value 0)
Column6: reverse read strand (0 = positive strand, 1 = negative strand)
Column7: reverse read chromosome name
Column8: reverse read position
Column9: reverse read fragment id (set to the dummy value 1)
Column10: forward read MAPQ score
Column11: reverse read MAPQ score


COMMAND LINE OPTIONS

--help         Print help message and exit
--version      Print the program version and exit
--zip          Write output to a gzip file

Full instructions on running the pipeline can be found at:
www.bioinformatics.babraham.ac.uk/projects/hicup

Steven Wingett, Babraham Institute, Cambridge, UK
]]>
    </help>
    <expand macro="citation_hicup" />
</tool>