These are chat archives for nextflow-io/nextflow

30th
Sep 2017
Venkat Malladi
@vsmalladi
Sep 30 2017 21:34
is there a way to get the process name as a variable to make the publishDir
Ashley S Doane
@DoaneAS
Sep 30 2017 22:53
@ewels wonder if you could briefly explain or point to reference for why the when: REF_macs works in your chipseq pipeline.
/*
 * STEP 9 MACS
 */

process macs {
    tag "${bam_for_macs[0].baseName}"
    publishDir "${params.outdir}/macs", mode: 'copy'

    input:
    file bam_for_macs from bam_dedup_macs.collect()
    file bai_for_macs from bai_dedup_macs.collect()
    set chip_sample_id, ctrl_sample_id, analysis_id from macs_para

    output:
    file '*.{bed,xls,r,narrowPeak}' into macs_results

    when: REF_macs

    script:
    def ctrl = ctrl_sample_id == '' ? '' : "-c ${ctrl_sample_id}.dedup.sorted.bam"
    broad = params.broad ? "--broad" : ''
    """
    macs2 callpeak \\
        -t ${chip_sample_id}.dedup.sorted.bam \\
        $ctrl \\
        $broad \\
        -f BAM \\
        -g $REF_macs \\
        -n $analysis_id \\
        -q 0.01
    """
}
feel free to message offline if prefered...
Ashley S Doane
@DoaneAS
Sep 30 2017 22:59
also @ewels, we also prefer removing duplicate reads using picard before peak calling, but may want to add --keep-dup all to your macs2 command, per ENCODE guidelines