diff --git a/.nf-core.yml b/.nf-core.yml index 177a80fe..0bf7c36f 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -47,4 +47,4 @@ template: - igenomes - multiqc - fastqc - version: 2.0.3 + version: 2.1.0-dev diff --git a/CHANGELOG.md b/CHANGELOG.md index 81366e54..eafbbdad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [[v2.1.0-dev](https://github.com/sanger-tol/readmapping/releases/tag/2.1.0-dev)] - 2.1.0-dev - [release-date] + +### Enhancements & fixes + +- Support extra_header at read-file level to provide `@RG` and `@PG` lines (see [usage](docs/usage.md)) + ## [[v2.0.3](https://github.com/sanger-tol/readmapping/releases/tag/2.0.3)] - Hungarian Horntail (patch 3) - [2026-05-15] ### Enhancements & fixes diff --git a/CITATION.cff b/CITATION.cff index bfb43879..265d7c9a 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -57,7 +57,7 @@ license: MIT message: If you use this software, please cite it using the metadata from this file and all references from CITATIONS.md . repository-code: https://github.com/sanger-tol/readmapping -title: sanger-tol/readmapping v2.0.3 - Hungarian Horntail (patch 3) +title: sanger-tol/readmapping 2.1.0-dev - 2.1.0-dev type: software url: https://pipelines.tol.sanger.ac.uk/readmapping -version: 2.0.3 +version: 2.1.0-dev diff --git a/assets/samplesheet.csv b/assets/samplesheet.csv index b742ba18..9792153a 100644 --- a/assets/samplesheet.csv +++ b/assets/samplesheet.csv @@ -1,8 +1,8 @@ -specimen,run,datatype,datafile,library,barcode -SAMEA7524438,ERR6688599,illumina,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel1/illumina/31231_3_1.subset.cram,, -SAMEA7524439,ERR6688600,illumina,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel2/illumina/31231_4_1.subset.fastq.gz,, -SAMEA7524440,ERR6688402,hic,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/hic/35528_2_1.subset.cram,, -SAMEA7524440,PAE35587,ont,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/ont/PAE35587_pass_1f1f0707_115.subset.fastq.gz,, -SAMEA7524440,PAE35587_test,ont,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/ont/PAE35587_pass_1f1f0707_115.subset.addrg.bam,, -SAMEA7524440,ERR6939248,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200910_173211.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.bam,, -SAMEA7524440,ERR6939249,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz,,bc1022 +specimen,run,datatype,datafile,library,barcode,extra_header +SAMEA7524438,ERR6688599,illumina,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel1/illumina/31231_3_1.subset.cram,,, +SAMEA7524439,ERR6688600,illumina,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel2/illumina/31231_4_1.subset.fastq.gz,,, +SAMEA7524440,ERR6688402,hic,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/hic/35528_2_1.subset.cram,,,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/hic/35528_2_1.subset.header_no_rg.sam +SAMEA7524440,PAE35587,ont,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/ont/PAE35587_pass_1f1f0707_115.subset.fastq.gz,,, +SAMEA7524440,PAE35587_test,ont,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/ont/PAE35587_pass_1f1f0707_115.subset.addrg.bam,,, +SAMEA7524440,ERR6939248,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200910_173211.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.header_no_rg.bam,,,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200910_173211.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.header.sam +SAMEA7524440,ERR6939249,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz,,bc1022,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.header.sam diff --git a/assets/samplesheet_long_read.csv b/assets/samplesheet_long_read.csv index 7fbd570a..c3b7831c 100644 --- a/assets/samplesheet_long_read.csv +++ b/assets/samplesheet_long_read.csv @@ -1,4 +1,4 @@ -specimen,run,datatype,datafile,library,barcode -SAMEA7524440,PAE35587,ont,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/ont/PAE35587_pass_1f1f0707_115.subset.fastq.gz,, -SAMEA7524440,ERR6939248,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200910_173211.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.bam,,bc1022 -SAMEA7524440,ERR6939249,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz,,bc1022 +specimen,run,datatype,datafile,library,barcode,extra_header +SAMEA7524440,PAE35587,ont,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/ont/PAE35587_pass_1f1f0707_115.subset.fastq.gz,,, +SAMEA7524440,ERR6939248,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200910_173211.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.bam,,bc1022, +SAMEA7524440,ERR6939249,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz,,bc1022,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.header.sam diff --git a/assets/samplesheet_short_reads.csv b/assets/samplesheet_short_reads.csv index b7865466..8a466b65 100644 --- a/assets/samplesheet_short_reads.csv +++ b/assets/samplesheet_short_reads.csv @@ -1,4 +1,4 @@ -specimen,run,datatype,datafile,library,barcode +specimen,run,datatype,datafile,library,barcode,extra_header SAMEA7524438,ERR6688599,illumina,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel1/illumina/31231_3_1.subset.bam,, SAMEA7524439,ERR6688600,illumina,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel2/illumina/31231_4_1.subset.fastq.gz,, -SAMEA7524440,ERR6688402,hic,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/hic/35528_2_1.subset.cram,, +SAMEA7524440,ERR6688402,hic,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/hic/35528_2_1.subset.cram,,,https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/genomic_data/mMelMel3/hic/35528_2_1.subset.header_no_rg.sam diff --git a/assets/samplesheet_uli.csv b/assets/samplesheet_uli.csv index 793b6fe7..16ac2758 100644 --- a/assets/samplesheet_uli.csv +++ b/assets/samplesheet_uli.csv @@ -1,3 +1,3 @@ -specimen,run,datatype,datafile,library,barcode -SAMEA114784749,ERR14209104,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Acropora_cervicornis/genomic_data/m84093_241116_151316_s2.hifi_reads.bc2028.subset.bam,uli,bc2028 -SAMEA114784749,ERR14209104_test,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Acropora_cervicornis/genomic_data/m84093_241116_151316_s2.hifi_reads.bc2028.subset.bam,,bc2028 +specimen,run,datatype,datafile,library,barcode,extra_header +SAMEA114784749,ERR14209104,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Acropora_cervicornis/genomic_data/m84093_241116_151316_s2.hifi_reads.bc2028.subset.bam,uli,bc2028, +SAMEA114784749,ERR14209104_test,pacbio,https://tolit.cog.sanger.ac.uk/test-data/Acropora_cervicornis/genomic_data/m84093_241116_151316_s2.hifi_reads.bc2028.subset.bam,,bc2028, diff --git a/assets/schema_input.json b/assets/schema_input.json index 5a4d16de..4b2ac6d3 100644 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -45,6 +45,14 @@ "errorMessage": "Sample barcode cannot contain spaces", "default": "", "meta": ["barcode"] + }, + "extra_header": { + "type": "string", + "format": "file-path", + "exists": true, + "pattern": "^\\S+\\.sam$", + "errorMessage": "SAM header file cannot contain spaces and must be an uncompressed SAM file", + "meta": ["extra_header"] } }, "required": ["specimen", "run", "datatype", "datafile"] diff --git a/conf/modules.config b/conf/modules.config index 1c86d8f2..7c8ee275 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -113,6 +113,7 @@ process { } withName: SAMTOOLS_ADDREPLACERG { + ext.args = { "${meta.read_group}" } ext.prefix = { "${input.baseName}_addRG" } } @@ -219,7 +220,6 @@ process { // CRAM and index: from SAMTOOLS_CRAM if no header provided, else from SAMTOOLS_INDEX_CRAM saveAs: { filename -> if (filename == 'versions.yml' - || (task.process =~ /SAMTOOLS_CRAM/ && params.header && filename.matches('.*\\.(cram|crai)$')) || ((task.process =~ /SAMTOOLS_CRAM/) && filename.endsWith('.bam') )) { return null } diff --git a/docs/usage.md b/docs/usage.md index 8379b8dc..4c9294da 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -32,22 +32,23 @@ The samplesheet can have as many columns as you desire, however, there is a stri A final samplesheet file consisting of both HiC and PacBio data may look something like the one below. ```console -specimen,run,datatype,datafile,library,barcode -specimen1,run1,hic,hic1.cram,, -specimen1,run2,hic,hic2.cram,, -specimen2,run3,hic,hic3.cram,, -specimen2,run4,pacbio,pacbio1.bam,uli, -specimen3,run5,pacbio,pacbio2.bam,, +specimen,run,datatype,datafile,library,barcode,extra_header +specimen1,run1,hic,hic1.cram,,, +specimen1,run2,hic,hic2.cram,,, +specimen2,run3,hic,hic3.cram,,, +specimen2,run4,pacbio,pacbio1.bam,uli,,headers/pacbio_rg.sam +specimen3,run5,pacbio,pacbio2.bam,,, ``` -| Column | Description | -| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `specimen` | Identifier of the specimen. Usually a BioSpecimen accession, i,e. `SAMEA7521529`. | -| `run` | Identifier of the sequencing run. Usually the accession number of the data in INSDC. For example,`ERR9248445` (hic), `ERR9284044` (pacbio). | -| `datatype` | Type of sequencing data. Must be one of `hic`, `illumina`, `pacbio`, `pacbio_clr`, or `ont`. | -| `datafile` | Full path to read data file. Must be `bam`, `cram`, `fastq.gz` or `fq.gz` for `illumina` and `hic`. Must be `bam`, `fastq.gz` or `fq.gz` for `pacbio`, `pacbio_clr`, and `ont`. Note that FASTQ inputs should be interleaved if paired-end. | -| `library` | (Optional) The library value is a unique identifier which is assigned to read group (`@RG`) ID. If the library name is not specified, the pipeline will auto-create library name using the data filename provided in the samplesheet. | -| `barcode` | (Optional) Barcode identifier used to trim barcode adapter for PacBio reads. If empty, barcode-specific adapter sequences will not be trimmed. | +| Column | Description | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `specimen` | Identifier of the specimen. Usually a BioSpecimen accession, i,e. `SAMEA7521529`. | +| `run` | Identifier of the sequencing run. Usually the accession number of the data in INSDC. For example,`ERR9248445` (hic), `ERR9284044` (pacbio). | +| `datatype` | Type of sequencing data. Must be one of `hic`, `illumina`, `pacbio`, `pacbio_clr`, or `ont`. | +| `datafile` | Full path to read data file. Must be `bam`, `cram`, `fastq.gz` or `fq.gz` for `illumina` and `hic`. Must be `bam`, `fastq.gz` or `fq.gz` for `pacbio`, `pacbio_clr`, and `ont`. Note that FASTQ inputs should be interleaved if paired-end. | +| `library` | (Optional) The library value is a unique identifier which is assigned to read group (`@RG`) ID. If the library name is not specified, the pipeline will auto-create library name using the data filename provided in the samplesheet. | +| `barcode` | (Optional) Barcode identifier used to trim barcode adapter for PacBio reads. If empty, barcode-specific adapter sequences will not be trimmed. | +| `extra_header` | (Optional) Path to a SAM file containing additional SAM header lines including `@RG`, `@PG`. This information will be injected into output BAM/CRAM headers. `@RG` lines are overwritten, while `@PG` lines are added to the existing headers (auto add `.extra_header` to `@PG ID`). | An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline. diff --git a/modules.json b/modules.json index 979208ba..e8eb0fe0 100644 --- a/modules.json +++ b/modules.json @@ -130,7 +130,8 @@ "samtools/view": { "branch": "master", "git_sha": "2057a0a8dbd67000d08613a556570aa7184a7c89", - "installed_by": ["modules"] + "installed_by": ["modules"], + "patch": "modules/nf-core/samtools/view/samtools-view.diff" } } }, diff --git a/modules/local/samtools/reheader/samtools_replaceheader.nf b/modules/local/samtools/reheader/samtools_replaceheader.nf index d522ece5..ce84f57e 100644 --- a/modules/local/samtools/reheader/samtools_replaceheader.nf +++ b/modules/local/samtools/reheader/samtools_replaceheader.nf @@ -8,13 +8,13 @@ process SAMTOOLS_REHEADER { : 'community.wave.seqera.io/library/htslib_samtools:1.23.1--5b6bb4ede7e612e5'}" input: - tuple val(meta), path(file, stageAs: "input/*") - path(header) + tuple val(meta), path(file, stageAs: "input/*"), path(sample_extra_header, stageAs: "extra_header/*") + path(header_template) output: tuple val(meta), path("${prefix}.bam") , optional:true, emit: bam tuple val(meta), path("${prefix}.cram"), optional:true, emit: cram - tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools + tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'") , topic: versions, emit: versions_samtools when: task.ext.when == null || task.ext.when @@ -22,18 +22,28 @@ process SAMTOOLS_REHEADER { script: prefix = task.ext.prefix ?: "${meta.id}" suffix = file.getExtension() + def sq_template = header_template ? " | grep -v ^@SQ && grep '^@SQ' ${header_template}" : "" + // Suffix all PG IDs from sample extra_header to keep them distinct from native file-header PG IDs. + // Also rewrite matching PP references so the extra-header PG chain remains intact after suffixing. + def pg_extra = sample_extra_header ? "awk 'BEGIN { FS = OFS = \"\\t\" } FNR == NR { if (\$1 == \"@PG\") for (i = 1; i <= NF; i++) if (\$i ~ /^ID:/) { ids[substr(\$i, 4)] = 1; break } next } \$1 == \"@PG\" { for (i = 1; i <= NF; i++) { if (\$i ~ /^ID:/) { \$i = \$i \".extra_header\" } else if (\$i ~ /^PP:/) { pp = substr(\$i, 4); if (pp in ids) \$i = \"PP:\" pp \".extra_header\" } } print }' ${sample_extra_header} ${sample_extra_header} || true" : "true" + // Last inserted PG ID (after suffix) used to bridge native PG root via PP. + def pg_extra_last_id = sample_extra_header ? "awk 'BEGIN { FS = OFS = \"\\t\" } \$1 == \"@PG\" { for (i = 1; i <= NF; i++) if (\$i ~ /^ID:/) { last = substr(\$i, 4) \".extra_header\"; break } } END { if (last != \"\") print last }' ${sample_extra_header}" : "echo ''" if ("$file" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ # Replace SQ lines with those from external template - ( samtools view --no-PG --header-only ${file} | \\ - grep -v ^@SQ && grep ^@SQ ${header} ) > temp.header.sam + ( samtools view --no-PG --header-only ${file} \\ + ${sq_template} ) > temp.header.sam # custom sort for readability (retain order of insertion but sort groups by tag) + # Add PG lines from sample header and bridge native PG root to inserted chain + # Sort order: HD, SQ, RG, extra PG, PG, other + bridge_id="\$(${pg_extra_last_id})" ( grep ^@HD temp.header.sam || true && \\ grep ^@SQ temp.header.sam || true && \\ grep ^@RG temp.header.sam || true && \\ - grep ^@PG temp.header.sam || true && \\ + ${pg_extra} && \\ + awk -v bridge_id="\$bridge_id" 'BEGIN { FS = OFS = "\\t" } \$1 == "@PG" { if (!bridged) { has_pp = 0; for (i = 1; i <= NF; i++) if (\$i ~ /^PP:/) { has_pp = 1; break } if (!has_pp && bridge_id != "") \$0 = \$0 OFS "PP:" bridge_id; bridged = 1 } print; next }' temp.header.sam || true && \\ grep -v -E '^@HD|^@SQ|^@RG|^@PG' temp.header.sam || true; \\ ) > temp.sorted.header.sam diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index 724561bf..4031e7fe 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -12,6 +12,7 @@ process SAMTOOLS_VIEW { tuple val(meta2), path(fasta), path(fai) tuple val(meta3), path(qname) tuple val(meta4), path(bed) + tuple val(meta5), path(reheader_header) val index_format output: @@ -33,6 +34,9 @@ process SAMTOOLS_VIEW { def args2 = task.ext.args2 ?: '' prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta ? "--reference ${fasta}" : "" + def args_no_write_index = args.replaceAll(/(^|\\s)--write-index(\\s|$)/, ' ').trim() + def should_index = index_format || args.contains('--write-index') + def index_opt = index_format == 'bai' ? '-b' : index_format == 'csi' ? '-c' : '' file_type = args.contains("--output-fmt sam") ? "sam" : args.contains("--output-fmt bam") @@ -57,19 +61,49 @@ process SAMTOOLS_VIEW { error("Indexing not compatible with SAM output") } } - """ - # Note: --threads value represents *additional* CPUs to allocate (total CPUs = 1 + --threads). - samtools \\ - view \\ - --threads ${task.cpus - 1} \\ - ${reference} \\ - ${readnames} \\ - ${bedfile} \\ - ${args} \\ - -o ${output_file} \\ - ${input} \\ - ${args2} - """ + + if (reheader_header) { + """ + # Note: --threads value represents *additional* CPUs to allocate (total CPUs = 1 + --threads). + samtools \\ + view \\ + --threads ${task.cpus - 1} \\ + ${reference} \\ + ${readnames} \\ + ${bedfile} \\ + ${args_no_write_index} \\ + -o ${prefix}.${file_type} \\ + ${input} \\ + ${args2} + + # Build a complete header by preserving existing lines and replacing only @SQ from template. + ( samtools view --no-PG --header-only ${prefix}.${file_type} | grep -v '^@SQ' && grep '^@SQ' ${reheader_header} ) > temp.reheader.header.sam + + samtools reheader temp.reheader.header.sam ${prefix}.${file_type} > ${prefix}.reheader.${file_type} + mv ${prefix}.reheader.${file_type} ${prefix}.${file_type} + + if [[ "${should_index}" == "true" && "${file_type}" != "sam" ]]; then + samtools index --threads ${task.cpus - 1} ${index_opt} ${prefix}.${file_type} + if [[ -s ${prefix}.unselected.${file_type} ]]; then + samtools index --threads ${task.cpus - 1} ${index_opt} ${prefix}.unselected.${file_type} + fi + fi + """ + } else { + """ + # Note: --threads value represents *additional* CPUs to allocate (total CPUs = 1 + --threads). + samtools \\ + view \\ + --threads ${task.cpus - 1} \\ + ${reference} \\ + ${readnames} \\ + ${bedfile} \\ + ${args} \\ + -o ${output_file} \\ + ${input} \\ + ${args2} + """ + } stub: def args = task.ext.args ?: '' diff --git a/modules/nf-core/samtools/view/samtools-view.diff b/modules/nf-core/samtools/view/samtools-view.diff new file mode 100644 index 00000000..5b0c9ded --- /dev/null +++ b/modules/nf-core/samtools/view/samtools-view.diff @@ -0,0 +1,92 @@ +Changes in component 'nf-core/samtools/view' +'modules/nf-core/samtools/view/meta.yml' is unchanged +'modules/nf-core/samtools/view/environment.yml' is unchanged +Changes in 'samtools/view/main.nf': +--- modules/nf-core/samtools/view/main.nf ++++ modules/nf-core/samtools/view/main.nf +@@ -12,6 +12,7 @@ + tuple val(meta2), path(fasta), path(fai) + tuple val(meta3), path(qname) + tuple val(meta4), path(bed) ++ tuple val(meta5), path(reheader_header) + val index_format + + output: +@@ -33,6 +34,9 @@ + def args2 = task.ext.args2 ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def reference = fasta ? "--reference ${fasta}" : "" ++ def args_no_write_index = args.replaceAll(/(^|\\s)--write-index(\\s|$)/, ' ').trim() ++ def should_index = index_format || args.contains('--write-index') ++ def index_opt = index_format == 'bai' ? '-b' : index_format == 'csi' ? '-c' : '' + file_type = args.contains("--output-fmt sam") + ? "sam" + : args.contains("--output-fmt bam") +@@ -57,19 +61,49 @@ + error("Indexing not compatible with SAM output") + } + } +- """ +- # Note: --threads value represents *additional* CPUs to allocate (total CPUs = 1 + --threads). +- samtools \\ +- view \\ +- --threads ${task.cpus - 1} \\ +- ${reference} \\ +- ${readnames} \\ +- ${bedfile} \\ +- ${args} \\ +- -o ${output_file} \\ +- ${input} \\ +- ${args2} +- """ ++ ++ if (reheader_header) { ++ """ ++ # Note: --threads value represents *additional* CPUs to allocate (total CPUs = 1 + --threads). ++ samtools \\ ++ view \\ ++ --threads ${task.cpus - 1} \\ ++ ${reference} \\ ++ ${readnames} \\ ++ ${bedfile} \\ ++ ${args_no_write_index} \\ ++ -o ${prefix}.${file_type} \\ ++ ${input} \\ ++ ${args2} ++ ++ # Build a complete header by preserving existing lines and replacing only @SQ from template. ++ ( samtools view --no-PG --header-only ${prefix}.${file_type} | grep -v '^@SQ' && grep '^@SQ' ${reheader_header} ) > temp.reheader.header.sam ++ ++ samtools reheader temp.reheader.header.sam ${prefix}.${file_type} > ${prefix}.reheader.${file_type} ++ mv ${prefix}.reheader.${file_type} ${prefix}.${file_type} ++ ++ if [[ "${should_index}" == "true" && "${file_type}" != "sam" ]]; then ++ samtools index --threads ${task.cpus - 1} ${index_opt} ${prefix}.${file_type} ++ if [[ -s ${prefix}.unselected.${file_type} ]]; then ++ samtools index --threads ${task.cpus - 1} ${index_opt} ${prefix}.unselected.${file_type} ++ fi ++ fi ++ """ ++ } else { ++ """ ++ # Note: --threads value represents *additional* CPUs to allocate (total CPUs = 1 + --threads). ++ samtools \\ ++ view \\ ++ --threads ${task.cpus - 1} \\ ++ ${reference} \\ ++ ${readnames} \\ ++ ${bedfile} \\ ++ ${args} \\ ++ -o ${output_file} \\ ++ ${input} \\ ++ ${args2} ++ """ ++ } + + stub: + def args = task.ext.args ?: '' + +'modules/nf-core/samtools/view/tests/nextflow.config' is unchanged +'modules/nf-core/samtools/view/tests/main.nf.test' is unchanged +'modules/nf-core/samtools/view/tests/main.nf.test.snap' is unchanged +************************************************************ diff --git a/nextflow.config b/nextflow.config index f43ad01c..e67c1370 100644 --- a/nextflow.config +++ b/nextflow.config @@ -322,7 +322,7 @@ manifest { mainScript = 'main.nf' defaultBranch = 'main' nextflowVersion = '!>=25.04.0' - version = '2.0.3' + version = '2.1.0-dev' doi = '10.5281/zenodo.6563577' } diff --git a/nf-test.config b/nf-test.config index 0b2e3c59..27fd64a7 100644 --- a/nf-test.config +++ b/nf-test.config @@ -1,3 +1,7 @@ +// Force UTC so DT fields in BAM/CRAM headers don't shift across DST +System.setProperty('user.timezone', 'UTC') +TimeZone.setDefault(TimeZone.getTimeZone('UTC')) + config { // location for all nf-test tests testsDir "." diff --git a/subworkflows/local/align_long.nf b/subworkflows/local/align_long.nf index 2f3a8c8f..cc72428f 100644 --- a/subworkflows/local/align_long.nf +++ b/subworkflows/local/align_long.nf @@ -4,6 +4,7 @@ // Include local modules and subworkflows include { MERGE_OUTPUT } from '../../subworkflows/local/merge_output' +include { PREPARE_READ_GROUPS } from '../../subworkflows/local/prepare_read_groups' include { PACBIO_PREPROCESS } from '../../subworkflows/sanger-tol/pacbio_preprocess/main' include { PACBIO_PREPROCESS as PACBIO_PREPROCESS_ULI } from '../../subworkflows/sanger-tol/pacbio_preprocess/main' @@ -12,7 +13,6 @@ include { FASTX_MAP_LONG_READS } from '../../subworkflows/ // Include nf-core modules include { FASTQC as FASTQC_FILTERED } from '../../modules/nf-core/fastqc/main' include { GAWK as GAWK_MODIFY_YAML_BARCODE } from '../../modules/nf-core/gawk/main' -include { SAMTOOLS_SPLITHEADER } from '../../modules/nf-core/samtools/splitheader/main' include { SAMTOOLS_FASTQ } from '../../modules/nf-core/samtools/fastq/main' workflow ALIGN_LONG { @@ -30,39 +30,18 @@ workflow ALIGN_LONG { // // PRESERVE READ GROUP INFORMATION // - ch_reads_branch = reads - .map { meta, read_files -> [meta + [read_group: "-y -R $meta.read_group"], read_files] } - .branch { _meta, read_files -> - bam: read_files.name.endsWith("bam") - fastq: true - } - - // Extract read group information from BAM files if BAM files are provided as input - SAMTOOLS_SPLITHEADER(ch_reads_branch.bam) - - // Replace constructed read group information with the one extracted from BAM header - ch_bam_rg = SAMTOOLS_SPLITHEADER.out.readgroup - .join (ch_reads_branch.bam, by:0) - .map { meta, rg_file, bam -> - def rglines = file(rg_file).readLines() - def rg_args = rglines ? '-y ' + rglines.collect { line -> - // Add SM when not present to avoid errors from downstream tool (e.g. variant callers) - def l = line.contains("SM:") ? line - : meta.sample ? "${line}\tSM:${meta.sample}" - : "${line}\tSM:${meta.id}" - "-R '${l.replaceAll("\t", "\\\\t")}'" - }.join(' ') - : meta.read_group - [ meta + [read_group:rg_args], bam ] - } - - ch_reads_rg = ch_bam_rg.mix( ch_reads_branch.fastq ) + PREPARE_READ_GROUPS(reads, 'long') + ch_read_rg = PREPARE_READ_GROUPS.out.reads + ch_read_rg_branch = ch_read_rg.branch { _meta, read_files -> + bam: read_files.name.endsWith("bam") + fastq: true + } // // PACBIO READ PREPROCESSING // if (val_pacbio_adapter_fasta || val_pacbio_adapter_yaml || val_pacbio_uli_adapter) { // pacbio_adapter_fasta, pacbio_adapter_yaml, pacbio_uli_adapter always provided - ch_reads = ch_reads_rg + ch_reads = ch_read_rg .branch { meta, read_files -> pacbio: meta.datatype == "pacbio" // non pacbio includes ONT and pacbio clr @@ -84,7 +63,7 @@ workflow ALIGN_LONG { ch_yaml_meta = ch_reads.pacbio .combine( channel.fromPath(val_pacbio_adapter_yaml, checkIfExists: true) ) .map{ meta, _reads, yaml -> [ meta, yaml ]} - .branch { meta, yaml -> + .branch { meta, _yaml -> has_barcode: meta.barcode != null && !meta.barcode.isEmpty() no_barcode: true } @@ -144,8 +123,8 @@ workflow ALIGN_LONG { fastx = pacbio_fastx.mix( ch_reads.non_pacbio_fastx ) } else { // if no processing needed at all, prepare CRAM for alignment directly from original reads (both pacbio and non-pacbio reads) - bam_to_fastx = ch_bam_rg - fastx = ch_reads_branch.fastq + bam_to_fastx = ch_read_rg_branch.bam + fastx = ch_read_rg_branch.fastq } // readmapping take only 1 FASTA as reference SAMTOOLS_FASTQ ( bam_to_fastx, false ) diff --git a/subworkflows/local/align_short.nf b/subworkflows/local/align_short.nf index 0b035b5e..c2cf4c3d 100644 --- a/subworkflows/local/align_short.nf +++ b/subworkflows/local/align_short.nf @@ -2,10 +2,11 @@ // Align short read (HiC and Illumina) data against the genome // -include { CRAM_MAP_ILLUMINA_HIC as CRAM_MAP_ILLUMINA } from '../../subworkflows/sanger-tol/cram_map_illumina_hic' -include { MERGE_OUTPUT } from '../../subworkflows/local/merge_output' -include { SAMTOOLS_ADDREPLACERG } from '../../modules/nf-core/samtools/addreplacerg/main' -include { SAMTOOLS_VIEW as CONVERT_CRAM } from '../../modules/nf-core/samtools/view/main' +include { CRAM_MAP_ILLUMINA_HIC as CRAM_MAP_SHORT_READS } from '../../subworkflows/sanger-tol/cram_map_illumina_hic' +include { MERGE_OUTPUT } from '../../subworkflows/local/merge_output' +include { PREPARE_READ_GROUPS } from '../../subworkflows/local/prepare_read_groups' +include { SAMTOOLS_ADDREPLACERG } from '../../modules/nf-core/samtools/addreplacerg/main' +include { SAMTOOLS_VIEW as CONVERT_CRAM } from '../../modules/nf-core/samtools/view/main' workflow ALIGN_SHORT { take: @@ -14,54 +15,56 @@ workflow ALIGN_SHORT { main: + // + // SUBWORKFLOW: Preserve read-group information from optional extra_header metadata + // + PREPARE_READ_GROUPS(reads, 'short') + reads_with_rg = PREPARE_READ_GROUPS.out.reads + + // + // LOGIC: Convert FASTQ to CRAM and add RG information if needed + // // Check file types and branch - ch_reads = reads - .branch { - meta, reads_files -> - cram : reads_files.findAll { file -> file.name.endsWith(".cram") } - [meta + [from: "cram"], reads_files] - bam: reads_files.findAll { file -> file.name.endsWith(".bam") } - [meta + [from: "bam"], reads_files] - fastx: true - [meta + [from: "fastx"], reads_files] + ch_reads = reads_with_rg.branch { _meta, read_files -> + cram: read_files.name.endsWith(".cram") + non_cram: true } - // Convert FASTQ to CRAM only if FASTQ were provided as input - ch_reads_non_crams = ch_reads.fastx - .mix ( ch_reads.bam ) - .map { meta, file -> [ meta, file, [] ] } + ch_reads_non_crams = ch_reads.non_cram.map { meta, file -> [ meta, file, [] ] } fasta_dummy_idx = fasta.map { meta, fasta_file -> [ meta, fasta_file, [] ] } - CONVERT_CRAM ( ch_reads_non_crams, fasta_dummy_idx, [[],[]], [[],[]], "" ) + CONVERT_CRAM ( ch_reads_non_crams, fasta_dummy_idx, [[],[]], [[],[]], [[],[]], "" ) - ch_converted_crams = CONVERT_CRAM.out.cram - .branch { meta, cram -> - with_rg: meta.from == "bam" - without_rg: true + // Add read group information to CRAMs if not already present, and merge with CRAMs that already have RG information + ch_crams_to_addrg = CONVERT_CRAM.out.cram + .mix ( ch_reads.cram ) + .branch { meta, _cram -> + replace_rg: meta.replace_rg == true + not_replace_rg: true } SAMTOOLS_ADDREPLACERG ( - ch_converted_crams.without_rg.map{ meta, cram -> [ meta, cram, [], meta.read_group ] }, + ch_crams_to_addrg.replace_rg.map{ meta, cram -> [ meta, cram, [], [] ] }, // empty value for RG as the modules will use meta.read_group instead (see conf/modules.config) [[],[],[],[]] ) - ch_reads_cram = SAMTOOLS_ADDREPLACERG.out.cram - .mix ( ch_converted_crams.with_rg ) - .mix ( ch_reads.cram ) - .map{ meta, cram_file -> [ meta + [ reads_size: cram_file.size() ] , cram_file ] } - - ch_illumina = ch_reads_cram - .combine(fasta) - .multiMap { meta, cram, meta_, fasta_file -> - cram: [ meta_ + meta + [ assembly_id: meta_.id ] , cram ] - fasta: [ meta_ + meta + [ assembly_id: meta_.id ] , fasta_file ] - } + // + // SUBWORKFLOW: Align short reads + // + ch_cram_to_map = SAMTOOLS_ADDREPLACERG.out.cram + .mix ( ch_crams_to_addrg.not_replace_rg ) + .map{ meta, cram_file -> [ meta + [ reads_size: cram_file.size() ] , cram_file ] } + .combine(fasta) + .multiMap { meta, cram, meta_, fasta_file -> + cram: [ meta_ + meta + [ assembly_id: meta_.id ] , cram ] + fasta: [ meta_ + meta + [ assembly_id: meta_.id ] , fasta_file ] + } - CRAM_MAP_ILLUMINA( ch_illumina.fasta, ch_illumina.cram, params.short_aligner, params.short_reads_map_chunk_size ) + CRAM_MAP_SHORT_READS( ch_cram_to_map.fasta, ch_cram_to_map.cram, params.short_aligner, params.short_reads_map_chunk_size ) // // SUBWORKFLOW: Merge all alignment outputs by specimen // - MERGE_OUTPUT( CRAM_MAP_ILLUMINA.out.bam ) + MERGE_OUTPUT( CRAM_MAP_SHORT_READS.out.bam ) emit: bam = MERGE_OUTPUT.out.bam // channel: [ val(meta), /path/to/bam ] diff --git a/subworkflows/local/convert_stats.nf b/subworkflows/local/convert_stats.nf index 27199274..21b37335 100644 --- a/subworkflows/local/convert_stats.nf +++ b/subworkflows/local/convert_stats.nf @@ -4,9 +4,8 @@ // MODULE: local modules -include { SAMTOOLS_REHEADER as SAMTOOLS_REHEADER_BAM } from '../../modules/local/samtools/reheader/samtools_replaceheader' -include { SAMTOOLS_REHEADER as SAMTOOLS_REHEADER_CRAM } from '../../modules/local/samtools/reheader/samtools_replaceheader' include { CHANGE_NAME } from '../../modules/local/change_name' +include { SAMTOOLS_REHEADER as SAMTOOLS_REHEADER_BAM } from '../../modules/local/samtools/reheader/samtools_replaceheader' // MODULE: nf-core modules include { BLOBTK_DEPTH } from '../../modules/nf-core/blobtk/depth/main' @@ -14,7 +13,6 @@ include { CRUMBLE } from '../../modules/nf-cor include { PIGZ_COMPRESS as GZIP_STATS } from '../../modules/nf-core/pigz/compress/main' include { SAMTOOLS_VIEW as SAMTOOLS_CRAM } from '../../modules/nf-core/samtools/view/main' include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_BAM } from '../../modules/nf-core/samtools/index/main' -include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_CRAM } from '../../modules/nf-core/samtools/index/main' include { SAMTOOLS_STATS } from '../../modules/nf-core/samtools/stats/main' include { SAMTOOLS_FLAGSTAT } from '../../modules/nf-core/samtools/flagstat/main' include { SAMTOOLS_IDXSTATS } from '../../modules/nf-core/samtools/idxstats/main' @@ -34,6 +32,7 @@ workflow CONVERT_STATS { // Split outfmt parameter into a list def outfmt_options = params.outfmt.split(',').collect { fmt -> fmt.trim() } + // (Optionally) Compress the quality scores of Illumina and PacBio CCS alignments if ( params.compression == "crumble" ) { crumble_selector = bam @@ -55,26 +54,31 @@ workflow CONVERT_STATS { // Change name of BAM files to final name for publishing CHANGE_NAME ( ch_bams_for_renaming, fasta ) + header_value = params.header ? header.first() : channel.value([]) ch_renamed_bams = CHANGE_NAME.out.file - .map { meta, bam_file -> [meta, bam_file, []] } + .branch { meta, bam_file -> + reheader: (params.header || meta.add_pg) + return [ meta, bam_file, (meta.add_pg ? meta.extra_header : []) ] + passthrough: true + } + + // Reheader only when needed: optional template header and/or sample extra @PG. + SAMTOOLS_REHEADER_BAM( ch_renamed_bams.reheader, header_value ) + ch_bams_reheadered = SAMTOOLS_REHEADER_BAM.out.bam + .mix( ch_renamed_bams.passthrough ) + .map { meta, bam_file -> [ meta, bam_file, [] ] } // (Optionally) convert to CRAM if it's specified in outfmt ch_cram = channel.empty() ch_crai = channel.empty() fasta_dummy_idx = fasta.map { meta, fasta_file -> [ meta, fasta_file, [] ] } + cram_reheader_header = params.header ? header_value.map { hdr -> [[], hdr] } : [[],[]] if ( "cram" in outfmt_options ) { - SAMTOOLS_CRAM ( ch_renamed_bams, fasta_dummy_idx, [[],[]], [[],[]], "" ) + SAMTOOLS_CRAM ( ch_bams_reheadered, fasta_dummy_idx, [[],[]], [[],[]], cram_reheader_header, "" ) ch_cram = SAMTOOLS_CRAM.out.cram ch_crai = SAMTOOLS_CRAM.out.crai - if ( params.header ) { - SAMTOOLS_REHEADER_CRAM ( SAMTOOLS_CRAM.out.cram, header.first() ) - SAMTOOLS_INDEX_CRAM ( SAMTOOLS_REHEADER_CRAM.out.cram ) - ch_cram = SAMTOOLS_INDEX_CRAM.out.input - ch_crai = SAMTOOLS_INDEX_CRAM.out.index - } - // Combine CRAM and CRAI into one channel ch_for_stats = ch_cram.join ( ch_crai ) } @@ -84,8 +88,8 @@ workflow CONVERT_STATS { ch_bai = channel.empty() if ( "bam" in outfmt_options ) { - // Reindex BAM - ch_bam = params.header ? SAMTOOLS_REHEADER_BAM ( CHANGE_NAME.out.file, header.first() ).bam : CHANGE_NAME.out.file + // Reindex BAM already processed by unified reheader step. + ch_bam = ch_bams_reheadered.map{ meta, bam_file, _empty -> [ meta, bam_file ] } SAMTOOLS_INDEX_BAM ( ch_bam ) // Set the BAM and BAI channels for emission @@ -99,7 +103,7 @@ workflow CONVERT_STATS { } // Calculate read depth - BLOBTK_DEPTH ( ch_renamed_bams ) + BLOBTK_DEPTH ( ch_bams_reheadered ) BGZIP_BEDGRAPH ( BLOBTK_DEPTH.out.bed ) // Calculate statistics diff --git a/subworkflows/local/input_check.nf b/subworkflows/local/input_check.nf index 9a5f2cc3..fb8bd8e3 100644 --- a/subworkflows/local/input_check.nf +++ b/subworkflows/local/input_check.nf @@ -22,7 +22,7 @@ workflow INPUT_CHECK { SAMTOOLS_FLAGSTAT ( samplesheet_rows ) // Create the read channel for the rest of the pipeline - reads = samplesheet_rows + ch_reads = samplesheet_rows .join( SAMTOOLS_FLAGSTAT.out.flagstat ) .map { meta, datafile, _meta2, stats -> create_data_channel( meta, datafile, stats ) } @@ -39,7 +39,7 @@ workflow INPUT_CHECK { MASK_UNMASK ( ch_fasta_for_unmask ) emit: - reads // channel: [ val(meta), /path/to/datafile ] + reads = ch_reads // channel: [ val(meta), /path/to/datafile ] fasta = MASK_UNMASK.out.unmasked.first() // channel: [ meta, /path/to/fasta ] } @@ -55,6 +55,7 @@ def create_data_channel ( LinkedHashMap row, datafile, stats ) { meta.datatype = row.datatype meta.library = row.library meta.barcode = row.barcode + meta.extra_header = row.extra_header ?: [] def platform = (meta.datatype == "hic" || meta.datatype == "illumina") ? "ILLUMINA" : (meta.datatype == "pacbio" || meta.datatype == "pacbio_clr") ? "PACBIO" : diff --git a/subworkflows/local/prepare_read_groups.nf b/subworkflows/local/prepare_read_groups.nf new file mode 100644 index 00000000..d97750ec --- /dev/null +++ b/subworkflows/local/prepare_read_groups.nf @@ -0,0 +1,75 @@ +// +// Prepare read-group metadata from optional extra_header and BAM input headers +// + +include { SAMTOOLS_SPLITHEADER as SAMTOOLS_SPLITHEADER_EXTRA } from '../../modules/nf-core/samtools/splitheader/main' +include { SAMTOOLS_SPLITHEADER as SAMTOOLS_SPLITHEADER_BAM } from '../../modules/nf-core/samtools/splitheader/main' + +workflow PREPARE_READ_GROUPS { + take: + reads // channel: [ val(meta), /path/to/read_file ] + rg_mode // string: read-group mode: 'long' (minimap2 style) or 'short' (samtools addreplacerg style) + + main: + // Build mode-specific RG prefix once and reuse it for all reads in this invocation. + def rg_lead = rg_mode == 'long' ? '-y' : '' + def rg_flag = rg_mode == 'long' ? '-R' : '-r' + + // Pre-populate read_group for all inputs; downstream steps may override it from extracted @RG lines + ch_reads_prefixed = reads.map { meta, read_file -> + [meta + [read_group: "${rg_lead} ${rg_flag} $meta.read_group", replace_rg: true, read_file: read_file], read_file] + } + + ch_branched = ch_reads_prefixed.branch { meta, read_file -> + // An input may match both extra and bam_cram extraction: extra_header is parsed here; BAM/CRAM is also parsed below as an independent fallback source + has_extra: meta.extra_header != [] + return [meta, meta.extra_header] + fastq: !(read_file.name ==~ /.*\.(bam|cram)$/) + other: true + } + ch_bam_cram = ch_reads_prefixed.filter { _meta, read_file -> read_file.name ==~ /.*\.(bam|cram)$/ } + + // Extract @RG/@PG from extra_header files and (independently) from BAM/CRAM alignment files + SAMTOOLS_SPLITHEADER_EXTRA(ch_branched.has_extra) + SAMTOOLS_SPLITHEADER_BAM(ch_bam_cram) + + // Tag each result with its source so the resolver can pick precedence: extra_header > bam > precomputed + ch_extra = SAMTOOLS_SPLITHEADER_EXTRA.out.readgroup.join(SAMTOOLS_SPLITHEADER_EXTRA.out.programs).map { it + ['extra'] } + ch_bam = SAMTOOLS_SPLITHEADER_BAM.out.readgroup.join(SAMTOOLS_SPLITHEADER_BAM.out.programs).map { it + ['bam'] } + + // Group all extracted headers per meta; inputs may yield 0, 1 (extra or bam only), or 2 (both) entries + ch_resolved = ch_extra.mix(ch_bam) + .map { meta, rg, pg, src -> [meta.id, meta, rg, pg, src] } + .groupTuple() + .map { _id, metas, rgs, pgs, srcs -> + def meta = metas[0] + def bySrc = [srcs, rgs, pgs].transpose().collectEntries { src, rg, pg -> [(src): [rg: rg, pg: pg]] } + // RG: prefer extra_header lines; fall back to BAM @RG; finally fall back to precomputed meta.read_group + def picked_rg = ['extra', 'bam'].findResult { src -> + def entry = bySrc[src] + if (!entry) return null + def lines = file(entry.rg).readLines() + lines ? [src: src, rglines: lines] : null + } + // PG: inject @PG downstream only when extra_header supplies them; otherwise preserve whatever the BAM/CRAM already has + def extra_has_pg = bySrc.extra && !file(bySrc.extra.pg).readLines().isEmpty() + + def from_bam = picked_rg?.src == 'bam' + def rg_args = picked_rg ? [rg_lead, picked_rg.rglines.collect { line -> + // Add SM when not present to avoid errors from downstream tools (e.g. variant callers) + def l = line.contains('SM:') ? line : "${line}\tSM:${meta.sample ?: meta.id}" + "${rg_flag} '${l.replaceAll('\t', '\\\\t')}'" + }.join(' ')].findAll().join(' ') + : (meta.read_group ?: '') + + // Don't replace RG when it already comes from the BAM/CRAM header itself + def replace_rg = !(from_bam && picked_rg) + def new_meta = meta.subMap(meta.keySet() - ['read_file']) + [read_group: rg_args, replace_rg: replace_rg, add_pg: extra_has_pg] + [new_meta, meta.read_file] + } + + ch_reads_with_rg = ch_resolved.mix(ch_branched.fastq.map { meta, rf -> [meta.subMap(meta.keySet() - ['read_file']), rf] }) + + emit: + reads = ch_reads_with_rg // channel: [ val(meta), /path/to/read_file ] +} diff --git a/tests/default.nf.test b/tests/default.nf.test index a2806c11..5f591b09 100644 --- a/tests/default.nf.test +++ b/tests/default.nf.test @@ -27,6 +27,17 @@ nextflow_pipeline { def bam_path = getAllFilesFromDir(params.outdir, include: ['**/*.bam'], relative: true, includeDir: false) def fasta = 'https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/assembly/release/mMelMel3.1_paternal_haplotype/GCA_922984935.2.subset.fasta' + def strip_absolute_path_lines = { text -> + def lines = text?.getClass()?.isArray() + ? text.toList() + : (text instanceof Collection ? text : (text?.toString()?.readLines() ?: [])) + lines + .collect { line -> + line.toString() + .replaceAll(/\bUR:\/(?:[^\/\s]+\/)*([^\/\s]+)/, 'UR:$1') + } + } + assertAll( { assert workflow.success}, { assert snapshot( @@ -40,8 +51,10 @@ nextflow_pipeline { // Stable mapping files bam_path.collect{ f -> [(new File(f).getName()): bam("${params.outdir}/${f}").getStatistics()] }.collectEntries{ it }.sort(), cram_path.collect{ f -> [(new File(f).getName()): cram("${params.outdir}/${f}", fasta).getStatistics()] }.collectEntries{ it }.sort(), + bam_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(bam("${params.outdir}/${f}").getHeader())] }.collectEntries{ it }.sort(), + cram_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(cram("${params.outdir}/${f}", fasta).getHeader())] }.collectEntries{ it }.sort(), - // Stable trimming json + // Stable trimming json hifitrimmer_json.collect{ f -> def obj = path("${params.outdir}/${f}").json obj.remove('run_info') diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index 8dec181a..d98898ae 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test": { "content": [ - 175, + 171, { "BGZIP_BEDGRAPH": { "samtools": "1.23.1" @@ -91,26 +91,29 @@ "SAMTOOLS_INDEX": { "samtools": "1.23.1" }, - "SAMTOOLS_INDEX_CRAM": { - "samtools": "1.23.1" - }, "SAMTOOLS_MERGE": { "samtools": "1.23.1" }, "SAMTOOLS_MERGEDUP": { "samtools": "1.23.1" }, - "SAMTOOLS_REHEADER_CRAM": { + "SAMTOOLS_REHEADER_BAM": { "samtools": "1.23.1" }, "SAMTOOLS_SPLITHEADER": { "samtools": "1.23.1" }, + "SAMTOOLS_SPLITHEADER_BAM": { + "samtools": "1.23.1" + }, + "SAMTOOLS_SPLITHEADER_EXTRA": { + "samtools": "1.23.1" + }, "SAMTOOLS_STATS": { "samtools": "1.23.1" }, "Workflow": { - "sanger-tol/readmapping": "v2.0.3" + "sanger-tol/readmapping": "v2.1.0-dev" } }, [ @@ -377,6 +380,153 @@ "sorted": false } }, + { + + }, + { + "GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.bwamem2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:35528_2#1\tDT:2020-11-17T00:00:00+0000\tPU:201117_A00948_0206_AHGML2DSXY_2#1\tLB:33637906\tPG:SCS\tSM:SAMEA5962964\tCN:SC\tPL:ILLUMINA\tDS:ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ ", + "@PG\tID:SCS.extra_header\tVN:1.7.0\tPN:NovaSeq Control Software\tDS:Controlling software on instrument", + "@PG\tID:basecalling.extra_header\tPP:SCS.extra_header\tVN:Unknown\tPN:Unknown\tDS:Basecalling Package", + "@PG\tID:bambi.extra_header\tPP:basecalling.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi i2b --intensity-dir=/lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities --basecalls-dir=/lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BaseCalls --lane=2 --platform-unit=201117_A00948_0206_AHGML2DSXY_2 --read-group-id=35528_2 --study-name=\"ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ \" --sample-alias=SAMEA5962964,mCerEla1 --threads=8 --output-file=- --compression-level=0\tPN:bambi\tDS:Convert Illumina BCL to BAM or SAM file", + "@PG\tID:bambi.1.extra_header\tPN:bambi\tPP:bambi.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi decode --metrics-file /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/35528_2.bam.tag_decode.metrics --barcode-file /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/metadata_cache_35528/lane_2.taglist --compression-level 0 -", + "@PG\tID:bamcollate2.extra_header\tPN:bamcollate2\tCL:/software/pkgg/biobambam2/2.0.79/bin/bamcollate2 collate=2 level=0\tPP:bambi.1.extra_header\tVN:2.0.79", + "@PG\tID:minimap2.extra_header\tPN:minimap2\tCL:minimap2 -ax sr --MD -t 3 -Y -F 1200 -K 100000000 /lustre/scratch121/npg_repository/references/PhiX/Sanger-SNPs/all/minimap2/phix_unsnipped_short_no_N.fa.mmi /tmp/wr_cwd/0/e/8/dce75fe12433429e1b439b8872bc7693328371/tmp/s0uOqe6xfG/alnphix_bamtofastq_out\tPP:bamcollate2.extra_header\tVN:2.10-r761", + "@PG\tID:samtools.extra_header\tPN:samtools\tCL:/software/pkgg/samtools/1.11.0/bin/samtools view --threads 3 -u -F 0x900 -\tPP:minimap2.extra_header\tVN:1.11", + "@PG\tID:bam12auxmerge.extra_header\tPN:bam12auxmerge\tCL:/software/pkgg/biobambam2/2.0.79/bin/bam12auxmerge level=0 rankstrip=1 ranksplit=1 zztoname=0 clipreinsert=1 /tmp/wr_cwd/0/e/8/dce75fe12433429e1b439b8872bc7693328371/tmp/ac_8ARdDJl/tee_collated:td1_out\tPP:samtools.extra_header\tVN:2.0.79", + "@PG\tID:samtools.1.extra_header\tPN:samtools\tPP:bam12auxmerge.extra_header\tVN:1.11\tCL:/software/pkgg/samtools/1.11.0/bin/samtools split --threads 4 --output-fmt cram,no_ref=1 -f /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/%!.cram -", + "@PG\tID:samtools.2.extra_header\tPN:samtools\tPP:samtools.1.extra_header\tVN:1.11\tCL:/software/pkgg/samtools/1.11.0/bin/samtools merge -n -O BAM -l 0 --input-fmt-option no_ref=1 - /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/35528_2#1.cram", + "@PG\tID:spf.extra_header\tPN:spatial_filter\tPP:samtools.2.extra_header\tDS:A program to apply a spatial filter\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi spatial_filter -a --compression-level 0 -f -l /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/archive/lane2/plex1/35528_2#1.spatial_filter.stats -F /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/35528_2.spatial_filter --rg 35528_2#1 -", + "@PG\tID:bambi.2.extra_header\tPN:bambi\tPP:spf.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi select --compression-level 0 --input /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/9RE_mnwwls/ssfqc_tee_ssfqc:straight_through1_out --output /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/b6x1p8j3v_/alignment_filter:phix_bam_out_out -n /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/IuuBniSlRB/alignment_filter:target_bam_out_out -m 35528_2#1_bam_alignment_filter_metrics.json\tDS:Split alignments into different files", + "@PG\tID:scramble.extra_header\tPN:scramble\tPP:bambi.2.extra_header\tVN:1.14.9\tCL:/software/pkgg/io_lib/1.14.9/bin/scramble -t 5 -7 -I bam -O cram -x ", + "@PG\tID:samtools.3.extra_header\tPN:samtools\tPP:scramble.extra_header\tVN:1.15\tCL:/usr/local/bin/samtools view -h /lustre/scratch124/tol/projects/darwin/data/mammals/Meles_meles/genomic_data/mMelMel3/hic-arima2/35528_2#1.cram", + "@PG\tID:samtools.4.extra_header\tPN:samtools\tPP:samtools.3.extra_header\tVN:1.20\tCL:/usr/local/bin/samtools view --cram 35528_2#1.subset.sam", + "@PG\tID:samtools.5.extra_header\tPN:samtools\tPP:samtools.4.extra_header\tVN:1.23.1\tCL:samtools view -H 35528_2_1.subset.cram", + "@PG\tID:bwa-mem2\tPN:bwa-mem2\tVN:2.2.1\tCL:bwa-mem2 mem -5SPCp -t 4 ./bwamem2/GCA_922984935.2.subset.unmasked.fa -C -H @RG\\tID:35528_2#1\\tDT:2020-11-17T00:00:00+0000\\tPU:201117_A00948_0206_AHGML2DSXY_2#1\\tLB:33637906\\tPG:SCS\\tSM:SAMEA5962964\\tCN:SC\\tPL:ILLUMINA\\tDS:ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ -\tPP:samtools.5.extra_header", + "@PG\tID:samtools\tPN:samtools\tPP:bwa-mem2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T 35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402_tmp -o 35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402.bam 2/35528_2_1.subset.cram.1.SAMEA7524440.ERR6688402.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524440.ERR6688402 -f SAMEA7524440.ERR6688402.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524440.ERR6688402.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524440.ERR6688402.bam SAMEA7524440.ERR6688402.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.bwamem2.bam", + "@PG\tID:samtools.6\tPN:samtools\tPP:samtools.5\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1,lossy_names=1 --write-index -o GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.bwamem2.cram GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.bwamem2.bam", + "@PG\tID:samtools.7\tPN:samtools\tPP:samtools.6\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.bwamem2.cram" + ], + "GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.bwamem2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:31231_3#1\tDT:2019-10-03T00:00:00+0000\tPU:191003_HX4_31231_A_H3353CCX2_3#1\tLB:23687379\tPG:SCS\tSM:SAMEA5962962\tCN:SC\tPL:ILLUMINA\tDS:ERP114452: Sequencing and assembly of vertebrate genomes from British species for the Darwin Tree of Life Project in collaboration with the Vertebrate Genomes Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/", + "@PG\tID:bwa-mem2\tPN:bwa-mem2\tVN:2.2.1\tCL:bwa-mem2 mem -p -t 4 ./bwamem2/GCA_922984935.2.subset.unmasked.fa -C -H @RG\\tID:31231_3#1\\tDT:2019-10-03T00:00:00+0000\\tPU:191003_HX4_31231_A_H3353CCX2_3#1\\tLB:23687379\\tPG:SCS\\tSM:SAMEA5962962\\tCN:SC\\tPL:ILLUMINA\\tDS:ERP114452: Sequencing and assembly of vertebrate genomes from British species for the Darwin Tree of Life Project in collaboration with the Vertebrate Genomes Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ -", + "@PG\tID:samtools\tPN:samtools\tPP:bwa-mem2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T 31231_3_1.subset.cram.0.SAMEA7524438.ERR6688599_tmp -o 31231_3_1.subset.cram.0.SAMEA7524438.ERR6688599.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/31231_3_1.subset.cram.0.SAMEA7524438.ERR6688599.bam 2/31231_3_1.subset.cram.1.SAMEA7524438.ERR6688599.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524438.ERR6688599 -f SAMEA7524438.ERR6688599.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524438.ERR6688599.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524438.ERR6688599.bam SAMEA7524438.ERR6688599.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.bwamem2.bam", + "@PG\tID:samtools.6\tPN:samtools\tPP:samtools.5\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1,lossy_names=1 --write-index -o GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.bwamem2.cram GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.bwamem2.bam", + "@PG\tID:samtools.7\tPN:samtools\tPP:samtools.6\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.bwamem2.cram" + ], + "GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.bwamem2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:31231_4_1\tPL:ILLUMINA\tSM:SAMEA7524439", + "@PG\tID:bwa-mem2\tPN:bwa-mem2\tVN:2.2.1\tCL:bwa-mem2 mem -p -t 4 ./bwamem2/GCA_922984935.2.subset.unmasked.fa -C -H @RG\\tID:31231_4_1\\tPL:ILLUMINA\\tSM:SAMEA7524439 -", + "@PG\tID:samtools\tPN:samtools\tPP:bwa-mem2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600_tmp -o SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600.bam 2/SAMEA7524439.ERR6688600_addRG.cram.1.SAMEA7524439.ERR6688600.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524439.ERR6688600 -f SAMEA7524439.ERR6688600.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524439.ERR6688600.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524439.ERR6688600.bam SAMEA7524439.ERR6688600.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.bwamem2.bam", + "@PG\tID:samtools.6\tPN:samtools\tPP:samtools.5\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1,lossy_names=1 --write-index -o GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.bwamem2.cram GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.bwamem2.bam", + "@PG\tID:samtools.7\tPN:samtools\tPP:samtools.6\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.bwamem2.cram" + ], + "GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:PAE35587_pass_1f1f0707_115\tPL:ONT\tSM:SAMEA7524440", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-ont -y -R @RG\\tID:PAE35587_pass_1f1f0707_115\\tPL:ONT\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o PAE35587_pass_1f1f0707_115.subset.fastq.gz.0.SAMEA7524440.PAE35587.bam -T PAE35587_pass_1f1f0707_115.subset.fastq.gz.0.SAMEA7524440.PAE35587_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.PAE35587.merge.bam 1/PAE35587_pass_1f1f0707_115.subset.fastq.gz.0.SAMEA7524440.PAE35587.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587.minimap2.bam", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587.minimap2.cram GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587.minimap2.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587.minimap2.cram" + ], + "GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587_test.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:PAE35587_pass_1f1f0707_115\tPL:ONT\tSM:mMelMel3", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-ont -y -R @RG\\tID:PAE35587_pass_1f1f0707_115\\tPL:ONT\\tSM:mMelMel3 -I1G -a GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o SAMEA7524440.PAE35587_test_other.fastq.gz.0.SAMEA7524440.PAE35587_test.bam -T SAMEA7524440.PAE35587_test_other.fastq.gz.0.SAMEA7524440.PAE35587_test_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.PAE35587_test.merge.bam 1/SAMEA7524440.PAE35587_test_other.fastq.gz.0.SAMEA7524440.PAE35587_test.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587_test.minimap2.bam", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587_test.minimap2.cram GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587_test.minimap2.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587_test.minimap2.cram" + ], + "GCA_922984935.2.subset.ont.SAMEA7524440.merged_1.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:PAE35587_pass_1f1f0707_115\tPL:ONT\tSM:mMelMel3", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-ont -y -R @RG\\tID:PAE35587_pass_1f1f0707_115\\tPL:ONT\\tSM:mMelMel3 -I1G -a GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o SAMEA7524440.PAE35587_test_other.fastq.gz.0.SAMEA7524440.PAE35587_test.bam -T SAMEA7524440.PAE35587_test_other.fastq.gz.0.SAMEA7524440.PAE35587_test_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.PAE35587_test.merge.bam 1/SAMEA7524440.PAE35587_test_other.fastq.gz.0.SAMEA7524440.PAE35587_test.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p SAMEA7524440.merged_1.merge.bam 1/SAMEA7524440.PAE35587_test.merge.bam 2/SAMEA7524440.PAE35587.merge.bam", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.ont.SAMEA7524440.merged_1.minimap2.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_922984935.2.subset.ont.SAMEA7524440.merged_1.minimap2.cram GCA_922984935.2.subset.ont.SAMEA7524440.merged_1.minimap2.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:samtools.4\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.ont.SAMEA7524440.merged_1.minimap2.cram" + ], + "GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939248.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:61ddc6c3/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200910_173211\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@PG\tID:ccs-4.2.0.extra_header\tPN:ccs\tVN:4.2.0\tDS:Generate circular consensus sequences (ccs) from subreads.\tCL:ccs ccs --chunk 1/64 -j 8 --max-length 50000 ../../m64094_200910_173211.subreads.bam m64094_200910_173211.ccs.bam", + "@PG\tID:lima.extra_header\tVN:1.11.0 (commit v1.11.0)\tCL:lima -j 8 --split-bam-named --same --peek-guess --guess-min-count 1000 --ccs m64094_200910_173211.ccs.bam /lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta lima/m64094_200910_173211.ccs.bam", + "@PG\tID:samtools.extra_header\tPN:samtools\tVN:1.10\tPP:ccs-4.2.0.extra_header\tCL:samtools merge -@8 -ncp -b m64094_200910_173211.chunks.fofn m64094_200910_173211.ccs.bam", + "@PG\tID:samtools.1.extra_header\tPN:samtools\tPP:samtools.extra_header\tVN:1.19.2\tCL:samtools view -b -h -N /nfs/users/nfs_m/mm49/READS -o /nfs/users/nfs_m/mm49/x.bam m64094_200910_173211.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.bam", + "@PG\tID:samtools.2.extra_header\tPN:samtools\tPP:samtools.1.extra_header\tVN:1.23.1\tCL:samtools view -H m64094_200910_173211.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.bam", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:61ddc6c3/15--15\\tPL:PACBIO\\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:DN615654G-A1\\tPU:m64094_200910_173211\\tPM:SEQUELII\\tBC:CACTCACGTGTGATATT\\tCM:S/P4-C2/5.0-8M\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -\tPP:samtools.2.extra_header", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o pacbio.SAMEA7524440.ERR6939248.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939248.bam -T pacbio.SAMEA7524440.ERR6939248.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939248_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.ERR6939248.merge.bam 1/pacbio.SAMEA7524440.ERR6939248.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939248.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA7524440.ERR6939248.merge.bam SAMEA7524440.ERR6939248.merge.crumble.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939248.minimap2.bam", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939248.minimap2.cram GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939248.minimap2.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939248.minimap2.cram" + ], + "GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939249.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:aaa0cf18/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200911_174739\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@PG\tID:ccs-4.2.0.extra_header\tPN:ccs\tVN:4.2.0\tDS:Generate circular consensus sequences (ccs) from subreads.\tCL:ccs ccs --chunk 1/64 -j 8 --max-length 50000 ../../m64094_200911_174739.subreads.bam m64094_200911_174739.ccs.bam", + "@PG\tID:lima.extra_header\tVN:1.11.0 (commit v1.11.0)\tCL:lima -j 8 --split-bam-named --same --peek-guess --guess-min-count 1000 --ccs m64094_200911_174739.ccs.bam /lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta lima/m64094_200911_174739.ccs.bam", + "@PG\tID:samtools.extra_header\tPN:samtools\tVN:1.10\tPP:ccs-4.2.0.extra_header\tCL:samtools merge -@8 -ncp -b m64094_200911_174739.chunks.fofn m64094_200911_174739.ccs.bam", + "@PG\tID:samtools.1.extra_header\tPN:samtools\tPP:samtools.extra_header\tVN:1.23.1\tCL:samtools view -H /lustre/scratch122/tol/data/9/9/f/1/6/d/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.bam", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:aaa0cf18/15--15\\tPL:PACBIO\\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:DN615654G-A1\\tPU:m64094_200911_174739\\tPM:SEQUELII\\tBC:CACTCACGTGTGATATT\\tCM:S/P4-C2/5.0-8M\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -\tPP:samtools.1.extra_header", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o pacbio.SAMEA7524440.ERR6939249.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939249.bam -T pacbio.SAMEA7524440.ERR6939249.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939249_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.ERR6939249.merge.bam 1/pacbio.SAMEA7524440.ERR6939249.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939249.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA7524440.ERR6939249.merge.bam SAMEA7524440.ERR6939249.merge.crumble.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939249.minimap2.bam", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939249.minimap2.cram GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939249.minimap2.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939249.minimap2.cram" + ], + "GCA_922984935.2.subset.pacbio.SAMEA7524440.merged_1.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:61ddc6c3/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200910_173211\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@RG\tID:aaa0cf18/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200911_174739\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:61ddc6c3/15--15\\tPL:PACBIO\\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:DN615654G-A1\\tPU:m64094_200910_173211\\tPM:SEQUELII\\tBC:CACTCACGTGTGATATT\\tCM:S/P4-C2/5.0-8M\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o pacbio.SAMEA7524440.ERR6939248.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939248.bam -T pacbio.SAMEA7524440.ERR6939248.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939248_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.ERR6939248.merge.bam 1/pacbio.SAMEA7524440.ERR6939248.hifitrimmer.fastq.gz.0.SAMEA7524440.ERR6939248.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p SAMEA7524440.merged_1.merge.bam 1/SAMEA7524440.ERR6939248.merge.bam 2/SAMEA7524440.ERR6939249.merge.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.2\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA7524440.merged_1.merge.bam SAMEA7524440.merged_1.merge.crumble.bam", + "@PG\tID:samtools.3\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.pacbio.SAMEA7524440.merged_1.minimap2.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_922984935.2.subset.pacbio.SAMEA7524440.merged_1.minimap2.cram GCA_922984935.2.subset.pacbio.SAMEA7524440.merged_1.minimap2.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:samtools.4\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.pacbio.SAMEA7524440.merged_1.minimap2.cram" + ] + }, [ "pacbio.SAMEA7524440.ERR6939248.hifitrimmer.summary.json:md5,d2d4198c3f7086437249909d94173359", "pacbio.SAMEA7524440.ERR6939249.hifitrimmer.summary.json:md5,83d9985a6d7a4477df704d8f4a23852c" @@ -386,6 +536,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.4" }, - "timestamp": "2026-05-15T12:13:39.841579495" + "timestamp": "2026-06-04T18:14:24.285247311" } } \ No newline at end of file diff --git a/tests/short_aligner_minimap2.nf.test b/tests/short_aligner_minimap2.nf.test index 964a1537..3d4914c2 100644 --- a/tests/short_aligner_minimap2.nf.test +++ b/tests/short_aligner_minimap2.nf.test @@ -29,6 +29,17 @@ nextflow_pipeline { def bam_path = getAllFilesFromDir(params.outdir, include: ['**/*.bam'], relative: true, includeDir: false) def fasta = 'https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/assembly/release/mMelMel3.1_paternal_haplotype/GCA_922984935.2.subset.fasta' + def strip_absolute_path_lines = { text -> + def lines = text?.getClass()?.isArray() + ? text.toList() + : (text instanceof Collection ? text : (text?.toString()?.readLines() ?: [])) + lines + .collect { line -> + line.toString() + .replaceAll(/\bUR:\/(?:[^\/\s]+\/)*([^\/\s]+)/, 'UR:$1') + } + } + assertAll( { assert workflow.success }, { assert snapshot( @@ -42,6 +53,8 @@ nextflow_pipeline { // Stable mapping files bam_path.collect{ f -> [(new File(f).getName()): bam("${params.outdir}/${f}").getStatistics()] }.collectEntries{ it }.sort(), cram_path.collect{ f -> [(new File(f).getName()): cram("${params.outdir}/${f}", fasta).getStatistics()] }.collectEntries{ it }.sort(), + bam_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(bam("${params.outdir}/${f}").getHeader())] }.collectEntries{ it }.sort(), + cram_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(cram("${params.outdir}/${f}", fasta).getHeader())] }.collectEntries{ it }.sort(), // Stable trimming json hifitrimmer_json.collect{ f -> diff --git a/tests/short_aligner_minimap2.nf.test.snap b/tests/short_aligner_minimap2.nf.test.snap index f8e9d8b7..eb2b93a0 100644 --- a/tests/short_aligner_minimap2.nf.test.snap +++ b/tests/short_aligner_minimap2.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test --short_aligner minimap2 --outfmt 'bam,cram'": { "content": [ - 77, + 74, { "BGZIP_BEDGRAPH": { "samtools": "1.23.1" @@ -64,26 +64,26 @@ "SAMTOOLS_INDEX_BAM": { "samtools": "1.23.1" }, - "SAMTOOLS_INDEX_CRAM": { - "samtools": "1.23.1" - }, "SAMTOOLS_MERGEDUP": { "samtools": "1.23.1" }, "SAMTOOLS_REHEADER_BAM": { "samtools": "1.23.1" }, - "SAMTOOLS_REHEADER_CRAM": { + "SAMTOOLS_SPLITHEADER": { "samtools": "1.23.1" }, - "SAMTOOLS_SPLITHEADER": { + "SAMTOOLS_SPLITHEADER_BAM": { + "samtools": "1.23.1" + }, + "SAMTOOLS_SPLITHEADER_EXTRA": { "samtools": "1.23.1" }, "SAMTOOLS_STATS": { "samtools": "1.23.1" }, "Workflow": { - "sanger-tol/readmapping": "v2.0.3" + "sanger-tol/readmapping": "v2.1.0-dev" } }, [ @@ -220,14 +220,134 @@ "sorted": false } }, + { + "GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:35528_2#1\tDT:2020-11-17T00:00:00+0000\tPU:201117_A00948_0206_AHGML2DSXY_2#1\tLB:33637906\tPG:SCS\tSM:SAMEA5962964\tCN:SC\tPL:ILLUMINA\tDS:ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ ", + "@PG\tID:SCS.extra_header\tVN:1.7.0\tPN:NovaSeq Control Software\tDS:Controlling software on instrument", + "@PG\tID:basecalling.extra_header\tPP:SCS.extra_header\tVN:Unknown\tPN:Unknown\tDS:Basecalling Package", + "@PG\tID:bambi.extra_header\tPP:basecalling.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi i2b --intensity-dir=/lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities --basecalls-dir=/lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BaseCalls --lane=2 --platform-unit=201117_A00948_0206_AHGML2DSXY_2 --read-group-id=35528_2 --study-name=\"ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ \" --sample-alias=SAMEA5962964,mCerEla1 --threads=8 --output-file=- --compression-level=0\tPN:bambi\tDS:Convert Illumina BCL to BAM or SAM file", + "@PG\tID:bambi.1.extra_header\tPN:bambi\tPP:bambi.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi decode --metrics-file /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/35528_2.bam.tag_decode.metrics --barcode-file /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/metadata_cache_35528/lane_2.taglist --compression-level 0 -", + "@PG\tID:bamcollate2.extra_header\tPN:bamcollate2\tCL:/software/pkgg/biobambam2/2.0.79/bin/bamcollate2 collate=2 level=0\tPP:bambi.1.extra_header\tVN:2.0.79", + "@PG\tID:minimap2.extra_header\tPN:minimap2\tCL:minimap2 -ax sr --MD -t 3 -Y -F 1200 -K 100000000 /lustre/scratch121/npg_repository/references/PhiX/Sanger-SNPs/all/minimap2/phix_unsnipped_short_no_N.fa.mmi /tmp/wr_cwd/0/e/8/dce75fe12433429e1b439b8872bc7693328371/tmp/s0uOqe6xfG/alnphix_bamtofastq_out\tPP:bamcollate2.extra_header\tVN:2.10-r761", + "@PG\tID:samtools.extra_header\tPN:samtools\tCL:/software/pkgg/samtools/1.11.0/bin/samtools view --threads 3 -u -F 0x900 -\tPP:minimap2.extra_header\tVN:1.11", + "@PG\tID:bam12auxmerge.extra_header\tPN:bam12auxmerge\tCL:/software/pkgg/biobambam2/2.0.79/bin/bam12auxmerge level=0 rankstrip=1 ranksplit=1 zztoname=0 clipreinsert=1 /tmp/wr_cwd/0/e/8/dce75fe12433429e1b439b8872bc7693328371/tmp/ac_8ARdDJl/tee_collated:td1_out\tPP:samtools.extra_header\tVN:2.0.79", + "@PG\tID:samtools.1.extra_header\tPN:samtools\tPP:bam12auxmerge.extra_header\tVN:1.11\tCL:/software/pkgg/samtools/1.11.0/bin/samtools split --threads 4 --output-fmt cram,no_ref=1 -f /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/%!.cram -", + "@PG\tID:samtools.2.extra_header\tPN:samtools\tPP:samtools.1.extra_header\tVN:1.11\tCL:/software/pkgg/samtools/1.11.0/bin/samtools merge -n -O BAM -l 0 --input-fmt-option no_ref=1 - /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/35528_2#1.cram", + "@PG\tID:spf.extra_header\tPN:spatial_filter\tPP:samtools.2.extra_header\tDS:A program to apply a spatial filter\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi spatial_filter -a --compression-level 0 -f -l /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/archive/lane2/plex1/35528_2#1.spatial_filter.stats -F /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/35528_2.spatial_filter --rg 35528_2#1 -", + "@PG\tID:bambi.2.extra_header\tPN:bambi\tPP:spf.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi select --compression-level 0 --input /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/9RE_mnwwls/ssfqc_tee_ssfqc:straight_through1_out --output /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/b6x1p8j3v_/alignment_filter:phix_bam_out_out -n /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/IuuBniSlRB/alignment_filter:target_bam_out_out -m 35528_2#1_bam_alignment_filter_metrics.json\tDS:Split alignments into different files", + "@PG\tID:scramble.extra_header\tPN:scramble\tPP:bambi.2.extra_header\tVN:1.14.9\tCL:/software/pkgg/io_lib/1.14.9/bin/scramble -t 5 -7 -I bam -O cram -x ", + "@PG\tID:samtools.3.extra_header\tPN:samtools\tPP:scramble.extra_header\tVN:1.15\tCL:/usr/local/bin/samtools view -h /lustre/scratch124/tol/projects/darwin/data/mammals/Meles_meles/genomic_data/mMelMel3/hic-arima2/35528_2#1.cram", + "@PG\tID:samtools.4.extra_header\tPN:samtools\tPP:samtools.3.extra_header\tVN:1.20\tCL:/usr/local/bin/samtools view --cram 35528_2#1.subset.sam", + "@PG\tID:samtools.5.extra_header\tPN:samtools\tPP:samtools.4.extra_header\tVN:1.23.1\tCL:samtools view -H 35528_2_1.subset.cram", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax sr --cs=short -I1.0G -y -R @RG\\tID:35528_2#1\\tDT:2020-11-17T00:00:00+0000\\tPU:201117_A00948_0206_AHGML2DSXY_2#1\\tLB:33637906\\tPG:SCS\\tSM:SAMEA5962964\\tCN:SC\\tPL:ILLUMINA\\tDS:ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ GCA_922984935.2.subset.unmasked.mmi -\tPP:samtools.5.extra_header", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T 35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402_tmp -o 35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402.bam 2/35528_2_1.subset.cram.1.SAMEA7524440.ERR6688402.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524440.ERR6688402 -f SAMEA7524440.ERR6688402.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524440.ERR6688402.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524440.ERR6688402.bam SAMEA7524440.ERR6688402.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.minimap2.bam" + ], + "GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:31231_3#1\tDT:2019-10-03T00:00:00+0000\tPU:191003_HX4_31231_A_H3353CCX2_3#1\tLB:23687379\tPG:SCS\tSM:SAMEA5962962\tCN:SC\tPL:ILLUMINA\tDS:ERP114452: Sequencing and assembly of vertebrate genomes from British species for the Darwin Tree of Life Project in collaboration with the Vertebrate Genomes Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax sr --cs=short -I1.0G -y -R @RG\\tID:31231_3#1\\tDT:2019-10-03T00:00:00+0000\\tPU:191003_HX4_31231_A_H3353CCX2_3#1\\tLB:23687379\\tPG:SCS\\tSM:SAMEA5962962\\tCN:SC\\tPL:ILLUMINA\\tDS:ERP114452: Sequencing and assembly of vertebrate genomes from British species for the Darwin Tree of Life Project in collaboration with the Vertebrate Genomes Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T SAMEA7524438.ERR6688599.cram.0.SAMEA7524438.ERR6688599_tmp -o SAMEA7524438.ERR6688599.cram.0.SAMEA7524438.ERR6688599.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/SAMEA7524438.ERR6688599.cram.0.SAMEA7524438.ERR6688599.bam 2/SAMEA7524438.ERR6688599.cram.1.SAMEA7524438.ERR6688599.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524438.ERR6688599 -f SAMEA7524438.ERR6688599.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524438.ERR6688599.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524438.ERR6688599.bam SAMEA7524438.ERR6688599.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.minimap2.bam" + ], + "GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:31231_4_1\tPL:ILLUMINA\tSM:SAMEA7524439", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax sr --cs=short -I1.0G -y -R @RG\\tID:31231_4_1\\tPL:ILLUMINA\\tSM:SAMEA7524439 GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600_tmp -o SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600.bam 2/SAMEA7524439.ERR6688600_addRG.cram.1.SAMEA7524439.ERR6688600.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524439.ERR6688600 -f SAMEA7524439.ERR6688600.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524439.ERR6688600.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524439.ERR6688600.bam SAMEA7524439.ERR6688600.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.minimap2.bam" + ] + }, + { + "GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:35528_2#1\tDT:2020-11-17T00:00:00+0000\tPU:201117_A00948_0206_AHGML2DSXY_2#1\tLB:33637906\tPG:SCS\tSM:SAMEA5962964\tCN:SC\tPL:ILLUMINA\tDS:ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ ", + "@PG\tID:SCS.extra_header\tVN:1.7.0\tPN:NovaSeq Control Software\tDS:Controlling software on instrument", + "@PG\tID:basecalling.extra_header\tPP:SCS.extra_header\tVN:Unknown\tPN:Unknown\tDS:Basecalling Package", + "@PG\tID:bambi.extra_header\tPP:basecalling.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi i2b --intensity-dir=/lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities --basecalls-dir=/lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BaseCalls --lane=2 --platform-unit=201117_A00948_0206_AHGML2DSXY_2 --read-group-id=35528_2 --study-name=\"ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ \" --sample-alias=SAMEA5962964,mCerEla1 --threads=8 --output-file=- --compression-level=0\tPN:bambi\tDS:Convert Illumina BCL to BAM or SAM file", + "@PG\tID:bambi.1.extra_header\tPN:bambi\tPP:bambi.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi decode --metrics-file /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/35528_2.bam.tag_decode.metrics --barcode-file /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/metadata_cache_35528/lane_2.taglist --compression-level 0 -", + "@PG\tID:bamcollate2.extra_header\tPN:bamcollate2\tCL:/software/pkgg/biobambam2/2.0.79/bin/bamcollate2 collate=2 level=0\tPP:bambi.1.extra_header\tVN:2.0.79", + "@PG\tID:minimap2.extra_header\tPN:minimap2\tCL:minimap2 -ax sr --MD -t 3 -Y -F 1200 -K 100000000 /lustre/scratch121/npg_repository/references/PhiX/Sanger-SNPs/all/minimap2/phix_unsnipped_short_no_N.fa.mmi /tmp/wr_cwd/0/e/8/dce75fe12433429e1b439b8872bc7693328371/tmp/s0uOqe6xfG/alnphix_bamtofastq_out\tPP:bamcollate2.extra_header\tVN:2.10-r761", + "@PG\tID:samtools.extra_header\tPN:samtools\tCL:/software/pkgg/samtools/1.11.0/bin/samtools view --threads 3 -u -F 0x900 -\tPP:minimap2.extra_header\tVN:1.11", + "@PG\tID:bam12auxmerge.extra_header\tPN:bam12auxmerge\tCL:/software/pkgg/biobambam2/2.0.79/bin/bam12auxmerge level=0 rankstrip=1 ranksplit=1 zztoname=0 clipreinsert=1 /tmp/wr_cwd/0/e/8/dce75fe12433429e1b439b8872bc7693328371/tmp/ac_8ARdDJl/tee_collated:td1_out\tPP:samtools.extra_header\tVN:2.0.79", + "@PG\tID:samtools.1.extra_header\tPN:samtools\tPP:bam12auxmerge.extra_header\tVN:1.11\tCL:/software/pkgg/samtools/1.11.0/bin/samtools split --threads 4 --output-fmt cram,no_ref=1 -f /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/%!.cram -", + "@PG\tID:samtools.2.extra_header\tPN:samtools\tPP:samtools.1.extra_header\tVN:1.11\tCL:/software/pkgg/samtools/1.11.0/bin/samtools merge -n -O BAM -l 0 --input-fmt-option no_ref=1 - /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/35528_2#1.cram", + "@PG\tID:spf.extra_header\tPN:spatial_filter\tPP:samtools.2.extra_header\tDS:A program to apply a spatial filter\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi spatial_filter -a --compression-level 0 -f -l /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/archive/lane2/plex1/35528_2#1.spatial_filter.stats -F /lustre/scratch121/esa-sv-20200210-01/IL_seq_data/analysis/201117_A00948_0206_AHGML2DSXY/Data/Intensities/BAM_basecalls_20201119-090808/no_cal/35528_2.spatial_filter --rg 35528_2#1 -", + "@PG\tID:bambi.2.extra_header\tPN:bambi\tPP:spf.extra_header\tVN:0.13.1\tCL:/software/pkgg/bambi/0.13.1/bin/bambi select --compression-level 0 --input /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/9RE_mnwwls/ssfqc_tee_ssfqc:straight_through1_out --output /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/b6x1p8j3v_/alignment_filter:phix_bam_out_out -n /tmp/wr_cwd/5/0/6/86a8369ba62bab2227fd63e2ff1ad119662395/tmp/IuuBniSlRB/alignment_filter:target_bam_out_out -m 35528_2#1_bam_alignment_filter_metrics.json\tDS:Split alignments into different files", + "@PG\tID:scramble.extra_header\tPN:scramble\tPP:bambi.2.extra_header\tVN:1.14.9\tCL:/software/pkgg/io_lib/1.14.9/bin/scramble -t 5 -7 -I bam -O cram -x ", + "@PG\tID:samtools.3.extra_header\tPN:samtools\tPP:scramble.extra_header\tVN:1.15\tCL:/usr/local/bin/samtools view -h /lustre/scratch124/tol/projects/darwin/data/mammals/Meles_meles/genomic_data/mMelMel3/hic-arima2/35528_2#1.cram", + "@PG\tID:samtools.4.extra_header\tPN:samtools\tPP:samtools.3.extra_header\tVN:1.20\tCL:/usr/local/bin/samtools view --cram 35528_2#1.subset.sam", + "@PG\tID:samtools.5.extra_header\tPN:samtools\tPP:samtools.4.extra_header\tVN:1.23.1\tCL:samtools view -H 35528_2_1.subset.cram", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax sr --cs=short -I1.0G -y -R @RG\\tID:35528_2#1\\tDT:2020-11-17T00:00:00+0000\\tPU:201117_A00948_0206_AHGML2DSXY_2#1\\tLB:33637906\\tPG:SCS\\tSM:SAMEA5962964\\tCN:SC\\tPL:ILLUMINA\\tDS:ERP116890: Sequencing and assembly of genomes from British species for the Darwin Tree of Life Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ GCA_922984935.2.subset.unmasked.mmi -\tPP:samtools.5.extra_header", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T 35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402_tmp -o 35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/35528_2_1.subset.cram.0.SAMEA7524440.ERR6688402.bam 2/35528_2_1.subset.cram.1.SAMEA7524440.ERR6688402.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524440.ERR6688402 -f SAMEA7524440.ERR6688402.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524440.ERR6688402.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524440.ERR6688402.bam SAMEA7524440.ERR6688402.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.minimap2.bam", + "@PG\tID:samtools.6\tPN:samtools\tPP:samtools.5\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1,lossy_names=1 --write-index -o GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.minimap2.cram GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.minimap2.bam", + "@PG\tID:samtools.7\tPN:samtools\tPP:samtools.6\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.hic.SAMEA7524440.ERR6688402.minimap2.cram" + ], + "GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:31231_3#1\tDT:2019-10-03T00:00:00+0000\tPU:191003_HX4_31231_A_H3353CCX2_3#1\tLB:23687379\tPG:SCS\tSM:SAMEA5962962\tCN:SC\tPL:ILLUMINA\tDS:ERP114452: Sequencing and assembly of vertebrate genomes from British species for the Darwin Tree of Life Project in collaboration with the Vertebrate Genomes Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax sr --cs=short -I1.0G -y -R @RG\\tID:31231_3#1\\tDT:2019-10-03T00:00:00+0000\\tPU:191003_HX4_31231_A_H3353CCX2_3#1\\tLB:23687379\\tPG:SCS\\tSM:SAMEA5962962\\tCN:SC\\tPL:ILLUMINA\\tDS:ERP114452: Sequencing and assembly of vertebrate genomes from British species for the Darwin Tree of Life Project in collaboration with the Vertebrate Genomes Project. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria), please see http://www.sanger.ac.uk/datasharing/ GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T SAMEA7524438.ERR6688599.cram.0.SAMEA7524438.ERR6688599_tmp -o SAMEA7524438.ERR6688599.cram.0.SAMEA7524438.ERR6688599.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/SAMEA7524438.ERR6688599.cram.0.SAMEA7524438.ERR6688599.bam 2/SAMEA7524438.ERR6688599.cram.1.SAMEA7524438.ERR6688599.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524438.ERR6688599 -f SAMEA7524438.ERR6688599.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524438.ERR6688599.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524438.ERR6688599.bam SAMEA7524438.ERR6688599.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.minimap2.bam", + "@PG\tID:samtools.6\tPN:samtools\tPP:samtools.5\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1,lossy_names=1 --write-index -o GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.minimap2.cram GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.minimap2.bam", + "@PG\tID:samtools.7\tPN:samtools\tPP:samtools.6\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.illumina.SAMEA7524438.ERR6688599.minimap2.cram" + ], + "GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:31231_4_1\tPL:ILLUMINA\tSM:SAMEA7524439", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax sr --cs=short -I1.0G -y -R @RG\\tID:31231_4_1\\tPL:ILLUMINA\\tSM:SAMEA7524439 GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.22.1\tCL:samtools fixmate -mpu - -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.22.1\tCL:samtools view -h", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.22.1\tCL:samtools sort --write-index -l1 -@4 -T SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600_tmp -o SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600.bam -", + "@PG\tID:samtools.3\tPN:samtools\tPP:samtools.2\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa - 1/SAMEA7524439.ERR6688600_addRG.cram.0.SAMEA7524439.ERR6688600.bam 2/SAMEA7524439.ERR6688600_addRG.cram.1.SAMEA7524439.ERR6688600.bam", + "@PG\tID:samtools.4\tPN:samtools\tPP:samtools.3\tVN:1.23.1\tCL:samtools markdup -T SAMEA7524439.ERR6688600 -f SAMEA7524439.ERR6688600.metrics --threads 4 --reference GCA_922984935.2.subset.unmasked.fa - SAMEA7524439.ERR6688600.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.4\tVN:0.9.1\tCL:crumble -O bam SAMEA7524439.ERR6688600.bam SAMEA7524439.ERR6688600.crumble.bam", + "@PG\tID:samtools.5\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.minimap2.bam", + "@PG\tID:samtools.6\tPN:samtools\tPP:samtools.5\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_922984935.2.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1,lossy_names=1 --write-index -o GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.minimap2.cram GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.minimap2.bam", + "@PG\tID:samtools.7\tPN:samtools\tPP:samtools.6\tVN:1.23.1\tCL:samtools reheader temp.reheader.header.sam GCA_922984935.2.subset.illumina.SAMEA7524439.ERR6688600.minimap2.cram" + ] + }, [ - + ] ], "meta": { "nf-test": "0.9.3", "nextflow": "25.10.4" }, - "timestamp": "2026-04-29T19:13:10.330631613" + "timestamp": "2026-06-04T18:01:23.719076494" } -} +} \ No newline at end of file diff --git a/tests/uli.nf.test b/tests/uli.nf.test index 1438f913..7656457f 100644 --- a/tests/uli.nf.test +++ b/tests/uli.nf.test @@ -27,6 +27,17 @@ nextflow_pipeline { def bam_path = getAllFilesFromDir(params.outdir, include: ['**/*.bam'], relative: true, includeDir: false) def fasta = 'https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/assembly/release/mMelMel3.1_paternal_haplotype/GCA_922984935.2.subset.fasta' + def strip_absolute_path_lines = { text -> + def lines = text?.getClass()?.isArray() + ? text.toList() + : (text instanceof Collection ? text : (text?.toString()?.readLines() ?: [])) + lines + .collect { line -> + line.toString() + .replaceAll(/\bUR:\/(?:[^\/\s]+\/)*([^\/\s]+)/, 'UR:$1') + } + } + assertAll( { assert workflow.success}, { assert snapshot( @@ -40,6 +51,8 @@ nextflow_pipeline { // Stable mapping files bam_path.collect{ f -> [(new File(f).getName()): bam("${params.outdir}/${f}").getStatistics()] }.collectEntries{ it }.sort(), cram_path.collect{ f -> [(new File(f).getName()): cram("${params.outdir}/${f}", fasta).getStatistics()] }.collectEntries{ it }.sort(), + bam_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(bam("${params.outdir}/${f}").getHeader())] }.collectEntries{ it }.sort(), + cram_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(cram("${params.outdir}/${f}", fasta).getHeader())] }.collectEntries{ it }.sort(), // Stable trimming json hifitrimmer_json.collect{ f -> diff --git a/tests/uli.nf.test.snap b/tests/uli.nf.test.snap index 7b8bbf66..427e9d44 100644 --- a/tests/uli.nf.test.snap +++ b/tests/uli.nf.test.snap @@ -78,14 +78,14 @@ "SAMTOOLS_MERGE": { "samtools": "1.23.1" }, - "SAMTOOLS_SPLITHEADER": { + "SAMTOOLS_SPLITHEADER_BAM": { "samtools": "1.23.1" }, "SAMTOOLS_STATS": { "samtools": "1.23.1" }, "Workflow": { - "sanger-tol/readmapping": "v2.0.3" + "sanger-tol/readmapping": "v2.1.0-dev" } }, [ @@ -143,7 +143,7 @@ "GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104_test.minimap2.stats.gz:md5,4f5930c586e221b776fdd20394b18700" ], { - + }, { "GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104.minimap2.cram": { @@ -169,6 +169,37 @@ "sorted": false } }, + { + + }, + { + "GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:CAXIUN010000020.1\tLN:15094\tM5:eb4b4e09fa2962e012fc983eeb6b65dc\tUR:GCA_964034985.1.subset.unmasked.fa", + "@SQ\tSN:CAXIUN010000038.1\tLN:1000\tM5:3fe8a9b5a85c60b19e74e88ca5ca434e\tUR:GCA_964034985.1.subset.unmasked.fa", + "@SQ\tSN:CAXIUN010000104.1\tLN:10110\tM5:10013ae295fb0e1a002ab812d6c2e77e\tUR:GCA_964034985.1.subset.unmasked.fa", + "@SQ\tSN:CAXIUN010000129.1\tLN:29940\tM5:9579779c87681c88e68a924f572f5599\tUR:GCA_964034985.1.subset.unmasked.fa", + "@RG\tID:0de7f0a4/27--27\tPL:PACBIO\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:TRAC-2-8053\tPU:m84093_241116_151316_s2\tSM:TOL_ASG14652249\tPM:REVIO\tBC:ACTGCAGCACGAGTAT\tCM:R/P1-C1/5.0-25M", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:0de7f0a4/27--27\\tPL:PACBIO\\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:TRAC-2-8053\\tPU:m84093_241116_151316_s2\\tSM:TOL_ASG14652249\\tPM:REVIO\\tBC:ACTGCAGCACGAGTAT\\tCM:R/P1-C1/5.0-25M -I1G -a GCA_964034985.1.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104.bam -T pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_964034985.1.subset.unmasked.fa SAMEA114784749.ERR14209104.merge.bam 1/pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104.bam 2/pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.1.SAMEA114784749.ERR14209104.bam 3/pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.2.SAMEA114784749.ERR14209104.bam 4/pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.3.SAMEA114784749.ERR14209104.bam 5/pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.4.SAMEA114784749.ERR14209104.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA114784749.ERR14209104.merge.bam SAMEA114784749.ERR14209104.merge.crumble.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_964034985.1.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104.minimap2.cram GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104.minimap2.bam" + ], + "GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104_test.minimap2.cram": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:CAXIUN010000020.1\tLN:15094\tM5:eb4b4e09fa2962e012fc983eeb6b65dc\tUR:GCA_964034985.1.subset.unmasked.fa", + "@SQ\tSN:CAXIUN010000038.1\tLN:1000\tM5:3fe8a9b5a85c60b19e74e88ca5ca434e\tUR:GCA_964034985.1.subset.unmasked.fa", + "@SQ\tSN:CAXIUN010000104.1\tLN:10110\tM5:10013ae295fb0e1a002ab812d6c2e77e\tUR:GCA_964034985.1.subset.unmasked.fa", + "@SQ\tSN:CAXIUN010000129.1\tLN:29940\tM5:9579779c87681c88e68a924f572f5599\tUR:GCA_964034985.1.subset.unmasked.fa", + "@RG\tID:0de7f0a4/27--27\tPL:PACBIO\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:TRAC-2-8053\tPU:m84093_241116_151316_s2\tSM:TOL_ASG14652249\tPM:REVIO\tBC:ACTGCAGCACGAGTAT\tCM:R/P1-C1/5.0-25M", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:0de7f0a4/27--27\\tPL:PACBIO\\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:TRAC-2-8053\\tPU:m84093_241116_151316_s2\\tSM:TOL_ASG14652249\\tPM:REVIO\\tBC:ACTGCAGCACGAGTAT\\tCM:R/P1-C1/5.0-25M -I1G -a GCA_964034985.1.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o pacbio.SAMEA114784749.ERR14209104_test.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_test.bam -T pacbio.SAMEA114784749.ERR14209104_test.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_test_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_964034985.1.subset.unmasked.fa SAMEA114784749.ERR14209104_test.merge.bam 1/pacbio.SAMEA114784749.ERR14209104_test.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_test.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA114784749.ERR14209104_test.merge.bam SAMEA114784749.ERR14209104_test.merge.crumble.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools view --threads 3 --reference GCA_964034985.1.subset.unmasked.fa --output-fmt cram,version=3.0,archive,level=8,embed_ref=1 --write-index -o GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104_test.minimap2.cram GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104_test.minimap2.bam" + ] + }, [ "pacbio.SAMEA114784749.ERR14209104.hifitrimmer.summary.json:md5,238e515a0593f4c66e74bff41a33b63c", "pacbio.SAMEA114784749.ERR14209104_test.hifitrimmer.summary.json:md5,4ab835890a22ca1dd2206300f30fbc27" @@ -178,6 +209,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.4" }, - "timestamp": "2026-04-29T19:20:07.06121781" + "timestamp": "2026-06-04T16:11:38.490048351" } -} +} \ No newline at end of file diff --git a/tests/uli_no_lima.nf.test b/tests/uli_no_lima.nf.test index 0efc9e1f..99c780b6 100644 --- a/tests/uli_no_lima.nf.test +++ b/tests/uli_no_lima.nf.test @@ -29,6 +29,17 @@ nextflow_pipeline { def bam_path = getAllFilesFromDir(params.outdir, include: ['**/*.bam'], relative: true, includeDir: false) def fasta = 'https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/assembly/release/mMelMel3.1_paternal_haplotype/GCA_922984935.2.subset.fasta' + def strip_absolute_path_lines = { text -> + def lines = text?.getClass()?.isArray() + ? text.toList() + : (text instanceof Collection ? text : (text?.toString()?.readLines() ?: [])) + lines + .collect { line -> + line.toString() + .replaceAll(/\bUR:\/(?:[^\/\s]+\/)*([^\/\s]+)/, 'UR:$1') + } + } + assertAll( { assert workflow.success}, { assert snapshot( @@ -42,6 +53,8 @@ nextflow_pipeline { // Stable mapping files bam_path.collect{ f -> [(new File(f).getName()): bam("${params.outdir}/${f}").getStatistics()] }.collectEntries{ it }.sort(), cram_path.collect{ f -> [(new File(f).getName()): cram("${params.outdir}/${f}", fasta).getStatistics()] }.collectEntries{ it }.sort(), + bam_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(bam("${params.outdir}/${f}").getHeader())] }.collectEntries{ it }.sort(), + cram_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(cram("${params.outdir}/${f}", fasta).getHeader())] }.collectEntries{ it }.sort(), // Stable trimming json hifitrimmer_json.collect{ f -> diff --git a/tests/uli_no_lima.nf.test.snap b/tests/uli_no_lima.nf.test.snap index 1e08831b..f76ac480 100644 --- a/tests/uli_no_lima.nf.test.snap +++ b/tests/uli_no_lima.nf.test.snap @@ -75,14 +75,14 @@ "SAMTOOLS_MERGE": { "samtools": "1.23.1" }, - "SAMTOOLS_SPLITHEADER": { + "SAMTOOLS_SPLITHEADER_BAM": { "samtools": "1.23.1" }, "SAMTOOLS_STATS": { "samtools": "1.23.1" }, "Workflow": { - "sanger-tol/readmapping": "v2.0.3" + "sanger-tol/readmapping": "v2.1.0-dev" } }, [ @@ -162,7 +162,36 @@ } }, { - + + }, + { + "GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:CAXIUN010000020.1\tLN:15094", + "@SQ\tSN:CAXIUN010000038.1\tLN:1000", + "@SQ\tSN:CAXIUN010000104.1\tLN:10110", + "@SQ\tSN:CAXIUN010000129.1\tLN:29940", + "@RG\tID:0de7f0a4/27--27\tPL:PACBIO\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:TRAC-2-8053\tPU:m84093_241116_151316_s2\tSM:TOL_ASG14652249\tPM:REVIO\tBC:ACTGCAGCACGAGTAT\tCM:R/P1-C1/5.0-25M", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:0de7f0a4/27--27\\tPL:PACBIO\\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:TRAC-2-8053\\tPU:m84093_241116_151316_s2\\tSM:TOL_ASG14652249\\tPM:REVIO\\tBC:ACTGCAGCACGAGTAT\\tCM:R/P1-C1/5.0-25M -I1G -a GCA_964034985.1.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104.bam -T pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_964034985.1.subset.unmasked.fa SAMEA114784749.ERR14209104.merge.bam 1/pacbio.SAMEA114784749.ERR14209104.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA114784749.ERR14209104.merge.bam SAMEA114784749.ERR14209104.merge.crumble.bam" + ], + "GCA_964034985.1.subset.pacbio.SAMEA114784749.ERR14209104_test.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:CAXIUN010000020.1\tLN:15094", + "@SQ\tSN:CAXIUN010000038.1\tLN:1000", + "@SQ\tSN:CAXIUN010000104.1\tLN:10110", + "@SQ\tSN:CAXIUN010000129.1\tLN:29940", + "@RG\tID:0de7f0a4/27--27\tPL:PACBIO\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:TRAC-2-8053\tPU:m84093_241116_151316_s2\tSM:TOL_ASG14652249\tPM:REVIO\tBC:ACTGCAGCACGAGTAT\tCM:R/P1-C1/5.0-25M", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:0de7f0a4/27--27\\tPL:PACBIO\\tDS:READTYPE=CCS;Ipd:CodecV1=ip;PulseWidth:CodecV1=pw;BINDINGKIT=102-739-100;SEQUENCINGKIT=102-118-800;BASECALLERVERSION=5.0;SMRTCELLKIT=102-202-200;SMRTCELLID=EA138735;RUNID=r84093_20241115_102726;ICSVERSION=13.0.0.212033;MOVIELENGTH=1440.0;FRAMERATEHZ=100.000000;BarcodeFile=metadata/m84093_241116_151316_s2.barcodes.fasta;BarcodeHash=86d73e586a6d3ede0295785b51105eea;BarcodeCount=96;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:TRAC-2-8053\\tPU:m84093_241116_151316_s2\\tSM:TOL_ASG14652249\\tPM:REVIO\\tBC:ACTGCAGCACGAGTAT\\tCM:R/P1-C1/5.0-25M -I1G -a GCA_964034985.1.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o pacbio.SAMEA114784749.ERR14209104_test.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_test.bam -T pacbio.SAMEA114784749.ERR14209104_test.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_test_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_964034985.1.subset.unmasked.fa SAMEA114784749.ERR14209104_test.merge.bam 1/pacbio.SAMEA114784749.ERR14209104_test.hifitrimmer.fastq.gz.0.SAMEA114784749.ERR14209104_test.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA114784749.ERR14209104_test.merge.bam SAMEA114784749.ERR14209104_test.merge.crumble.bam" + ] + }, + { + }, [ "pacbio.SAMEA114784749.ERR14209104.hifitrimmer.summary.json:md5,f8d293d48de8a48ba7b1bffa56b5ab89", @@ -173,6 +202,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.4" }, - "timestamp": "2026-04-29T19:16:58.80829055" + "timestamp": "2026-06-04T16:08:54.193324076" } -} +} \ No newline at end of file diff --git a/tests/untrim.nf.test b/tests/untrim.nf.test index c776ae42..925013bf 100644 --- a/tests/untrim.nf.test +++ b/tests/untrim.nf.test @@ -31,6 +31,17 @@ nextflow_pipeline { def bam_path = getAllFilesFromDir(params.outdir, include: ['**/*.bam'], relative: true, includeDir: false) def fasta = 'https://tolit.cog.sanger.ac.uk/test-data/Meles_meles/assembly/release/mMelMel3.1_paternal_haplotype/GCA_922984935.2.subset.fasta' + def strip_absolute_path_lines = { text -> + def lines = text?.getClass()?.isArray() + ? text.toList() + : (text instanceof Collection ? text : (text?.toString()?.readLines() ?: [])) + lines + .collect { line -> + line.toString() + .replaceAll(/\bUR:\/(?:[^\/\s]+\/)*([^\/\s]+)/, 'UR:$1') + } + } + assertAll( { assert workflow.success}, { assert snapshot( @@ -44,6 +55,8 @@ nextflow_pipeline { // Stable mapping files bam_path.collect{ f -> [(new File(f).getName()): bam("${params.outdir}/${f}").getStatistics()] }.collectEntries{ it }.sort(), cram_path.collect{ f -> [(new File(f).getName()): cram("${params.outdir}/${f}", fasta).getStatistics()] }.collectEntries{ it }.sort(), + bam_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(bam("${params.outdir}/${f}").getHeader())] }.collectEntries{ it }.sort(), + cram_path.collect{ f -> [(new File(f).getName()): strip_absolute_path_lines(cram("${params.outdir}/${f}", fasta).getHeader())] }.collectEntries{ it }.sort(), // Stable trimming json hifitrimmer_json.collect{ f -> diff --git a/tests/untrim.nf.test.snap b/tests/untrim.nf.test.snap index c85069e7..513558c7 100644 --- a/tests/untrim.nf.test.snap +++ b/tests/untrim.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test --pacbio_adapter_fasta false --pacbio_adapter_yaml false --outfmt bam": { "content": [ - 68, + 69, { "BGZIP_BEDGRAPH": { "samtools": "1.23.1" @@ -60,14 +60,17 @@ "SAMTOOLS_REHEADER_BAM": { "samtools": "1.23.1" }, - "SAMTOOLS_SPLITHEADER": { + "SAMTOOLS_SPLITHEADER_BAM": { + "samtools": "1.23.1" + }, + "SAMTOOLS_SPLITHEADER_EXTRA": { "samtools": "1.23.1" }, "SAMTOOLS_STATS": { "samtools": "1.23.1" }, "Workflow": { - "sanger-tol/readmapping": "v2.0.3" + "sanger-tol/readmapping": "v2.1.0-dev" } }, [ @@ -192,16 +195,66 @@ } }, { - + + }, + { + "GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:PAE35587_pass_1f1f0707_115\tPL:ONT\tSM:SAMEA7524440", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-ont -y -R @RG\\tID:PAE35587_pass_1f1f0707_115\\tPL:ONT\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o PAE35587_pass_1f1f0707_115.subset.fastq.gz.0.SAMEA7524440.PAE35587.bam -T PAE35587_pass_1f1f0707_115.subset.fastq.gz.0.SAMEA7524440.PAE35587_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.PAE35587.merge.bam 1/PAE35587_pass_1f1f0707_115.subset.fastq.gz.0.SAMEA7524440.PAE35587.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.ont.SAMEA7524440.PAE35587.minimap2.bam" + ], + "GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939248.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:61ddc6c3/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200910_173211\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:61ddc6c3/15--15\\tPL:PACBIO\\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:DN615654G-A1\\tPU:m64094_200910_173211\\tPM:SEQUELII\\tBC:CACTCACGTGTGATATT\\tCM:S/P4-C2/5.0-8M\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o SAMEA7524440.ERR6939248_other.fastq.gz.0.SAMEA7524440.ERR6939248.bam -T SAMEA7524440.ERR6939248_other.fastq.gz.0.SAMEA7524440.ERR6939248_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.ERR6939248.merge.bam 1/SAMEA7524440.ERR6939248_other.fastq.gz.0.SAMEA7524440.ERR6939248.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA7524440.ERR6939248.merge.bam SAMEA7524440.ERR6939248.merge.crumble.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939248.minimap2.bam" + ], + "GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939249.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:aaa0cf18/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200911_174739\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@PG\tID:ccs-4.2.0.extra_header\tPN:ccs\tVN:4.2.0\tDS:Generate circular consensus sequences (ccs) from subreads.\tCL:ccs ccs --chunk 1/64 -j 8 --max-length 50000 ../../m64094_200911_174739.subreads.bam m64094_200911_174739.ccs.bam", + "@PG\tID:lima.extra_header\tVN:1.11.0 (commit v1.11.0)\tCL:lima -j 8 --split-bam-named --same --peek-guess --guess-min-count 1000 --ccs m64094_200911_174739.ccs.bam /lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta lima/m64094_200911_174739.ccs.bam", + "@PG\tID:samtools.extra_header\tPN:samtools\tVN:1.10\tPP:ccs-4.2.0.extra_header\tCL:samtools merge -@8 -ncp -b m64094_200911_174739.chunks.fofn m64094_200911_174739.ccs.bam", + "@PG\tID:samtools.1.extra_header\tPN:samtools\tPP:samtools.extra_header\tVN:1.23.1\tCL:samtools view -H /lustre/scratch122/tol/data/9/9/f/1/6/d/Meles_meles/genomic_data/mMelMel3/pacbio/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.bam", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:aaa0cf18/15--15\\tPL:PACBIO\\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:DN615654G-A1\\tPU:m64094_200911_174739\\tPM:SEQUELII\\tBC:CACTCACGTGTGATATT\\tCM:S/P4-C2/5.0-8M\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -\tPP:samtools.1.extra_header", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz.0.SAMEA7524440.ERR6939249.bam -T m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz.0.SAMEA7524440.ERR6939249_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.ERR6939249.merge.bam 1/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz.0.SAMEA7524440.ERR6939249.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.1\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA7524440.ERR6939249.merge.bam SAMEA7524440.ERR6939249.merge.crumble.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.pacbio.SAMEA7524440.ERR6939249.minimap2.bam" + ], + "GCA_922984935.2.subset.pacbio.SAMEA7524440.merged_1.minimap2.bam": [ + "@HD\tVN:1.6\tSO:coordinate", + "@SQ\tSN:OV277441.1\tLN:7999920\tM5:0457acf8690429f1c98ee545cb8573b8\tUR:GCA_922984935.2.subset.fasta.gz\tAS:GCA_922984935.2\tAN:SUPER_1\tSP:Meles meles", + "@RG\tID:aaa0cf18/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200911_174739\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@RG\tID:61ddc6c3/15--15\tPL:PACBIO\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\tLB:DN615654G-A1\tPU:m64094_200910_173211\tPM:SEQUELII\tBC:CACTCACGTGTGATATT\tCM:S/P4-C2/5.0-8M\tSM:SAMEA7524440", + "@PG\tID:minimap2\tPN:minimap2\tVN:2.30-r1287\tCL:minimap2 -t4 -ax map-hifi --cs=short -y -R @RG\\tID:aaa0cf18/15--15\\tPL:PACBIO\\tDS:READTYPE=CCS;BINDINGKIT=101-789-500;SEQUENCINGKIT=101-826-100;BASECALLERVERSION=5.0.0;FRAMERATEHZ=100.000000;BarcodeFile=/lustre/scratch116/vr/projects/vgp/ref/barcodes/Sequel_16_Barcodes_v3.fasta;BarcodeHash=e418d89cefcbef90f3cb0e6455b7e2a3;BarcodeCount=16;BarcodeMode=Symmetric;BarcodeQuality=Score\\tLB:DN615654G-A1\\tPU:m64094_200911_174739\\tPM:SEQUELII\\tBC:CACTCACGTGTGATATT\\tCM:S/P4-C2/5.0-8M\\tSM:SAMEA7524440 -I1G -a GCA_922984935.2.subset.unmasked.mmi -", + "@PG\tID:samtools\tPN:samtools\tPP:minimap2\tVN:1.23.1\tCL:samtools sort -@ 3 -o m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz.0.SAMEA7524440.ERR6939249.bam -T m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz.0.SAMEA7524440.ERR6939249_sort_tmp --write-index -l1 -", + "@PG\tID:samtools.1\tPN:samtools\tPP:samtools\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p --reference GCA_922984935.2.subset.unmasked.fa SAMEA7524440.ERR6939249.merge.bam 1/m64094_200911_174739.ccs.bc1022_BAK8B_OA--bc1022_BAK8B_OA.subset.fastq.gz.0.SAMEA7524440.ERR6939249.bam", + "@PG\tID:samtools.2\tPN:samtools\tPP:samtools.1\tVN:1.23.1\tCL:samtools merge --threads 3 -c -p SAMEA7524440.merged_1.merge.bam 1/SAMEA7524440.ERR6939249.merge.bam 2/SAMEA7524440.ERR6939248.merge.bam", + "@PG\tID:crumble\tPN:crumble\tPP:samtools.2\tVN:0.9.1\tCL:crumble -y pbccs -O bam SAMEA7524440.merged_1.merge.bam SAMEA7524440.merged_1.merge.crumble.bam", + "@PG\tID:samtools.3\tPN:samtools\tPP:crumble\tVN:1.23.1\tCL:samtools reheader temp.sorted.header.sam input/GCA_922984935.2.subset.pacbio.SAMEA7524440.merged_1.minimap2.bam" + ] + }, + { + }, [ - + ] ], "meta": { "nf-test": "0.9.3", "nextflow": "25.10.4" }, - "timestamp": "2026-04-29T19:28:07.623617833" + "timestamp": "2026-06-04T15:41:59.639942625" } -} +} \ No newline at end of file diff --git a/workflows/readmapping.nf b/workflows/readmapping.nf index 50797945..f522562f 100644 --- a/workflows/readmapping.nf +++ b/workflows/readmapping.nf @@ -159,7 +159,7 @@ workflow READMAPPING { emit: - versions = ch_collated_versions // channel: [ path(versions.yml) ] + versions = ch_collated_versions // channel: [ path(versions.yml) ] }