Commit 812fe226 authored by Chris Cheshire's avatar Chris Cheshire
Browse files

Fixed igg control splitting

parent 9857cd2f
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -25,13 +25,10 @@ params {
    run_multiqc            = true
    run_peak_plotting      = true
    run_igv                = true

    dedup_control_only     = true
}

params.callers = params.peakcaller ? params.peakcaller.split(',').collect{ it.trim().toLowerCase() } : ['seacr']

if(params.dedup_target_reads)           { params.dedup_control_only = false }
if(params.consensus_peak_mode == 'all') { params.run_consensus_all  = true  }

if(params.minimum_alignment_q_score > 0)                  { params.run_q_filter      = true  }
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ def get_samplesheet_paths(LinkedHashMap row) {
    meta.id            = row.id
    meta.group         = row.group
    meta.replicate     = row.replicate.toInteger()
    meta.control_group = row.control_group
    meta.control_group = row.control
    meta.single_end    = row.single_end.toBoolean()
    meta.is_control    = row.is_control.toBoolean()

+9 −7
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ include { BAM_STATS_SAMTOOLS } from './bam_stats_samtools'
workflow MARK_DUPLICATES_PICARD {
    take:
    bam            // channel: [ val(meta), [ bam ] ]
    control_only //boolean
    process_target //boolean

    main:
    /*
@@ -18,25 +18,27 @@ workflow MARK_DUPLICATES_PICARD {
    ch_bam      = Channel.empty()
    metrics     = Channel.empty()
    ch_versions = Channel.empty()
    if( !control_only ) {
    if( process_target ) {
        PICARD_MARKDUPLICATES ( bam )
        ch_bam      = PICARD_MARKDUPLICATES.out.bam
        metrics     = PICARD_MARKDUPLICATES.out.metrics
        ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions)
    }
    else { // Split out non igg files and run only on these
    else { // Split out control files and run only on these
        bam.branch { it ->
            target:  it[0].is_control == 0
            control: it[0].is_control == 1
            target:  it[0].is_control == false
            control: it[0].is_control == true
        }
        .set { ch_split }
        //ch_split.target | view
        //ch_split.control | view

        PICARD_MARKDUPLICATES ( ch_split.control )
        ch_bam      = PICARD_MARKDUPLICATES.out.bam.mix ( ch_split.target )
        metrics     = PICARD_MARKDUPLICATES.out.metrics
        ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions)
    }
    //out_bam | view
    //ch_bam | view

    /*
    * Index BAM file
+2 −2
Original line number Diff line number Diff line
@@ -98,8 +98,8 @@ workflow PREPARE_PEAKCALLING {
        * CHANNEL: Split files based on igg or not
        */
        ch_bam_bai.branch { it ->
            target:  it[0].is_control == 0
            control: it[0].is_control == 1
            target:  it[0].is_control == false
            control: it[0].is_control == true
        }
        .set { ch_bam_bai_split }

+9 −9
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ workflow CUTANDRUN {
    if (params.run_mark_dups) {
        MARK_DUPLICATES_PICARD (
            ch_samtools_bam,
            false
            true
        )
        ch_samtools_bam           = MARK_DUPLICATES_PICARD.out.bam
        ch_samtools_bai           = MARK_DUPLICATES_PICARD.out.bai
@@ -324,7 +324,7 @@ workflow CUTANDRUN {
    if (params.run_remove_dups) {
        DEDUPLICATE_PICARD (
            ch_samtools_bam,
            params.dedup_control_only
            params.dedup_target_reads
        )
        ch_samtools_bam      = DEDUPLICATE_PICARD.out.bam
        ch_samtools_bai      = DEDUPLICATE_PICARD.out.bai
@@ -411,8 +411,8 @@ workflow CUTANDRUN {
         * CHANNEL: Separate bedgraphs into target/control
         */
        ch_bedgraph.branch { it ->
            target:  it[0].is_control == 0
            control: it[0].is_control == 1
            target:  it[0].is_control == false
            control: it[0].is_control == true
        }
        .set { ch_bedgraph_split }
        //ch_bedgraph_split.target | view
@@ -465,8 +465,8 @@ workflow CUTANDRUN {

            if('macs2' in callers) {
                ch_samtools_bam.branch{ it ->
                    target:  it[0].is_control == 0
                    control: it[0].is_control == 1
                    target:  it[0].is_control == false
                    control: it[0].is_control == true
                }
                .set { ch_samtools_bam_split }
                // ch_samtools_bam_split.target | view
@@ -532,8 +532,8 @@ workflow CUTANDRUN {

            if('macs2' in callers) {
                ch_samtools_bam.branch{ it ->
                    target:  it[0].is_control == 0
                    control: it[0].is_control == 1
                    target:  it[0].is_control == false
                    control: it[0].is_control == true
                }
                .set { ch_samtools_bam_split }
                // ch_samtools_bam_split.target | view
@@ -724,7 +724,7 @@ workflow CUTANDRUN {
            * CHANNEL: Remove IgG from bigwig channel
            */
            ch_bigwig
                .filter { it[0].is_control == 0 }
                .filter { it[0].is_control == false }
                .set { ch_bigwig_no_igg }
            //ch_bigwig_no_igg | view