From 0666c5b2622ad1cef174a382a5259916b04f30e4 Mon Sep 17 00:00:00 2001 From: yumisims Date: Mon, 18 Dec 2023 21:12:07 +0000 Subject: [PATCH 01/16] add read_coverage, se_mapping and pe_mapping --- subworkflows/local/pe_mapping.nf | 116 +++++++++++ subworkflows/local/read_coverage.nf | 292 ++++++++++++++++++++++++++++ subworkflows/local/se_mapping.nf | 116 +++++++++++ 3 files changed, 524 insertions(+) create mode 100644 subworkflows/local/pe_mapping.nf create mode 100755 subworkflows/local/read_coverage.nf create mode 100644 subworkflows/local/se_mapping.nf diff --git a/subworkflows/local/pe_mapping.nf b/subworkflows/local/pe_mapping.nf new file mode 100644 index 00000000..e88254d9 --- /dev/null +++ b/subworkflows/local/pe_mapping.nf @@ -0,0 +1,116 @@ +include { MINIMAP2_ALIGN as MINIMAP2_ALIGN_ILLUMINA } from '../../modules/nf-core/minimap2/align/main' +include { SAMTOOLS_MERGE } from '../../modules/nf-core/samtools/merge/main' + +workflow PE_MAPPING { + + take: + reference_tuple // Channel [ val(meta), path(file) ] + assembly_path // Channel path(file) + pacbio_tuple // Channel [ val(meta), val( str ) ] + reads_type // Channel val( str ) + + main: + ch_versions = Channel.empty() + + + // + // PROCESS: GETS PACBIO READ PATHS FROM READS_PATH + // + ch_grabbed_reads_path = GrabFiles( pacbio_tuple ) + + ch_grabbed_reads_path + .map { meta, files -> + tuple( files ) + } + .flatten() + .set { ch_reads_path } + + // + // PROCESS: MAKE MINIMAP INPUT CHANNEL + // + reference_tuple + .combine( ch_reads_path ) + .combine( reads_type ) + .map { meta, ref, reads_path, reads_type -> + tuple( + [ id : meta.id, + single_end : false, + readtype: reads_type.toString() + ], + reads_path, + ref, + true, + false, + false, + reads_type + ) + } + .set { pe_input } + + // + // PROCESS: MULTIMAP TO MAKE BOOLEAN ARGUMENTS + // + pe_input + .multiMap { meta, reads_path, ref, bam_output, cigar_paf, cigar_bam, reads_type -> + read_tuple : tuple( meta, read_path) + ref : ref + bool_bam_ouput : bam_output + bool_cigar_paf : cigar_paf + bool_cigar_bam : cigar_bam + } + .set { illumina_input } + + // + // MODULE: PAIRED END READ MAPPING USING MINIMAP + // + MINIMAP2_ALIGN_ILLUMINA ( + illumina_input.read_tuple, + illumina_input.ref, + illumina_input.bool_bam_ouput, + illumina_input.bool_cigar_paf, + illumina_input.bool_cigar_bam + ) + ch_versions = ch_versions.mix(MINIMAP2_ALIGN_ILLUMINA.out.versions) + + ch_bams = MINIMAP2_ALIGN_ILLUMINA.out.bam + + ch_bams + .map { meta, file -> + tuple( file ) + } + .collect() + .map { file -> + tuple ( + [ id : file[0].toString().split('/')[-1].split('_')[0] ], // Change sample ID + file + ) + } + .set { collected_files_for_merge } + + // + // MODULE: MERGE ALL OUTPUT BAM + // + SAMTOOLS_MERGE( + collected_files_for_merge, + reference_tuple, + [[],[]] + ) + ch_versions = ch_versions.mix(SAMTOOLS_MERGE.out.versions) + + emit: + versions = ch_versions.ifEmpty(null) + mapped_bam = SAMTOOLS_MERGE.out.bam +} + +process GrabFiles { + tag "${meta.id}" + executor 'local' + + input: + tuple val(meta), path("in") + + output: + tuple val(meta), path("in/*.{fa,fasta}.{gz}") + + "true" +} diff --git a/subworkflows/local/read_coverage.nf b/subworkflows/local/read_coverage.nf new file mode 100755 index 00000000..32e2f648 --- /dev/null +++ b/subworkflows/local/read_coverage.nf @@ -0,0 +1,292 @@ +#!/usr/bin/env nextflow + +// +// MODULE IMPORT BLOCK +// +include { BEDTOOLS_BAMTOBED } from '../../modules/nf-core/bedtools/bamtobed/main' +include { BEDTOOLS_GENOMECOV } from '../../modules/nf-core/bedtools/genomecov/main' +include { BEDTOOLS_MERGE as BEDTOOLS_MERGE_MAX } from '../../modules/nf-core/bedtools/merge/main' +include { BEDTOOLS_MERGE as BEDTOOLS_MERGE_MIN } from '../../modules/nf-core/bedtools/merge/main' +include { GNU_SORT } from '../../modules/nf-core/gnu/sort/main' +include { MINIMAP2_INDEX } from '../../modules/nf-core/minimap2/index/main' +include { MINIMAP2_ALIGN as MINIMAP2_ALIGN_SPLIT } from '../../modules/nf-core/minimap2/align/main' +include { MINIMAP2_ALIGN } from '../../modules/nf-core/minimap2/align/main' +include { SAMTOOLS_MERGE } from '../../modules/nf-core/samtools/merge/main' +include { SAMTOOLS_SORT } from '../../modules/nf-core/samtools/sort/main' +include { SAMTOOLS_VIEW } from '../../modules/nf-core/samtools/view/main' +include { UCSC_BEDGRAPHTOBIGWIG as BED2BW_NORMAL } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main' +include { UCSC_BEDGRAPHTOBIGWIG as BED2BW_LOG } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main' +include { GRAPHOVERALLCOVERAGE } from '../../modules/local/graphoverallcoverage' +include { GETMINMAXPUNCHES } from '../../modules/local/getminmaxpunches' +include { FINDHALFCOVERAGE } from '../../modules/local/findhalfcoverage' +include { LONGREADCOVERAGESCALELOG } from '../../modules/local/longreadcoveragescalelog' + +workflow LONGREAD_COVERAGE { + + take: + reference_tuple // Channel: tuple [ val(meta), file( reference_file ) ] + dot_genome // Channel: tuple [ val(meta), [ file( datafile ) ] ] + reads_path // Channel: tuple [ val(meta), val( str ) ] + + main: + ch_versions = Channel.empty() + + // + // LOGIC: CHECK IF THE INPUT READ FILE IS PAIRED END OR SINGLE END BASED ON THE READ PLATFORM, THEN RUN MINIMAP + // + if ( platform.filter { it == "hifi" } || platform.filter { it == "clr" } || platform.filter { it == "ont" } ) { + SE_MAPPING ( + reference_tuple, + assembly_path, + pacbio_tuple, + platform + ) + ch_versions = ch_versions.mix(SE_MAPPING.out.versions) + ch_align_bam + .mix( SE_MAPPING.out.mapped_bam ) + .set { merged_bam } + } + else if ( platform.filter { it == "illumina" } ) { + + PE_MAPPING ( + reference_tuple, + assembly_path, + pacbio_tuple, + platform + ) + ch_versions = ch_versions.mix(PE_MAPPING.out.versions) + ch_align_bam + .mix( PE_MAPPING.out.mapped_bam ) + .set { merged_bam } + } + + // + // MODULE: SORT MAPPED BAM + // + SAMTOOLS_SORT ( + merged_bam + ) + ch_versions = ch_versions.mix( SAMTOOLS_SORT.out.versions ) + + // + // MODULE: INDEXING SORTED MAPPED BAM + // + SAMTOOLS_INDEX ( + SAMTOOLS_SORT.out.bam + ) + ch_versions = ch_versions.mix( SAMTOOLS_INDEX.out.versions ) + // + // LOGIC: PREPARING MERGE INPUT WITH REFERENCE GENOME AND REFERENCE INDEX + // + SAMTOOLS_SORT.out.bam + .combine( reference_tuple ) + .multiMap { meta, bam, ref_meta, ref -> + bam_input : tuple( + [ id : meta.id, + sz : bam.size(), + single_end : true ], + bam, + [] // As we aren't using an index file here + ) + ref_input : tuple( + ref_meta, + ref + ) + } + .set { view_input } + // + // MODULE: EXTRACT READS FOR PRIMARY ASSEMBLY + // + SAMTOOLS_VIEW( + view_input.bam_input, + view_input.ref_input, + [] + ) + ch_versions = ch_versions.mix(SAMTOOLS_VIEW.out.versions) + + // + // MODULE: BAM TO PRIMARY BED + // + BEDTOOLS_BAMTOBED( + SAMTOOLS_VIEW.out.bam + ) + ch_versions = ch_versions.mix(BEDTOOLS_BAMTOBED.out.versions) + + // + // LOGIC: PREPARING Genome2Cov INPUT + // + BEDTOOLS_BAMTOBED.out.bed + .combine( dot_genome ) + .multiMap { meta, file, my_genome_meta, my_genome -> + input_tuple : tuple ( + [ id : meta.id, + single_end : true ], + file, + 1 + ) + dot_genome : my_genome + file_suffix : 'bed' + } + .set { genomecov_input } + + // + // MODULE: Genome2Cov + // + BEDTOOLS_GENOMECOV( + genomecov_input.input_tuple, + genomecov_input.dot_genome, + genomecov_input.file_suffix + ) + ch_versions = ch_versions.mix(BEDTOOLS_GENOMECOV.out.versions) + + // + // MODULE: SORT THE PRIMARY BED FILE + // + GNU_SORT( + BEDTOOLS_GENOMECOV.out.genomecov + ) + ch_versions = ch_versions.mix(GNU_SORT.out.versions) + + // + // MODULE: get_minmax_punches + // + GETMINMAXPUNCHES( + GNU_SORT.out.sorted + ) + ch_versions = ch_versions.mix(GETMINMAXPUNCHES.out.versions) + + // + // MODULE: get_minmax_punches + // + BEDTOOLS_MERGE_MAX( + GETMINMAXPUNCHES.out.max + ) + ch_versions = ch_versions.mix(BEDTOOLS_MERGE_MAX.out.versions) + + // + // MODULE: get_minmax_punches + // + BEDTOOLS_MERGE_MIN( + GETMINMAXPUNCHES.out.min + ) + ch_versions = ch_versions.mix(BEDTOOLS_MERGE_MIN.out.versions) + + // + // MODULE: GENERATE DEPTHGRAPH + // + GRAPHOVERALLCOVERAGE( + GNU_SORT.out.sorted + ) + ch_versions = ch_versions.mix(GRAPHOVERALLCOVERAGE.out.versions) + ch_depthgraph = GRAPHOVERALLCOVERAGE.out.part + + // + // LOGIC: PREPARING FINDHALFCOVERAGE INPUT + // + GNU_SORT.out.sorted + .combine( GRAPHOVERALLCOVERAGE.out.part ) + .combine( dot_genome ) + .multiMap { meta, file, meta_depthgraph, depthgraph, meta_my_genome, my_genome -> + halfcov_bed : tuple( [ id : meta.id, single_end : true ], file ) + genome_file : my_genome + depthgraph_file : depthgraph + } + .set { halfcov_input } + + // + // MODULE: FIND REGIONS OF HALF COVERAGE + // + FINDHALFCOVERAGE( + halfcov_input.halfcov_bed, + halfcov_input.genome_file, + halfcov_input.depthgraph_file + ) + ch_versions = ch_versions.mix(FINDHALFCOVERAGE.out.versions) + + // + // LOGIC: PREPARING NORMAL COVERAGE INPUT + // + GNU_SORT.out.sorted + .combine( dot_genome ) + .combine(reference_tuple) + .multiMap { meta, file, meta_my_genome, my_genome, ref_meta, ref -> + ch_coverage_bed : tuple ([ id: ref_meta.id, single_end: true], file) + genome_file : my_genome + } + .set { bed2bw_normal_input } + + // + // MODULE: CONVERT BEDGRAPH TO BIGWIG FOR NORMAL COVERAGE + // + BED2BW_NORMAL( + bed2bw_normal_input.ch_coverage_bed, + bed2bw_normal_input.genome_file + ) + ch_versions = ch_versions.mix(BED2BW_NORMAL.out.versions) + + // + // MODULE: CONVERT COVERAGE TO LOG + // + LONGREADCOVERAGESCALELOG( + GNU_SORT.out.sorted + ) + ch_versions = ch_versions.mix(LONGREADCOVERAGESCALELOG.out.versions) + + // + // LOGIC: PREPARING LOG COVERAGE INPUT + // + LONGREADCOVERAGESCALELOG.out.bed + .combine( dot_genome ) + .combine(reference_tuple) + .multiMap { meta, file, meta_my_genome, my_genome, ref_meta, ref -> + ch_coverage_bed : tuple ([ id: ref_meta.id, single_end: true], file) + genome_file : my_genome + } + .set { bed2bw_log_input } + + // + // MODULE: CONVERT BEDGRAPH TO BIGWIG FOR LOG COVERAGE + // + BED2BW_LOG( + bed2bw_log_input.ch_coverage_bed, + bed2bw_log_input.genome_file + ) + ch_versions = ch_versions.mix(BED2BW_LOG.out.versions) + + // + // LOGIC: GENERATE A SUMMARY TUPLE FOR OUTPUT + // + ch_grabbed_read_paths + .collect() + .map { meta, fasta -> + tuple( [ id: 'pacbio', + sz: fasta instanceof ArrayList ? fasta.collect { it.size()} : fasta.size() ], + fasta + ) + } + .set { ch_reporting_pacbio } + + emit: + ch_minbed = BEDTOOLS_MERGE_MIN.out.bed + ch_halfbed = FINDHALFCOVERAGE.out.bed + ch_maxbed = BEDTOOLS_MERGE_MAX.out.bed + ch_reporting = ch_reporting_pacbio.collect() + ch_covbw_nor = BED2BW_NORMAL.out.bigwig + ch_covbw_log = BED2BW_LOG.out.bigwig + versions = ch_versions +} + +process GrabFiles { + label 'process_tiny' + + tag "${meta.id}" + executor 'local' + + input: + tuple val(meta), path("in") + + output: + tuple val(meta), path("in/*.fasta.gz") + + "true" +} diff --git a/subworkflows/local/se_mapping.nf b/subworkflows/local/se_mapping.nf new file mode 100644 index 00000000..2746e4bc --- /dev/null +++ b/subworkflows/local/se_mapping.nf @@ -0,0 +1,116 @@ +include { MINIMAP2_ALIGN as MINIMAP2_ALIGN_SE } from '../../modules/nf-core/minimap2/align/main' +include { SAMTOOLS_MERGE } from '../../modules/nf-core/samtools/merge/main' + +workflow SE_MAPPING { + + take: + reference_tuple // Channel [ val(meta), path(file) ] + assembly_path // Channel path(file) + pacbio_tuple // Channel [ val(meta), path(file) ] + reads_type // Channel val( str ) + + main: + ch_versions = Channel.empty() + ch_align_bams = Channel.empty() + + // + // PROCESS: GETS PACBIO READ PATHS FROM READS_PATH + // + ch_grabbed_reads_path = GrabFiles( pacbio_tuple ) + + ch_grabbed_reads_path + .map { meta, files -> + tuple( files ) + } + .flatten() + .set { ch_reads_path } + + // + // PROCESS: MAKE MINIMAP INPUT CHANNEL AND MAKE BRANCHES BASED ON INPUT READ TYPE + // + reference_tuple + .combine( ch_reads_path ) + .combine( reads_type ) + .map { meta, ref, reads_path, reads_type -> + tuple( + [ id : meta.id, + single_end : true, + readtype : reads_type.toString() + ], + reads_path, + ref, + true, + false, + false, + reads_type + ) + } + .set { minimap_se_input } + + // + // PROCESS: MULTIMAP TO MAKE BOOLEAN ARGUMENTS FOR MINIMAP HIFI MAPPING INPUT + // + minimap_se_input + .multiMap { meta, reads_path, ref, bam_output, cigar_paf, cigar_bam, reads_type -> + read_tuple : tuple( meta, reads_path) + ref : ref + bool_bam_ouput : bam_output + bool_cigar_paf : cigar_paf + bool_cigar_bam : cigar_bam + } + .set { se_input } + + // + // MOUDLES: MAPPING DIFFERENT TYPE OF READ AGAINIST REFERENCE + // + + MINIMAP2_ALIGN_SE ( + se_input.read_tuple, + se_input.ref, + se_input.bool_bam_ouput, + se_input.bool_cigar_paf, + se_input.bool_cigar_bam + ) + ch_bams = MINIMAP2_ALIGN_SE.out.bam + + + ch_bams + .map { meta, file -> + tuple( file ) + } + .collect() + .map { file -> + tuple ( + [ id : file[0].toString().split('/')[-1].split('_')[0] ], // Change sample ID + file + ) + } + .set { collected_files_for_merge } + + // + // MODULE: MERGE ALL OUTPUT BAM + // + SAMTOOLS_MERGE( + collected_files_for_merge, + reference_tuple, + [[],[]] + ) + ch_versions = ch_versions.mix(SAMTOOLS_MERGE.out.versions) + + emit: + versions = ch_versions.ifEmpty(null) + mapped_bam = SAMTOOLS_MERGE.out.bam +} + +process GrabFiles { + tag "${meta.id}" + executor 'local' + + input: + tuple val(meta), path("in") + + output: + tuple val(meta), path("in/*.{fa,fasta}.{gz}") + + "true" +} From 9e3627a05b07d1851951cfa002d66bb219b64e95 Mon Sep 17 00:00:00 2001 From: yumisims Date: Mon, 8 Jan 2024 19:02:07 +0000 Subject: [PATCH 02/16] read coverage completed --- assets/local_testing/nxOscDF5033.yaml | 4 +- conf/modules.config | 27 ++- modules.json | 153 ++++++++++++---- .../nf-core/samtools/index/environment.yml | 7 + modules/nf-core/samtools/index/main.nf | 48 +++++ modules/nf-core/samtools/index/meta.yml | 57 ++++++ .../samtools/index/tests/csi.nextflow.config | 7 + .../nf-core/samtools/index/tests/main.nf.test | 87 +++++++++ .../samtools/index/tests/main.nf.test.snap | 28 +++ modules/nf-core/samtools/index/tests/tags.yml | 2 + subworkflows/local/read_coverage.nf | 166 ++++++++++++------ subworkflows/local/yaml_input.nf | 46 +++-- 12 files changed, 506 insertions(+), 126 deletions(-) create mode 100644 modules/nf-core/samtools/index/environment.yml create mode 100644 modules/nf-core/samtools/index/main.nf create mode 100644 modules/nf-core/samtools/index/meta.yml create mode 100644 modules/nf-core/samtools/index/tests/csi.nextflow.config create mode 100644 modules/nf-core/samtools/index/tests/main.nf.test create mode 100644 modules/nf-core/samtools/index/tests/main.nf.test.snap create mode 100644 modules/nf-core/samtools/index/tests/tags.yml diff --git a/assets/local_testing/nxOscDF5033.yaml b/assets/local_testing/nxOscDF5033.yaml index 6a0c147f..dab14fa2 100755 --- a/assets/local_testing/nxOscDF5033.yaml +++ b/assets/local_testing/nxOscDF5033.yaml @@ -7,8 +7,8 @@ assembly: project_id: DTOL reference_file: /lustre/scratch123/tol/resources/treeval/treeval-testdata/TreeValSmallData/Oscheius_DF5033/assembly/draft/DF5033.hifiasm.noTelos.20211120/DF5033.noTelos.hifiasm.purged.noCont.noMito.fasta assem_reads: - longread_type: hifi - longread_data: /lustre/scratch123/tol/resources/treeval/treeval-testdata/TreeValSmallData/Oscheius_DF5033/genomic_data/nxOscSpes1/pacbio/fasta/ + read_type: hifi + read_data: /lustre/scratch123/tol/resources/treeval/treeval-testdata/TreeValSmallData/Oscheius_DF5033/genomic_data/nxOscSpes1/pacbio/fasta/ hic_data: /lustre/scratch123/tol/resources/treeval/treeval-testdata/TreeValSmallData/Oscheius_DF5033/genomic_data/nxOscSpes1/hic-arima2/full/ supplementary_data: path alignment: diff --git a/conf/modules.config b/conf/modules.config index 83b22d62..b6015c12 100755 --- a/conf/modules.config +++ b/conf/modules.config @@ -68,6 +68,10 @@ process { ext.prefix = { "${meta.id}.sorted" } } + withName: MINIMAP2_ALIGN { + ext.args = {'-ax '+ (meta.readtype.equals("hifi") ? "map-hifi" : meta.readtype.equals("clr") ? "map-pb" : meta.readtype.equals("ont") ? "map-ont" : meta.readtype.equals("illumina") ? "sr" : "") + ' --cs=short' + (reference.size() > 3e9 ? (" -I" + Math.ceil(reference.size()/1073741824)+"G") : "") } + ext.prefix = { "${meta.id}_alignment_${reference.getName().tokenize('.')[0]}" } + } // // SUBWORKFLOW: SELFCOMP @@ -186,49 +190,44 @@ process { ext.prefix = { "${meta.id}_alignment_${reference.getName().tokenize(".")[0]}" } } - withName: ".*:.*:LONGREAD_COVERAGE:MINIMAP2_ALIGN_SPLIT" { - ext.args = { "-t 20 --split-prefix ${meta.split_prefix}" } - ext.prefix = { "${meta.id}_alignment_${reference.getName().tokenize(".")[0]}" } - } - - withName: ".*:.*:LONGREAD_COVERAGE:SAMTOOLS_MERGE" { + withName: ".*:.*:READ_COVERAGE:SAMTOOLS_MERGE" { ext.prefix = { "${meta.id}_merge" } } - withName: ".*:.*:LONGREAD_COVERAGE:SAMTOOLS_SORT" { + withName: ".*:.*:READ_COVERAGE:SAMTOOLS_SORT" { ext.prefix = { "${meta.id}_sorted" } } - withName: ".*:.*:LONGREAD_COVERAGE:SAMTOOLS_VIEW" { + withName: ".*:.*:READ_COVERAGE:SAMTOOLS_VIEW_FILTER_PRIMARY" { ext.args = "-b -hF 256" ext.prefix = { "${meta.id}_view" } } - withName: ".*:.*:LONGREAD_COVERAGE:BEDTOOLS_GENOMECOV" { + withName: ".*:.*:READ_COVERAGE:BEDTOOLS_GENOMECOV" { ext.args = "-bga -split" ext.prefix = { "${meta.id}_genome2cov" } } - withName: ".*:.*:LONGREAD_COVERAGE:BEDTOOLS_MERGE_MAX" { + withName: ".*:.*:READ_COVERAGE:BEDTOOLS_MERGE_MAX" { ext.args = "-d 50" ext.prefix = { "maxdepth" } } - withName: ".*:.*:LONGREAD_COVERAGE:BEDTOOLS_MERGE_MIN" { + withName: ".*:.*:READ_COVERAGE:BEDTOOLS_MERGE_MIN" { ext.args = "-d 50" ext.prefix = { "zerodepth" } } - withName: ".*:.*:LONGREAD_COVERAGE:GNU_SORT" { + withName: ".*:.*:READ_COVERAGE:GNU_SORT" { ext.args = { "-k1,1 -k2,2n -S${task.memory.mega - 100}M -T ." } ext.prefix = { "${meta.id}_sorted" } } - withName: ".*:.*:LONGREAD_COVERAGE:BED2BW_NORMAL" { + withName: ".*:.*:READ_COVERAGE:BED2BW_NORMAL" { ext.prefix = { "${meta.id}_coverage_normal" } } - withName: ".*:.*:LONGREAD_COVERAGE:BED2BW_LOG" { + withName: ".*:.*:READ_COVERAGE:BED2BW_LOG" { ext.prefix = { "${meta.id}_coverage_log" } } diff --git a/modules.json b/modules.json index 2226ccf7..b6bc0dd1 100755 --- a/modules.json +++ b/modules.json @@ -8,183 +8,262 @@ "bedtools/bamtobed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/genomecov": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/intersect": { "branch": "master", "git_sha": "c1532c77717ad7c64752b26b0fd9b4556bdef272", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/makewindows": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/map": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/merge": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/sort": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "busco": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bwamem2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "cat/cat": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "cooler/cload": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "cooler/zoomify": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "custom/dumpsoftwareversions": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "custom/getchromsizes": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"], + "installed_by": [ + "modules" + ], "patch": "modules/nf-core/custom/getchromsizes/custom-getchromsizes.diff" }, "fastk/fastk": { "branch": "master", "git_sha": "29e87a37ae1887fc8289f2f56775604a71715cb9", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "gnu/sort": { "branch": "master", "git_sha": "88f6e982fb8bd40488d837b3b08a65008e602840", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "merquryfk/merquryfk": { "branch": "master", "git_sha": "6f150e1503c0826c21fedf1fa566cdbecbe98ec7", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "minimap2/align": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "minimap2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "miniprot/align": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "miniprot/index": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "mummer": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "paftools/sam2paf": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "pretextmap": { "branch": "master", "git_sha": "decfb802f2e573efb7b44ff06b11ecf16853054d", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "pretextsnapshot": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/faidx": { "branch": "master", "git_sha": "fd742419940e01ba1c5ecb172c3e32ec840662fe", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] + }, + "samtools/index": { + "branch": "master", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": [ + "modules" + ] }, "samtools/markdup": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/merge": { "branch": "master", "git_sha": "0460d316170f75f323111b4a2c0a2989f0c32013", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/sort": { "branch": "master", "git_sha": "a0f7be95788366c1923171e358da7d049eb440f9", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/view": { "branch": "master", "git_sha": "3ffae3598260a99e8db3207dead9f73f87f90d1f", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "seqtk/cutn": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "tabix/bgziptabix": { "branch": "master", "git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "ucsc/bedgraphtobigwig": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "ucsc/bedtobigbed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "windowmasker/mk_counts": { "branch": "master", "git_sha": "30c3ed32e8bd5ddaf349ba2f4f99d38182fdc08c", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "windowmasker/ustat": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] } } }, @@ -193,4 +272,4 @@ } } } -} +} \ No newline at end of file diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml new file mode 100644 index 00000000..296ed99e --- /dev/null +++ b/modules/nf-core/samtools/index/environment.yml @@ -0,0 +1,7 @@ +name: samtools_index +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::samtools=1.18 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf new file mode 100644 index 00000000..8ad18fdc --- /dev/null +++ b/modules/nf-core/samtools/index/main.nf @@ -0,0 +1,48 @@ +process SAMTOOLS_INDEX { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/samtools:1.18--h50ea8bc_1' : + 'biocontainers/samtools:1.18--h50ea8bc_1' }" + + input: + tuple val(meta), path(input) + + output: + tuple val(meta), path("*.bai") , optional:true, emit: bai + tuple val(meta), path("*.csi") , optional:true, emit: csi + tuple val(meta), path("*.crai"), optional:true, emit: crai + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + samtools \\ + index \\ + -@ ${task.cpus-1} \\ + $args \\ + $input + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ + + stub: + """ + touch ${input}.bai + touch ${input}.crai + touch ${input}.csi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/samtools/index/meta.yml b/modules/nf-core/samtools/index/meta.yml new file mode 100644 index 00000000..01a4ee03 --- /dev/null +++ b/modules/nf-core/samtools/index/meta.yml @@ -0,0 +1,57 @@ +name: samtools_index +description: Index SAM/BAM/CRAM file +keywords: + - index + - bam + - sam + - cram +tools: + - samtools: + description: | + SAMtools is a set of utilities for interacting with and post-processing + short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li. + These files are generated as output by short read aligners like BWA. + homepage: http://www.htslib.org/ + documentation: http://www.htslib.org/doc/samtools.html + doi: 10.1093/bioinformatics/btp352 + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bai: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - crai: + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" + - csi: + type: file + description: CSI index file + pattern: "*.{csi}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@drpatelh" + - "@ewels" + - "@maxulysse" +maintainers: + - "@drpatelh" + - "@ewels" + - "@maxulysse" diff --git a/modules/nf-core/samtools/index/tests/csi.nextflow.config b/modules/nf-core/samtools/index/tests/csi.nextflow.config new file mode 100644 index 00000000..0ed260ef --- /dev/null +++ b/modules/nf-core/samtools/index/tests/csi.nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_INDEX { + ext.args = '-c' + } + +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test new file mode 100644 index 00000000..c76a9169 --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -0,0 +1,87 @@ +nextflow_process { + + name "Test Process SAMTOOLS_INDEX" + script "../main.nf" + process "SAMTOOLS_INDEX" + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/index" + + test("sarscov2 [BAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.bai).match("bai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CRAI]") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_cram'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.crai).match("crai") }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } + + test("homo_sapiens [CSI]") { + + config "./csi.nextflow.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert path(process.out.csi.get(0).get(1)).exists() }, + { assert path(process.out.versions.get(0)).getText().contains("samtools") } + ) + } + } +} diff --git a/modules/nf-core/samtools/index/tests/main.nf.test.snap b/modules/nf-core/samtools/index/tests/main.nf.test.snap new file mode 100644 index 00000000..b3baee7f --- /dev/null +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -0,0 +1,28 @@ +{ + "crai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ] + ], + "timestamp": "2023-11-15T15:17:37.30801" + }, + "bai": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ] + ], + "timestamp": "2023-11-15T15:17:30.869234" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/index/tests/tags.yml b/modules/nf-core/samtools/index/tests/tags.yml new file mode 100644 index 00000000..e0f58a7a --- /dev/null +++ b/modules/nf-core/samtools/index/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/index: + - modules/nf-core/samtools/index/** diff --git a/subworkflows/local/read_coverage.nf b/subworkflows/local/read_coverage.nf index 32e2f648..03cf99c1 100755 --- a/subworkflows/local/read_coverage.nf +++ b/subworkflows/local/read_coverage.nf @@ -3,68 +3,118 @@ // // MODULE IMPORT BLOCK // -include { BEDTOOLS_BAMTOBED } from '../../modules/nf-core/bedtools/bamtobed/main' -include { BEDTOOLS_GENOMECOV } from '../../modules/nf-core/bedtools/genomecov/main' -include { BEDTOOLS_MERGE as BEDTOOLS_MERGE_MAX } from '../../modules/nf-core/bedtools/merge/main' -include { BEDTOOLS_MERGE as BEDTOOLS_MERGE_MIN } from '../../modules/nf-core/bedtools/merge/main' -include { GNU_SORT } from '../../modules/nf-core/gnu/sort/main' -include { MINIMAP2_INDEX } from '../../modules/nf-core/minimap2/index/main' -include { MINIMAP2_ALIGN as MINIMAP2_ALIGN_SPLIT } from '../../modules/nf-core/minimap2/align/main' -include { MINIMAP2_ALIGN } from '../../modules/nf-core/minimap2/align/main' -include { SAMTOOLS_MERGE } from '../../modules/nf-core/samtools/merge/main' -include { SAMTOOLS_SORT } from '../../modules/nf-core/samtools/sort/main' -include { SAMTOOLS_VIEW } from '../../modules/nf-core/samtools/view/main' -include { UCSC_BEDGRAPHTOBIGWIG as BED2BW_NORMAL } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main' -include { UCSC_BEDGRAPHTOBIGWIG as BED2BW_LOG } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main' -include { GRAPHOVERALLCOVERAGE } from '../../modules/local/graphoverallcoverage' -include { GETMINMAXPUNCHES } from '../../modules/local/getminmaxpunches' -include { FINDHALFCOVERAGE } from '../../modules/local/findhalfcoverage' -include { LONGREADCOVERAGESCALELOG } from '../../modules/local/longreadcoveragescalelog' - -workflow LONGREAD_COVERAGE { +include { BEDTOOLS_BAMTOBED } from '../../modules/nf-core/bedtools/bamtobed/main' +include { BEDTOOLS_GENOMECOV } from '../../modules/nf-core/bedtools/genomecov/main' +include { BEDTOOLS_MERGE as BEDTOOLS_MERGE_MAX } from '../../modules/nf-core/bedtools/merge/main' +include { BEDTOOLS_MERGE as BEDTOOLS_MERGE_MIN } from '../../modules/nf-core/bedtools/merge/main' +include { GNU_SORT } from '../../modules/nf-core/gnu/sort/main' +include { MINIMAP2_ALIGN } from '../../modules/nf-core/minimap2/align/main' +include { SAMTOOLS_MERGE } from '../../modules/nf-core/samtools/merge/main' +include { SAMTOOLS_SORT } from '../../modules/nf-core/samtools/sort/main' +include { SAMTOOLS_INDEX } from '../../modules/nf-core/samtools/index/main' +include { SAMTOOLS_VIEW as SAMTOOLS_VIEW_FILTER_PRIMARY } from '../../modules/nf-core/samtools/view/main' +include { UCSC_BEDGRAPHTOBIGWIG as BED2BW_NORMAL } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main' +include { UCSC_BEDGRAPHTOBIGWIG as BED2BW_LOG } from '../../modules/nf-core/ucsc/bedgraphtobigwig/main' +include { GRAPHOVERALLCOVERAGE } from '../../modules/local/graphoverallcoverage' +include { GETMINMAXPUNCHES } from '../../modules/local/getminmaxpunches' +include { FINDHALFCOVERAGE } from '../../modules/local/findhalfcoverage' +include { LONGREADCOVERAGESCALELOG } from '../../modules/local/longreadcoveragescalelog' + +workflow READ_COVERAGE { take: - reference_tuple // Channel: tuple [ val(meta), file( reference_file ) ] + reference_ch // Channel: tuple [ val(meta), file( reference_file ) ] dot_genome // Channel: tuple [ val(meta), [ file( datafile ) ] ] - reads_path // Channel: tuple [ val(meta), val( str ) ] + read_ch // Channel: tuple [ val(meta), val( str ) ] read channel (.fasta.gz) main: ch_versions = Channel.empty() // - // LOGIC: CHECK IF THE INPUT READ FILE IS PAIRED END OR SINGLE END BASED ON THE READ PLATFORM, THEN RUN MINIMAP - // - if ( platform.filter { it == "hifi" } || platform.filter { it == "clr" } || platform.filter { it == "ont" } ) { - SE_MAPPING ( - reference_tuple, - assembly_path, - pacbio_tuple, - platform - ) - ch_versions = ch_versions.mix(SE_MAPPING.out.versions) - ch_align_bam - .mix( SE_MAPPING.out.mapped_bam ) - .set { merged_bam } - } - else if ( platform.filter { it == "illumina" } ) { - - PE_MAPPING ( - reference_tuple, - assembly_path, - pacbio_tuple, - platform - ) - ch_versions = ch_versions.mix(PE_MAPPING.out.versions) - ch_align_bam - .mix( PE_MAPPING.out.mapped_bam ) - .set { merged_bam } - } + // LOGIC: TAKE THE READ FOLDER AS INPUT AND GENERATE THE CHANNEL OF READ FILES + // + ch_grabbed_reads_path = GrabFiles( read_ch ) + + ch_grabbed_reads_path + .map { meta, files -> + tuple( files ) + } + .flatten() + .set { ch_reads_path } + + // + // LOGIC: PREPARE FOR MINIMAP2, USING READ_TYPE AS FILTER TO DEFINE THE MAPPING METHOD, CHECK YAML_INPUT.NF + // + reference_ch + .combine( ch_reads_path ) + .combine( read_ch) + .map { meta, ref, reads_path, read_meta, readfolder -> + tuple( + [ id : meta.id, + single_end : read_meta.single_end, + readtype : read_meta.read_type.toString() + ], + reads_path, + ref, + true, + false, + false, + read_meta.read_type.toString() + ) + } + .set { pre_minimap_input } + + pre_minimap_input + .multiMap { meta, reads_path, ref, bam_output, cigar_paf, cigar_bam, reads_type -> + read_tuple : tuple( meta, reads_path) + ref : ref + bool_bam_ouput : bam_output + bool_cigar_paf : cigar_paf + bool_cigar_bam : cigar_bam + } + .set { minimap_input } + + // + // LOGIC: MINIMAP ALIGNMENT + // + MINIMAP2_ALIGN ( + minimap_input.read_tuple, + minimap_input.ref, + minimap_input.bool_bam_ouput, + minimap_input.bool_cigar_paf, + minimap_input.bool_cigar_bam + ) + ch_versions = ch_versions.mix(MINIMAP2_ALIGN.out.versions) + ch_bams = MINIMAP2_ALIGN.out.bam + + ch_bams + .map { meta, file -> + tuple( file ) + } + .collect() + .map { file -> + tuple ( + [ id : file[0].toString().split('/')[-1].split('_')[0] ], // Change sample ID + file + ) + } + .set { collected_files_for_merge } + + // + // MODULE: MERGE ALL OUTPUT BAM + // + SAMTOOLS_MERGE( + collected_files_for_merge, + reference_ch, + [[],[]] + ) + ch_versions = ch_versions.mix(SAMTOOLS_MERGE.out.versions) // // MODULE: SORT MAPPED BAM // SAMTOOLS_SORT ( - merged_bam + SAMTOOLS_MERGE.out.bam ) ch_versions = ch_versions.mix( SAMTOOLS_SORT.out.versions ) @@ -79,7 +129,7 @@ workflow LONGREAD_COVERAGE { // LOGIC: PREPARING MERGE INPUT WITH REFERENCE GENOME AND REFERENCE INDEX // SAMTOOLS_SORT.out.bam - .combine( reference_tuple ) + .combine( reference_ch ) .multiMap { meta, bam, ref_meta, ref -> bam_input : tuple( [ id : meta.id, @@ -97,18 +147,18 @@ workflow LONGREAD_COVERAGE { // // MODULE: EXTRACT READS FOR PRIMARY ASSEMBLY // - SAMTOOLS_VIEW( + SAMTOOLS_VIEW_FILTER_PRIMARY( view_input.bam_input, view_input.ref_input, [] ) - ch_versions = ch_versions.mix(SAMTOOLS_VIEW.out.versions) + ch_versions = ch_versions.mix(SAMTOOLS_VIEW_FILTER_PRIMARY.out.versions) // // MODULE: BAM TO PRIMARY BED // BEDTOOLS_BAMTOBED( - SAMTOOLS_VIEW.out.bam + SAMTOOLS_VIEW_FILTER_PRIMARY.out.bam ) ch_versions = ch_versions.mix(BEDTOOLS_BAMTOBED.out.versions) @@ -208,7 +258,7 @@ workflow LONGREAD_COVERAGE { // GNU_SORT.out.sorted .combine( dot_genome ) - .combine(reference_tuple) + .combine(reference_ch) .multiMap { meta, file, meta_my_genome, my_genome, ref_meta, ref -> ch_coverage_bed : tuple ([ id: ref_meta.id, single_end: true], file) genome_file : my_genome @@ -237,7 +287,7 @@ workflow LONGREAD_COVERAGE { // LONGREADCOVERAGESCALELOG.out.bed .combine( dot_genome ) - .combine(reference_tuple) + .combine(reference_ch) .multiMap { meta, file, meta_my_genome, my_genome, ref_meta, ref -> ch_coverage_bed : tuple ([ id: ref_meta.id, single_end: true], file) genome_file : my_genome @@ -256,10 +306,10 @@ workflow LONGREAD_COVERAGE { // // LOGIC: GENERATE A SUMMARY TUPLE FOR OUTPUT // - ch_grabbed_read_paths + ch_grabbed_reads_path .collect() .map { meta, fasta -> - tuple( [ id: 'pacbio', + tuple( [ id: 'read', sz: fasta instanceof ArrayList ? fasta.collect { it.size()} : fasta.size() ], fasta ) @@ -286,7 +336,7 @@ process GrabFiles { tuple val(meta), path("in") output: - tuple val(meta), path("in/*.fasta.gz") + tuple val(meta), path("in/*.{fa,fasta}.{gz}") "true" } diff --git a/subworkflows/local/yaml_input.nf b/subworkflows/local/yaml_input.nf index 4cdcecb7..609f0d13 100755 --- a/subworkflows/local/yaml_input.nf +++ b/subworkflows/local/yaml_input.nf @@ -49,8 +49,8 @@ workflow YAML_INPUT { group .assembly_reads .multiMap { data -> - longread_type: data.longread_type - longread_data: data.longread_data + read_type: data.read_type + read_data: data.read_data hic: data.hic_data supplement: data.supplementary_data } @@ -125,18 +125,34 @@ workflow YAML_INPUT { } .set { ref_ch } - tolid_version - .combine( assem_reads.longread_type ) - .combine( assem_reads.longread_data ) - .map{ sample, type, data -> - tuple( [ id : sample, - single_end : true, - longread_type : type - ], - data - ) - } - .set { longread_ch } + if ( assem_reads.read_type.filter { it == "hifi" } || assem_reads.read_type.filter { it == "clr" } || assem_reads.read_type.filter { it == "ont" } ) { + tolid_version + .combine( assem_reads.read_type ) + .combine( assem_reads.read_data ) + .map{ sample, type, data -> + tuple( [ id : sample, + single_end : true, + read_type : type + ], + data + ) + } + .set { read_ch } + } + else if ( assem_reads.read_type.filter { it == "illumina" } ) { + tolid_version + .combine( assem_reads.read_type ) + .combine( assem_reads.read_data ) + .map{ sample, type, data -> + tuple( [ id : sample, + single_end : false, + read_type : type + ], + data + ) + } + .set { read_ch } + } tolid_version .combine( assem_reads.hic ) @@ -160,7 +176,7 @@ workflow YAML_INPUT { assembly_id = tolid_version reference_ch = ref_ch - longreads_ch = longread_ch + read_ch = read_ch hic_reads_ch = hic_ch supp_reads_ch = supplement_ch From 64b6f75423afae0d55cfa2463e6742841a244c6b Mon Sep 17 00:00:00 2001 From: yumisims Date: Mon, 8 Jan 2024 19:11:26 +0000 Subject: [PATCH 03/16] change config --- conf/base.config | 6 +++--- conf/modules.config | 13 ++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/conf/base.config b/conf/base.config index 4d47205f..85cb0d52 100755 --- a/conf/base.config +++ b/conf/base.config @@ -110,9 +110,9 @@ process { } // Standard parameters, covers most insecta - withName: '.*:.*:LONGREAD_COVERAGE:(MINIMAP2_ALIGN|MINIMAP2_ALIGN_SPLIT)' { - cpus = { check_max( 16 * 1, 'cpus' ) } - memory = { check_max( 100.GB * task.attempt, 'memory' ) } + withName: '.*:.*:READ_COVERAGE:MINIMAP2_ALIGN' { + cpus = { check_max( 20 * 1, 'cpus' ) } + memory = { check_max( 50.GB * task.attempt, 'memory' ) } time = { check_max( 20.h * task.attempt, 'time' ) } } diff --git a/conf/modules.config b/conf/modules.config index b6015c12..810dfc96 100755 --- a/conf/modules.config +++ b/conf/modules.config @@ -68,11 +68,6 @@ process { ext.prefix = { "${meta.id}.sorted" } } - withName: MINIMAP2_ALIGN { - ext.args = {'-ax '+ (meta.readtype.equals("hifi") ? "map-hifi" : meta.readtype.equals("clr") ? "map-pb" : meta.readtype.equals("ont") ? "map-ont" : meta.readtype.equals("illumina") ? "sr" : "") + ' --cs=short' + (reference.size() > 3e9 ? (" -I" + Math.ceil(reference.size()/1073741824)+"G") : "") } - ext.prefix = { "${meta.id}_alignment_${reference.getName().tokenize('.')[0]}" } - } - // // SUBWORKFLOW: SELFCOMP // @@ -183,11 +178,11 @@ process { // - // SUBWORKFLOW: LONGREAD + // SUBWORKFLOW: READ_COVERAGE // - withName: ".*:.*:LONGREAD_COVERAGE:MINIMAP2_ALIGN" { - ext.args = "--MD -t 8" - ext.prefix = { "${meta.id}_alignment_${reference.getName().tokenize(".")[0]}" } + withName: MINIMAP2_ALIGN { + ext.args = {'-ax '+ (meta.readtype.equals("hifi") ? "map-hifi" : meta.readtype.equals("clr") ? "map-pb" : meta.readtype.equals("ont") ? "map-ont" : meta.readtype.equals("illumina") ? "sr" : "") + ' --cs=short -t 20' + (reference.size() > 2.5e9 ? (" -I" + Math.ceil(reference.size()/1073741824)+"G") : "") } + ext.prefix = { "${meta.id}_alignment_${reference.getName().tokenize('.')[0]}" } } withName: ".*:.*:READ_COVERAGE:SAMTOOLS_MERGE" { From b2773e8a089b9613687d788f7d94bb263706cf7d Mon Sep 17 00:00:00 2001 From: yumisims Date: Tue, 9 Jan 2024 16:38:16 +0000 Subject: [PATCH 04/16] changed byte size --- conf/modules.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/modules.config b/conf/modules.config index 810dfc96..c0b156d0 100755 --- a/conf/modules.config +++ b/conf/modules.config @@ -181,7 +181,7 @@ process { // SUBWORKFLOW: READ_COVERAGE // withName: MINIMAP2_ALIGN { - ext.args = {'-ax '+ (meta.readtype.equals("hifi") ? "map-hifi" : meta.readtype.equals("clr") ? "map-pb" : meta.readtype.equals("ont") ? "map-ont" : meta.readtype.equals("illumina") ? "sr" : "") + ' --cs=short -t 20' + (reference.size() > 2.5e9 ? (" -I" + Math.ceil(reference.size()/1073741824)+"G") : "") } + ext.args = {'-ax '+ (meta.readtype.equals("hifi") ? "map-hifi" : meta.readtype.equals("clr") ? "map-pb" : meta.readtype.equals("ont") ? "map-ont" : meta.readtype.equals("illumina") ? "sr" : "") + ' --cs=short' + (reference.size() > 2.5e9 ? (" -I" + Math.ceil(reference.size()/1000000000)+"G") : "") } ext.prefix = { "${meta.id}_alignment_${reference.getName().tokenize('.')[0]}" } } From 9dbd91ed83ed5b8bf2388bbe1902949ceee067dd Mon Sep 17 00:00:00 2001 From: yumisims Date: Wed, 10 Jan 2024 10:31:34 +0000 Subject: [PATCH 05/16] changed minimap2 module --- modules/nf-core/minimap2/align/main.nf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/minimap2/align/main.nf b/modules/nf-core/minimap2/align/main.nf index 4da47c18..e2f5f0d7 100755 --- a/modules/nf-core/minimap2/align/main.nf +++ b/modules/nf-core/minimap2/align/main.nf @@ -26,7 +26,7 @@ process MINIMAP2_ALIGN { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def bam_output = bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf" + def bam_output = reference.size() > 2.5e9 && bam_format ? "-a | samtools view -b -T ${reference} - > ${prefix}.bam" : reference.size() < 2.5e9 && bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf" def cigar_paf = cigar_paf_format && !bam_format ? "-c" : '' def set_cigar_bam = cigar_bam && bam_format ? "-L" : '' """ @@ -38,11 +38,23 @@ process MINIMAP2_ALIGN { $cigar_paf \\ $set_cigar_bam \\ $bam_output + cat <<-END_VERSIONS > versions.yml + "${task.process}": + minimap2: \$(minimap2 --version 2>&1) + END_VERSIONS + """ + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def bam_output = reference.size() > 2.5e9 && bam_format ? "-a | samtools view -b -T ${reference} - > ${prefix}.bam" : reference.size() < 2.5e9 && bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf" + def cigar_paf = cigar_paf_format && !bam_format ? "-c" : '' + def set_cigar_bam = cigar_bam && bam_format ? "-L" : '' + def extension = bam_format ? "bam" : "paf" + """ + touch ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": minimap2: \$(minimap2 --version 2>&1) END_VERSIONS - """ } From 34db5aec060f4f7ac824f4a113c572a774ad9878 Mon Sep 17 00:00:00 2001 From: yumisims Date: Wed, 10 Jan 2024 11:14:47 +0000 Subject: [PATCH 06/16] changed format --- modules.json | 150 +++++++++++++-------------------------------------- 1 file changed, 38 insertions(+), 112 deletions(-) diff --git a/modules.json b/modules.json index b6bc0dd1..958f4a45 100755 --- a/modules.json +++ b/modules.json @@ -8,262 +8,188 @@ "bedtools/bamtobed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/genomecov": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/intersect": { "branch": "master", "git_sha": "c1532c77717ad7c64752b26b0fd9b4556bdef272", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/makewindows": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/map": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/merge": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/sort": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "busco": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bwamem2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "cat/cat": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "cooler/cload": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "cooler/zoomify": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "custom/getchromsizes": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ], + "installed_by": ["modules"], "patch": "modules/nf-core/custom/getchromsizes/custom-getchromsizes.diff" }, "fastk/fastk": { "branch": "master", "git_sha": "29e87a37ae1887fc8289f2f56775604a71715cb9", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "gnu/sort": { "branch": "master", "git_sha": "88f6e982fb8bd40488d837b3b08a65008e602840", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "merquryfk/merquryfk": { "branch": "master", "git_sha": "6f150e1503c0826c21fedf1fa566cdbecbe98ec7", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "minimap2/align": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "minimap2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "miniprot/align": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "miniprot/index": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "mummer": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "paftools/sam2paf": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "pretextmap": { "branch": "master", "git_sha": "decfb802f2e573efb7b44ff06b11ecf16853054d", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "pretextsnapshot": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/faidx": { "branch": "master", "git_sha": "fd742419940e01ba1c5ecb172c3e32ec840662fe", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/index": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/markdup": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/merge": { "branch": "master", "git_sha": "0460d316170f75f323111b4a2c0a2989f0c32013", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/sort": { "branch": "master", "git_sha": "a0f7be95788366c1923171e358da7d049eb440f9", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/view": { "branch": "master", "git_sha": "3ffae3598260a99e8db3207dead9f73f87f90d1f", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "seqtk/cutn": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "tabix/bgziptabix": { "branch": "master", "git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "ucsc/bedgraphtobigwig": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "ucsc/bedtobigbed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "windowmasker/mk_counts": { "branch": "master", "git_sha": "30c3ed32e8bd5ddaf349ba2f4f99d38182fdc08c", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "windowmasker/ustat": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] } } }, @@ -272,4 +198,4 @@ } } } -} \ No newline at end of file +} From e5c1e95808a6165c89c74c33966c007142194d38 Mon Sep 17 00:00:00 2001 From: yumisims Date: Wed, 10 Jan 2024 14:17:13 +0000 Subject: [PATCH 07/16] patch fix --- modules.json | 151 +++++++++++++----- modules/nf-core/minimap2/align/main.nf | 1 + .../minimap2/align/minimap2-align.diff | 35 ++++ 3 files changed, 149 insertions(+), 38 deletions(-) create mode 100644 modules/nf-core/minimap2/align/minimap2-align.diff diff --git a/modules.json b/modules.json index 958f4a45..a3e5c795 100755 --- a/modules.json +++ b/modules.json @@ -8,188 +8,263 @@ "bedtools/bamtobed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/genomecov": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/intersect": { "branch": "master", "git_sha": "c1532c77717ad7c64752b26b0fd9b4556bdef272", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/makewindows": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/map": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/merge": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bedtools/sort": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "busco": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "bwamem2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "cat/cat": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "cooler/cload": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "cooler/zoomify": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "custom/dumpsoftwareversions": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "custom/getchromsizes": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"], + "installed_by": [ + "modules" + ], "patch": "modules/nf-core/custom/getchromsizes/custom-getchromsizes.diff" }, "fastk/fastk": { "branch": "master", "git_sha": "29e87a37ae1887fc8289f2f56775604a71715cb9", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "gnu/sort": { "branch": "master", "git_sha": "88f6e982fb8bd40488d837b3b08a65008e602840", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "merquryfk/merquryfk": { "branch": "master", "git_sha": "6f150e1503c0826c21fedf1fa566cdbecbe98ec7", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "minimap2/align": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ], + "patch": "modules/nf-core/minimap2/align/minimap2-align.diff" }, "minimap2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "miniprot/align": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "miniprot/index": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "mummer": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "paftools/sam2paf": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "pretextmap": { "branch": "master", "git_sha": "decfb802f2e573efb7b44ff06b11ecf16853054d", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "pretextsnapshot": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/faidx": { "branch": "master", "git_sha": "fd742419940e01ba1c5ecb172c3e32ec840662fe", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/index": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/markdup": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/merge": { "branch": "master", "git_sha": "0460d316170f75f323111b4a2c0a2989f0c32013", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/sort": { "branch": "master", "git_sha": "a0f7be95788366c1923171e358da7d049eb440f9", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "samtools/view": { "branch": "master", "git_sha": "3ffae3598260a99e8db3207dead9f73f87f90d1f", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "seqtk/cutn": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "tabix/bgziptabix": { "branch": "master", "git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "ucsc/bedgraphtobigwig": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "ucsc/bedtobigbed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "windowmasker/mk_counts": { "branch": "master", "git_sha": "30c3ed32e8bd5ddaf349ba2f4f99d38182fdc08c", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] }, "windowmasker/ustat": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": ["modules"] + "installed_by": [ + "modules" + ] } } }, @@ -198,4 +273,4 @@ } } } -} +} \ No newline at end of file diff --git a/modules/nf-core/minimap2/align/main.nf b/modules/nf-core/minimap2/align/main.nf index e2f5f0d7..209c80df 100755 --- a/modules/nf-core/minimap2/align/main.nf +++ b/modules/nf-core/minimap2/align/main.nf @@ -57,4 +57,5 @@ process MINIMAP2_ALIGN { "${task.process}": minimap2: \$(minimap2 --version 2>&1) END_VERSIONS + """ } diff --git a/modules/nf-core/minimap2/align/minimap2-align.diff b/modules/nf-core/minimap2/align/minimap2-align.diff new file mode 100644 index 00000000..849e026d --- /dev/null +++ b/modules/nf-core/minimap2/align/minimap2-align.diff @@ -0,0 +1,35 @@ +Changes in module 'nf-core/minimap2/align' +--- modules/nf-core/minimap2/align/main.nf ++++ modules/nf-core/minimap2/align/main.nf +@@ -26,7 +26,7 @@ + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" +- def bam_output = bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf" ++ def bam_output = reference.size() > 2.5e9 && bam_format ? "-a | samtools view -b -T ${reference} - > ${prefix}.bam" : reference.size() < 2.5e9 && bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf" + def cigar_paf = cigar_paf_format && !bam_format ? "-c" : '' + def set_cigar_bam = cigar_bam && bam_format ? "-L" : '' + """ +@@ -38,7 +38,20 @@ + $cigar_paf \\ + $set_cigar_bam \\ + $bam_output ++ cat <<-END_VERSIONS > versions.yml ++ "${task.process}": ++ minimap2: \$(minimap2 --version 2>&1) ++ END_VERSIONS ++ """ + ++ stub: ++ def prefix = task.ext.prefix ?: "${meta.id}" ++ def bam_output = reference.size() > 2.5e9 && bam_format ? "-a | samtools view -b -T ${reference} - > ${prefix}.bam" : reference.size() < 2.5e9 && bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf" ++ def cigar_paf = cigar_paf_format && !bam_format ? "-c" : '' ++ def set_cigar_bam = cigar_bam && bam_format ? "-L" : '' ++ def extension = bam_format ? "bam" : "paf" ++ """ ++ touch ${prefix}.${extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + +************************************************************ From afc9cd72a6c803fe1a41213972e9c720ca7120de Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 15:45:06 +0000 Subject: [PATCH 08/16] changes based on comments --- modules.json | 150 +++++++--------------------- subworkflows/local/pe_mapping.nf | 116 --------------------- subworkflows/local/read_coverage.nf | 4 +- subworkflows/local/se_mapping.nf | 116 --------------------- 4 files changed, 41 insertions(+), 345 deletions(-) delete mode 100644 subworkflows/local/pe_mapping.nf delete mode 100644 subworkflows/local/se_mapping.nf diff --git a/modules.json b/modules.json index a3e5c795..069a3f09 100755 --- a/modules.json +++ b/modules.json @@ -8,263 +8,189 @@ "bedtools/bamtobed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/genomecov": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/intersect": { "branch": "master", "git_sha": "c1532c77717ad7c64752b26b0fd9b4556bdef272", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/makewindows": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/map": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/merge": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bedtools/sort": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "busco": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "bwamem2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "cat/cat": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "cooler/cload": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "cooler/zoomify": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "custom/getchromsizes": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ], + "installed_by": ["modules"], "patch": "modules/nf-core/custom/getchromsizes/custom-getchromsizes.diff" }, "fastk/fastk": { "branch": "master", "git_sha": "29e87a37ae1887fc8289f2f56775604a71715cb9", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "gnu/sort": { "branch": "master", "git_sha": "88f6e982fb8bd40488d837b3b08a65008e602840", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "merquryfk/merquryfk": { "branch": "master", "git_sha": "6f150e1503c0826c21fedf1fa566cdbecbe98ec7", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "minimap2/align": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": [ - "modules" - ], + "installed_by": ["modules"], "patch": "modules/nf-core/minimap2/align/minimap2-align.diff" }, "minimap2/index": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "miniprot/align": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "miniprot/index": { "branch": "master", "git_sha": "8d737766e8f3c1417212b4b56acb959f3c356d26", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "mummer": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "paftools/sam2paf": { "branch": "master", "git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "pretextmap": { "branch": "master", "git_sha": "decfb802f2e573efb7b44ff06b11ecf16853054d", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "pretextsnapshot": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/faidx": { "branch": "master", "git_sha": "fd742419940e01ba1c5ecb172c3e32ec840662fe", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/index": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/markdup": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/merge": { "branch": "master", "git_sha": "0460d316170f75f323111b4a2c0a2989f0c32013", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/sort": { "branch": "master", "git_sha": "a0f7be95788366c1923171e358da7d049eb440f9", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "samtools/view": { "branch": "master", "git_sha": "3ffae3598260a99e8db3207dead9f73f87f90d1f", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "seqtk/cutn": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "tabix/bgziptabix": { "branch": "master", "git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "ucsc/bedgraphtobigwig": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "ucsc/bedtobigbed": { "branch": "master", "git_sha": "9e51255c4f8ec69fb6ccf68593392835f14fecb8", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "windowmasker/mk_counts": { "branch": "master", "git_sha": "30c3ed32e8bd5ddaf349ba2f4f99d38182fdc08c", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] }, "windowmasker/ustat": { "branch": "master", "git_sha": "726ee59cd9360a965d96ea9ea8770f16b8ddd6cc", - "installed_by": [ - "modules" - ] + "installed_by": ["modules"] } } }, @@ -273,4 +199,4 @@ } } } -} \ No newline at end of file +} diff --git a/subworkflows/local/pe_mapping.nf b/subworkflows/local/pe_mapping.nf deleted file mode 100644 index e88254d9..00000000 --- a/subworkflows/local/pe_mapping.nf +++ /dev/null @@ -1,116 +0,0 @@ -include { MINIMAP2_ALIGN as MINIMAP2_ALIGN_ILLUMINA } from '../../modules/nf-core/minimap2/align/main' -include { SAMTOOLS_MERGE } from '../../modules/nf-core/samtools/merge/main' - -workflow PE_MAPPING { - - take: - reference_tuple // Channel [ val(meta), path(file) ] - assembly_path // Channel path(file) - pacbio_tuple // Channel [ val(meta), val( str ) ] - reads_type // Channel val( str ) - - main: - ch_versions = Channel.empty() - - - // - // PROCESS: GETS PACBIO READ PATHS FROM READS_PATH - // - ch_grabbed_reads_path = GrabFiles( pacbio_tuple ) - - ch_grabbed_reads_path - .map { meta, files -> - tuple( files ) - } - .flatten() - .set { ch_reads_path } - - // - // PROCESS: MAKE MINIMAP INPUT CHANNEL - // - reference_tuple - .combine( ch_reads_path ) - .combine( reads_type ) - .map { meta, ref, reads_path, reads_type -> - tuple( - [ id : meta.id, - single_end : false, - readtype: reads_type.toString() - ], - reads_path, - ref, - true, - false, - false, - reads_type - ) - } - .set { pe_input } - - // - // PROCESS: MULTIMAP TO MAKE BOOLEAN ARGUMENTS - // - pe_input - .multiMap { meta, reads_path, ref, bam_output, cigar_paf, cigar_bam, reads_type -> - read_tuple : tuple( meta, read_path) - ref : ref - bool_bam_ouput : bam_output - bool_cigar_paf : cigar_paf - bool_cigar_bam : cigar_bam - } - .set { illumina_input } - - // - // MODULE: PAIRED END READ MAPPING USING MINIMAP - // - MINIMAP2_ALIGN_ILLUMINA ( - illumina_input.read_tuple, - illumina_input.ref, - illumina_input.bool_bam_ouput, - illumina_input.bool_cigar_paf, - illumina_input.bool_cigar_bam - ) - ch_versions = ch_versions.mix(MINIMAP2_ALIGN_ILLUMINA.out.versions) - - ch_bams = MINIMAP2_ALIGN_ILLUMINA.out.bam - - ch_bams - .map { meta, file -> - tuple( file ) - } - .collect() - .map { file -> - tuple ( - [ id : file[0].toString().split('/')[-1].split('_')[0] ], // Change sample ID - file - ) - } - .set { collected_files_for_merge } - - // - // MODULE: MERGE ALL OUTPUT BAM - // - SAMTOOLS_MERGE( - collected_files_for_merge, - reference_tuple, - [[],[]] - ) - ch_versions = ch_versions.mix(SAMTOOLS_MERGE.out.versions) - - emit: - versions = ch_versions.ifEmpty(null) - mapped_bam = SAMTOOLS_MERGE.out.bam -} - -process GrabFiles { - tag "${meta.id}" - executor 'local' - - input: - tuple val(meta), path("in") - - output: - tuple val(meta), path("in/*.{fa,fasta}.{gz}") - - "true" -} diff --git a/subworkflows/local/read_coverage.nf b/subworkflows/local/read_coverage.nf index 03cf99c1..0b08dce9 100755 --- a/subworkflows/local/read_coverage.nf +++ b/subworkflows/local/read_coverage.nf @@ -75,7 +75,7 @@ workflow READ_COVERAGE { .set { minimap_input } // - // LOGIC: MINIMAP ALIGNMENT + // PROCESS: MINIMAP ALIGNMENT // MINIMAP2_ALIGN ( minimap_input.read_tuple, @@ -125,6 +125,7 @@ workflow READ_COVERAGE { SAMTOOLS_SORT.out.bam ) ch_versions = ch_versions.mix( SAMTOOLS_INDEX.out.versions ) + // // LOGIC: PREPARING MERGE INPUT WITH REFERENCE GENOME AND REFERENCE INDEX // @@ -144,6 +145,7 @@ workflow READ_COVERAGE { ) } .set { view_input } + // // MODULE: EXTRACT READS FOR PRIMARY ASSEMBLY // diff --git a/subworkflows/local/se_mapping.nf b/subworkflows/local/se_mapping.nf deleted file mode 100644 index 2746e4bc..00000000 --- a/subworkflows/local/se_mapping.nf +++ /dev/null @@ -1,116 +0,0 @@ -include { MINIMAP2_ALIGN as MINIMAP2_ALIGN_SE } from '../../modules/nf-core/minimap2/align/main' -include { SAMTOOLS_MERGE } from '../../modules/nf-core/samtools/merge/main' - -workflow SE_MAPPING { - - take: - reference_tuple // Channel [ val(meta), path(file) ] - assembly_path // Channel path(file) - pacbio_tuple // Channel [ val(meta), path(file) ] - reads_type // Channel val( str ) - - main: - ch_versions = Channel.empty() - ch_align_bams = Channel.empty() - - // - // PROCESS: GETS PACBIO READ PATHS FROM READS_PATH - // - ch_grabbed_reads_path = GrabFiles( pacbio_tuple ) - - ch_grabbed_reads_path - .map { meta, files -> - tuple( files ) - } - .flatten() - .set { ch_reads_path } - - // - // PROCESS: MAKE MINIMAP INPUT CHANNEL AND MAKE BRANCHES BASED ON INPUT READ TYPE - // - reference_tuple - .combine( ch_reads_path ) - .combine( reads_type ) - .map { meta, ref, reads_path, reads_type -> - tuple( - [ id : meta.id, - single_end : true, - readtype : reads_type.toString() - ], - reads_path, - ref, - true, - false, - false, - reads_type - ) - } - .set { minimap_se_input } - - // - // PROCESS: MULTIMAP TO MAKE BOOLEAN ARGUMENTS FOR MINIMAP HIFI MAPPING INPUT - // - minimap_se_input - .multiMap { meta, reads_path, ref, bam_output, cigar_paf, cigar_bam, reads_type -> - read_tuple : tuple( meta, reads_path) - ref : ref - bool_bam_ouput : bam_output - bool_cigar_paf : cigar_paf - bool_cigar_bam : cigar_bam - } - .set { se_input } - - // - // MOUDLES: MAPPING DIFFERENT TYPE OF READ AGAINIST REFERENCE - // - - MINIMAP2_ALIGN_SE ( - se_input.read_tuple, - se_input.ref, - se_input.bool_bam_ouput, - se_input.bool_cigar_paf, - se_input.bool_cigar_bam - ) - ch_bams = MINIMAP2_ALIGN_SE.out.bam - - - ch_bams - .map { meta, file -> - tuple( file ) - } - .collect() - .map { file -> - tuple ( - [ id : file[0].toString().split('/')[-1].split('_')[0] ], // Change sample ID - file - ) - } - .set { collected_files_for_merge } - - // - // MODULE: MERGE ALL OUTPUT BAM - // - SAMTOOLS_MERGE( - collected_files_for_merge, - reference_tuple, - [[],[]] - ) - ch_versions = ch_versions.mix(SAMTOOLS_MERGE.out.versions) - - emit: - versions = ch_versions.ifEmpty(null) - mapped_bam = SAMTOOLS_MERGE.out.bam -} - -process GrabFiles { - tag "${meta.id}" - executor 'local' - - input: - tuple val(meta), path("in") - - output: - tuple val(meta), path("in/*.{fa,fasta}.{gz}") - - "true" -} From e0b24e917fd50c7502accbd891676b91cbb392b9 Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 16:49:37 +0000 Subject: [PATCH 09/16] add channel from galaxy --- subworkflows/local/yaml_input.nf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subworkflows/local/yaml_input.nf b/subworkflows/local/yaml_input.nf index 609f0d13..cf94c108 100755 --- a/subworkflows/local/yaml_input.nf +++ b/subworkflows/local/yaml_input.nf @@ -177,6 +177,9 @@ workflow YAML_INPUT { reference_ch = ref_ch read_ch = read_ch + + kmer_prof_file = kmer_prof + hic_reads_ch = hic_ch supp_reads_ch = supplement_ch From 90118457d758c371b9f307e5dd5e3ce6d1e0e2af Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 17:07:47 +0000 Subject: [PATCH 10/16] removed longread_coverage from rapid --- workflows/treeval_rapid.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/treeval_rapid.nf b/workflows/treeval_rapid.nf index 560cec19..9c45e8d7 100755 --- a/workflows/treeval_rapid.nf +++ b/workflows/treeval_rapid.nf @@ -26,7 +26,7 @@ include { YAML_INPUT } from '../subworkflows/ include { GENERATE_GENOME } from '../subworkflows/local/generate_genome' include { REPEAT_DENSITY } from '../subworkflows/local/repeat_density' include { GAP_FINDER } from '../subworkflows/local/gap_finder' -include { LONGREAD_COVERAGE } from '../subworkflows/local/longread_coverage' +include { READ_COVERAGE } from '../subworkflows/local/read_coverage' include { TELO_FINDER } from '../subworkflows/local/telo_finder' include { HIC_MAPPING } from '../subworkflows/local/hic_mapping' include { KMER } from '../subworkflows/local/kmer' From b83b0b9fb4c516bf352296cfa9ccf3689d149718 Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 17:13:09 +0000 Subject: [PATCH 11/16] corrected workflow name --- workflows/treeval_rapid.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflows/treeval_rapid.nf b/workflows/treeval_rapid.nf index 9c45e8d7..b8bcc8f1 100755 --- a/workflows/treeval_rapid.nf +++ b/workflows/treeval_rapid.nf @@ -101,10 +101,10 @@ workflow TREEVAL_RAPID { // // SUBWORKFLOW: Takes reference, pacbio reads // - LONGREAD_COVERAGE ( + READ_COVERAGE ( YAML_INPUT.out.reference_ch, GENERATE_GENOME.out.dot_genome, - YAML_INPUT.out.longreads_ch + YAML_INPUT.out.reads_ch ) ch_versions = ch_versions.mix( LONGREAD_COVERAGE.out.versions ) From f0e8f84fb28cc62bc1016d1860004e4dc34d3b11 Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 17:43:22 +0000 Subject: [PATCH 12/16] changed reads_ch to read_ch --- workflows/treeval_rapid.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/treeval_rapid.nf b/workflows/treeval_rapid.nf index b8bcc8f1..3a074c47 100755 --- a/workflows/treeval_rapid.nf +++ b/workflows/treeval_rapid.nf @@ -104,7 +104,7 @@ workflow TREEVAL_RAPID { READ_COVERAGE ( YAML_INPUT.out.reference_ch, GENERATE_GENOME.out.dot_genome, - YAML_INPUT.out.reads_ch + YAML_INPUT.out.read_ch ) ch_versions = ch_versions.mix( LONGREAD_COVERAGE.out.versions ) From d5319301a7fe0b938a7c88db523b48f5dbdc48d2 Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 17:54:41 +0000 Subject: [PATCH 13/16] changed reads_ch to read_ch --- workflows/treeval_rapid.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workflows/treeval_rapid.nf b/workflows/treeval_rapid.nf index 3a074c47..8a871297 100755 --- a/workflows/treeval_rapid.nf +++ b/workflows/treeval_rapid.nf @@ -106,7 +106,7 @@ workflow TREEVAL_RAPID { GENERATE_GENOME.out.dot_genome, YAML_INPUT.out.read_ch ) - ch_versions = ch_versions.mix( LONGREAD_COVERAGE.out.versions ) + ch_versions = ch_versions.mix( READ_COVERAGE.out.versions ) // // SUBWORKFLOW: Takes reads and assembly, produces kmer plot @@ -138,8 +138,8 @@ workflow TREEVAL_RAPID { YAML_INPUT.out.hic_reads_ch, YAML_INPUT.out.assembly_id, GAP_FINDER.out.gap_file, - LONGREAD_COVERAGE.out.ch_covbw_nor, - LONGREAD_COVERAGE.out.ch_covbw_log, + READ_COVERAGE.out.ch_covbw_nor, + READ_COVERAGE.out.ch_covbw_log, TELO_FINDER.out.bedgraph_file, REPEAT_DENSITY.out.repeat_density, params.entry From 606c6066df516f5b0044f9ebc188df3c8554cedc Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 18:06:47 +0000 Subject: [PATCH 14/16] changed reads_ch to read_ch --- workflows/treeval_rapid.nf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/workflows/treeval_rapid.nf b/workflows/treeval_rapid.nf index 8a871297..18d0f3c3 100755 --- a/workflows/treeval_rapid.nf +++ b/workflows/treeval_rapid.nf @@ -113,7 +113,7 @@ workflow TREEVAL_RAPID { // KMER ( YAML_INPUT.out.reference_ch, - YAML_INPUT.out.longreads_ch + YAML_INPUT.out.read_ch ) ch_versions = ch_versions.mix( KMER.out.versions ) @@ -123,7 +123,7 @@ workflow TREEVAL_RAPID { KMER_READ_COVERAGE ( GENERATE_GENOME.out.dot_genome, YAML_INPUT.out.reference_ch, - YAML_INPUT.out.longreads_ch, + YAML_INPUT.out.reads_ch, YAML_INPUT.out.kmer_prof_file ) ch_versions = ch_versions.mix( KMER_READ_COVERAGE.out.versions ) @@ -157,10 +157,10 @@ workflow TREEVAL_RAPID { // LOGIC: GENERATE SOME CHANNELS FOR REPORTING // YAML_INPUT.out.reference_ch - .combine( LONGREAD_COVERAGE.out.ch_reporting ) + .combine( READ_COVERAGE.out.ch_reporting ) .combine( HIC_MAPPING.out.ch_reporting ) .combine( CUSTOM_DUMPSOFTWAREVERSIONS.out.versions ) - .map { meta, reference, longread_meta, longread_files, hic_meta, hic_files, custom_file -> [ + .map { meta, reference, read_meta, read_files, hic_meta, hic_files, custom_file -> [ rf_data: tuple( [ id: meta.id, sz: file(reference).size(), @@ -169,7 +169,7 @@ workflow TREEVAL_RAPID { reference ), sample_id: meta.id, - pb_data: tuple( longread_meta, longread_files ), + pb_data: tuple( read_meta, read_files ), cm_data: tuple( hic_meta, hic_files ), custom: custom_file, ] From 06c0454a26e06baff3dd1cf6a19c1f555e54b2fa Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 18:14:26 +0000 Subject: [PATCH 15/16] changed reads_ch to read_ch --- workflows/treeval_rapid.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/treeval_rapid.nf b/workflows/treeval_rapid.nf index 18d0f3c3..57d13786 100755 --- a/workflows/treeval_rapid.nf +++ b/workflows/treeval_rapid.nf @@ -123,7 +123,7 @@ workflow TREEVAL_RAPID { KMER_READ_COVERAGE ( GENERATE_GENOME.out.dot_genome, YAML_INPUT.out.reference_ch, - YAML_INPUT.out.reads_ch, + YAML_INPUT.out.read_ch, YAML_INPUT.out.kmer_prof_file ) ch_versions = ch_versions.mix( KMER_READ_COVERAGE.out.versions ) From 88f566f6f164e416cbcacb519ccf4eab5c620311 Mon Sep 17 00:00:00 2001 From: yumisims Date: Thu, 11 Jan 2024 18:23:40 +0000 Subject: [PATCH 16/16] changed reads_ch to read_ch --- assets/github_testing/TreeValTinyTest.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/github_testing/TreeValTinyTest.yaml b/assets/github_testing/TreeValTinyTest.yaml index 24f85aed..834544e0 100755 --- a/assets/github_testing/TreeValTinyTest.yaml +++ b/assets/github_testing/TreeValTinyTest.yaml @@ -7,8 +7,8 @@ assembly: project_id: DTOL reference_file: /home/runner/work/treeval/treeval/TreeValTinyData/assembly/draft/grTriPseu1.fa assem_reads: - longread_type: hifi - longread_data: /home/runner/work/treeval/treeval/TreeValTinyData/genomic_data/pacbio/ + read_type: hifi + read_data: /home/runner/work/treeval/treeval/TreeValTinyData/genomic_data/pacbio/ hic_data: /home/runner/work/treeval/treeval/TreeValTinyData/genomic_data/hic-arima/ supplementary_data: path kmer_profile: