Commit 065dca4e authored by Chris Cheshire's avatar Chris Cheshire
Browse files

Added ability to separately scale igg factor for deeptool normalisation

parent c5dccdbb
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -30,9 +30,6 @@
            "custom/getchromsizes": {
                "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
            },
            "deeptools/bamcoverage": {
                "git_sha": "fdb1664885480d9411c24ba45bb4fde4738e5907"
            },
            "deeptools/computematrix": {
                "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
            },
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ process DEEPTOOLS_BAMCOVERAGE {
        'quay.io/biocontainers/deeptools:3.5.1--py_0' }"

    input:
    tuple val(meta), path(input), path(input_index)
    tuple val(meta), path(input), path(input_index), val(scale)

    output:
    tuple val(meta), path("*.bigWig")   , emit: bigwig, optional: true
@@ -26,6 +26,7 @@ process DEEPTOOLS_BAMCOVERAGE {
    bamCoverage \
    --bam $input \
    $args \
    --scaleFactor ${scale} \
    --numberOfProcessors ${task.cpus} \
    --outFileName ${prefix}

+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ params {
    normalisation_mode         = "Spikein"
    normalisation_binsize      = 1
    normalisation_c            = 10000
    igg_scale_factor           = 1

    // Peak Caller default param
    peakcaller                 = null
+42 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 */

include { BEDTOOLS_GENOMECOV    } from "../../modules/nf-core/modules/bedtools/genomecov/main"
include { DEEPTOOLS_BAMCOVERAGE } from "../../modules/nf-core/modules/deeptools/bamcoverage/main"
include { DEEPTOOLS_BAMCOVERAGE } from "../../modules/local/modules/deeptools/bamcoverage/main"
include { BEDTOOLS_SORT         } from "../../modules/nf-core/modules/bedtools/sort/main"
include { UCSC_BEDCLIP          } from "../../modules/nf-core/modules/ucsc/bedclip/main"
include { UCSC_BEDGRAPHTOBIGWIG } from "../../modules/nf-core/modules/ucsc/bedgraphtobigwig/main"
@@ -94,11 +94,51 @@ workflow PREPARE_PEAKCALLING {
        // EXAMPLE CHANNEL STRUCT: [[META], BAM, BAI]
        //ch_bam_bai | view

        /*
        * CHANNEL: Split files based on igg or not
        */
        ch_bam_bai.branch { it ->
            target: it[0].group != "igg"
            control: it[0].group == "igg"
        }
        .set { ch_bam_bai_split }

        /*
        * CHANNEL: Assign scale factor of 1 to target files
        */
        ch_bam_bai_split.target
            .map { row ->
                [ row[0], row[1], row[2], 1 ]
            }
        .set { ch_bam_bai_split_target }
        // EXAMPLE CHANNEL STRUCT: [[META], BAM, BAI, SCALE_FACTOR]
        //ch_bam_bai_split_target | view

        /*
        * CHANNEL: Assign igg scale factor to target files
        */
        ch_bam_bai_split.control
            .map { row ->
                [ row[0], row[1], row[2], params.igg_scale_factor ]
            }
        .set { ch_bam_bai_split_igg }
        // EXAMPLE CHANNEL STRUCT: [[META], BAM, BAI, SCALE_FACTOR]
        //ch_bam_bai_split_igg | view

        /*
        * CHANNEL: Mix the split channels back up
        */
        ch_bam_bai_split_target
            .mix(ch_bam_bai_split_igg)
        .set { ch_bam_bai_scale_factor }
         // EXAMPLE CHANNEL STRUCT: [[META], BAM, BAI, SCALE_FACTOR]
        //ch_bam_bai_scale_factor | view
        
        /*
        * MODULE: Convert bam files to bedgraph and normalise
        */
        DEEPTOOLS_BAMCOVERAGE (
            ch_bam_bai
            ch_bam_bai_scale_factor
        )
        ch_versions = ch_versions.mix(DEEPTOOLS_BAMCOVERAGE.out.versions)
        ch_bedgraph = DEEPTOOLS_BAMCOVERAGE.out.bedgraph