Repository revision
19:86e2413cf3f8

Repository 'macs2'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/macs2

MACS2 callpeak tool metadata
Miscellaneous
Call peaks from alignment results
macs2_callpeak
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.2.9.1+galaxy0
2.2.9.1+galaxy0
macs2 --version
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.2.9.1+galaxy0 (this tool)
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.2.7.1+galaxy0
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.1.20160309.6
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.1.20160309.5
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.1.20160309.4
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.1.20160309.3
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.1.20160309.2
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.1.20160309.1
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.1.20160309.0
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.0.20151222.0
toolshed.g2.bx.psu.edu/repos/iuc/macs2/macs2_callpeak/2.1.0.20140616.0
macs2_callpeak
Requirements (dependencies defined in the <requirements> tag set)
name version type
macs2 2.2.9.1 package
r-base 4.3 package
Additional information about this tool
#import re

        
        export PYTHON_EGG_CACHE=`pwd` &&
    
        #set $temp_stderr = 'macs2_stderr'

        (macs2 callpeak

            ## Treatment File(s)

            #if str($treatment.t_multi_select) == "Yes":
                -t ${ ' '.join( [ "'%s'" %  $x for $x in $treatment.input_treatment_file] ) }
                #set identifier = re.sub('[^\w\-]', '_', str($treatment.input_treatment_file[0].element_identifier))
            #else
                -t '$treatment.input_treatment_file'
                #set identifier = re.sub('[^\w\-]', '_', str($treatment.input_treatment_file.element_identifier))
            #end if

            --name $identifier

            ## Control File(s)

            #if str($control.c_select) == "Yes":
                #if str($control.c_multiple.c_multi_select) == "Yes":
                    -c ${ ' '.join( [ "'%s'" %  $x for $x in $control.c_multiple.input_control_file] ) }
                #else
                    -c '$control.c_multiple.input_control_file'
                #end if
            #end if

            --format $format

        
        #if $effective_genome_size_options.effective_genome_size_options_selector == "user_defined":
            --gsize '${ effective_genome_size_options.gsize }'
        #else:
            --gsize '${ effective_genome_size_options.effective_genome_size_options_selector }'
        #end if
    

        ## advanced options

        $advanced_options.nolambda
        $advanced_options.to_large
        $advanced_options.spmr

        #if $advanced_options.ratio:
            --ratio $advanced_options.ratio
        #end if

        #if $advanced_options.slocal:
            --slocal $advanced_options.slocal
        #end if

        #if $advanced_options.llocal:
            --llocal $advanced_options.llocal
        #end if

        #if $advanced_options.broad_options.broad_options_selector == "broad":
            --broad
            --broad-cutoff='${ advanced_options.broad_options.broad_cutoff }'
        #else
            $advanced_options.broad_options.call_summits
        #end if

        #if str( $advanced_options.keep_dup_options.keep_dup_options_selector ) == "user":
            --keep-dup '${ advanced_options.keep_dup_options.user_keepdup }'
        #else
            --keep-dup '${ advanced_options.keep_dup_options.keep_dup_options_selector }'
        #end if

        --d-min $advanced_options.d_min
        --buffer-size $advanced_options.buffer_size

        ## With --bdg two additional output files will be generated.
        #if "bdg" in str($outputs).split(','):
            --bdg
        #end if

        ## cutoff selection
        #if str( $cutoff_options.cutoff_options_selector ) == "qvalue":
            --qvalue '${ cutoff_options.qvalue }'
        #elif str( $cutoff_options.cutoff_options_selector ) == "pvalue":
            #if str($cutoff_options.pvalue).strip() != "":
                --pvalue '${ cutoff_options.pvalue }'
            #end if
        #end if

        ## model options
        #if $nomodel_type.nomodel_type_selector == "nomodel":
            --nomodel
            --extsize '${ nomodel_type.extsize }'
            --shift '${ nomodel_type.shift}'
        #else
            --mfold '${nomodel_type.mfold_lower}' '${nomodel_type.mfold_upper}'

            #if $nomodel_type.band_width:
            --bw '${nomodel_type.band_width}'
            #end if
        #end if

        2>&1 > $temp_stderr)
        #if "peaks_tabular" in str($outputs).split(','):
            &&
            cp ${identifier}_peaks.xls '${ output_tabular }'
        #end if

        ## run R to create pdf from model script
        #if $nomodel_type.nomodel_type_selector == "create_model" and "pdf" in str($outputs).split(',') and $format != "BAMPE":
            &&
            Rscript ${identifier}_model.r > ${identifier}_model.r.log
        #end if

        #if 'html' in str($outputs).split(','):
            ## if output files exists, move them to the files_path and create a html result page linking to them
            &&
            (
            count=`ls -1 ${identifier}* 2>/dev/null | wc -l`;
            if [ \$count != 0 ];
            then
                mkdir '${ output_extra_files.files_path }' &&
                cp -r ${identifier}* '${ output_extra_files.files_path }' &&
                python '$__tool_directory__/dir2html.py'
                    '${ output_extra_files.files_path }' $temp_stderr > '${ output_extra_files }';
            fi;
            )
        #end if
        &&
        exit_code_for_galaxy=\$? &&
        cat $temp_stderr 2>&1 &&
        (exit \$exit_code_for_galaxy)
    
None
False
Functional tests
name inputs outputs required files
Test-1 treatment|input_treatment_file: ChIP_200K.bed
control|c_multiple|input_control_file: Control_200K.bed
control|c_select: Yes
format: BED
effective_genome_size_options|gsize: 3300000000
effective_genome_size_options|effective_genome_size_options_selector: user_defined
cutoff_options|qvalue: 0.05
cutoff_options|cutoff_options_selector: qvalue
outputs: ['peaks_tabular', 'bdg', 'html']
name: value
name: value
name: value
name: value
ChIP_200K.bed
Control_200K.bed
value
Test-2 treatment|input_treatment_file: ChIP_200K.bed
control|c_multiple|input_control_file: Control_200K.bed
control|c_select: Yes
format: BED
effective_genome_size_options|gsize: 3300000000
effective_genome_size_options|effective_genome_size_options_selector: user_defined
cutoff_options|qvalue: 0.05
cutoff_options|cutoff_options_selector: qvalue
outputs: pdf
name: value
ChIP_200K.bed
Control_200K.bed
value
Test-3 treatment|input_treatment_file: bwa-mem-test1.bam
format: BAMPE
effective_genome_size_options|gsize: 3300000000
effective_genome_size_options|effective_genome_size_options_selector: user_defined
nomodel_type|nomodel_type_selector: nomodel
outputs: pdf
advanced_options|nolambda: True
name: value
bwa-mem-test1.bam
value