diff --git a/lib/WorkflowHic.groovy b/lib/WorkflowHic.groovy index 3dea732db2bb9c05d5002920297d8d727efea9d0..0152384a29212c06d999b15023a3cc6229312d3d 100755 --- a/lib/WorkflowHic.groovy +++ b/lib/WorkflowHic.groovy @@ -18,6 +18,15 @@ class WorkflowHic { System.exit(1) } + if (params.bin_size instanceof Integer){ + //skip + println("bin_size is int") + } + + if (params.res_zoomify instanceof Integer){ + //skip + println("res_zoomify is int") + } // Check Digestion or DNase Hi-C mode //if (!params.dnase && !params.ligation_site) { // log.error "Ligation motif not found. Please either use the `--digestion` parameters or specify the `--restriction_site` and `--ligation_site`. For DNase Hi-C, please use '--dnase' option" diff --git a/workflows/hic.nf b/workflows/hic.nf index faa6a59cdcf19d5b5976257bd8f52c572374c9c1..5c45e543f695c4e45dbd15b5118d09e3d1b33953 100644 --- a/workflows/hic.nf +++ b/workflows/hic.nf @@ -38,9 +38,19 @@ if (params.digestion){ //**************************************** // Combine all maps resolution for downstream analysis -ch_map_res = Channel.from( params.bin_size ).splitCsv().flatten().toInteger() +if (params.bin_size instanceof Integer) { + ch_map_res = Channel.from( params.bin_size ).toInteger() +} +else { + ch_map_res = Channel.from( params.bin_size ).splitCsv().flatten().toInteger() +} -if (params.res_zoomify){ + +if (params.res_zoomify instanceof Integer){ + ch_zoom_res = Channel.from( params.res_zoomify ).splitCsv().flatten().toInteger() + ch_map_res = ch_map_res.concat(ch_zoom_res) +} +else{ ch_zoom_res = Channel.from( params.res_zoomify ).splitCsv().flatten().toInteger() ch_map_res = ch_map_res.concat(ch_zoom_res) } @@ -51,7 +61,7 @@ if (params.res_tads && !params.skip_tads){ }else{ ch_tads_res=Channel.empty() if (!params.skip_tads){ - log.warn "[nf-core/hic] Hi-C resolution for TADs calling not specified. See --res_tads" + log.warn "[nf-core/hic] Hi-C resolution for TADs calling not specified. See --res_tads" } } @@ -61,7 +71,7 @@ if (params.res_dist_decay && !params.skip_dist_decay){ }else{ ch_ddecay_res = Channel.empty() if (!params.skip_dist_decay){ - log.warn "[nf-core/hic] Hi-C resolution for distance decay not specified. See --res_dist_decay" + log.warn "[nf-core/hic] Hi-C resolution for distance decay not specified. See --res_dist_decay" } } @@ -71,7 +81,7 @@ if (params.res_compartments && !params.skip_compartments){ }else{ ch_comp_res = Channel.empty() if (!params.skip_compartments){ - log.warn "[nf-core/hic] Hi-C resolution for compartment calling not specified. See --res_compartments" + log.warn "[nf-core/hic] Hi-C resolution for compartment calling not specified. See --res_compartments" } } @@ -96,7 +106,7 @@ ch_multiqc_custom_methods_description = params.multiqc_methods_description ? fil // // MODULE: Local to the pipeline // -include { HIC_PLOT_DIST_VS_COUNTS } from '../modules/local/hicexplorer/hicPlotDistVsCounts' +include { HIC_PLOT_DIST_VS_COUNTS } from '../modules/local/hicexplorer/hicPlotDistVsCounts' include { MULTIQC } from '../modules/local/multiqc' // @@ -236,7 +246,7 @@ workflow HIC { .filter{ it[0].resolution == it[2] } .map { it -> [it[0], it[1]]} .set{ ch_cool_tads } - + TADS( ch_cool_tads )