diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bd88ef5..7a2f87f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#451](https://github.com/genomic-medicine-sweden/nallo/pull/451) - Simplified methylation subworkflow - [#474](https://github.com/genomic-medicine-sweden/nallo/pull/474) - Updated VEP and CADD channels to fix bugs introduced in [#443](https://github.com/genomic-medicine-sweden/nallo/pull/443) - [#479](https://github.com/genomic-medicine-sweden/nallo/pull/479) - Replaced bgzip tabix with bcftools sort in rank variants to fix [#457](https://github.com/genomic-medicine-sweden/nallo/issues/457) +- [#480](https://github.com/genomic-medicine-sweden/nallo/pull/480) - Updated ranking of SVs to work with multiple families per project - [#484](https://github.com/genomic-medicine-sweden/nallo/pull/484) - Updated metro map and added SVG version - [#487](https://github.com/genomic-medicine-sweden/nallo/pull/487) - Changed CI tests to only run tests where changes have been made diff --git a/conf/modules/general.config b/conf/modules/general.config index 92c504de..bcec5299 100644 --- a/conf/modules/general.config +++ b/conf/modules/general.config @@ -113,7 +113,14 @@ process { withName: '.*:NALLO:SOMALIER_PED' { publishDir = [ - path: { "${params.outdir}/pedigree" }, + path: { "${params.outdir}/pedigree/project/" }, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, + ] + } + + withName: '.*:NALLO:SOMALIER_PED_FAMILY' { + publishDir = [ + path: { "${params.outdir}/pedigree/family/" }, saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, ] } diff --git a/docs/output.md b/docs/output.md index 85de861f..11b8d461 100644 --- a/docs/output.md +++ b/docs/output.md @@ -121,12 +121,13 @@ If the pipeline is run with phasing, the aligned reads will be happlotagged usin [somalier](https://github.com/brentp/somalier) checks relatedness and sex. -| Path | Description | -| ----------------------------------------------------- | ------------------------------------------- | -| `pedigree/{project}.ped` | PED file updated with somalier-inferred sex | -| `qc/somalier/relate/{project}/{project}.html` | HTML report | -| `qc/somalier/relate/{project}/{project}.pairs.tsv` | Information about sample pairs | -| `/qc/somalier/relate/{project}/{project}.samples.tsv` | Information about individual samples | +| Path | Description | +| ----------------------------------------------------- | ------------------------------------------------------- | +| `pedigree/{project}/{project}.ped` | PED file updated with somalier-inferred sex per project | +| `pedigree/{family}/{family).ped` | PED file updated with somalier-inferred sex per family | +| `qc/somalier/relate/{project}/{project}.html` | HTML report | +| `qc/somalier/relate/{project}/{project}.pairs.tsv` | Information about sample pairs | +| `/qc/somalier/relate/{project}/{project}.samples.tsv` | Information about individual samples | | Path | Description | | ------------------------- | ------------------------------------------- | diff --git a/modules.json b/modules.json index 9a4a3b04..4195dd68 100644 --- a/modules.json +++ b/modules.json @@ -114,12 +114,12 @@ }, "genmod/models": { "branch": "master", - "git_sha": "91a84f951358143e93dc9e03470db4e6a4a7105c", + "git_sha": "f888300c726e1f817a9f93a680866ff7e6c669f6", "installed_by": ["modules"] }, "genmod/score": { "branch": "master", - "git_sha": "91a84f951358143e93dc9e03470db4e6a4a7105c", + "git_sha": "f888300c726e1f817a9f93a680866ff7e6c669f6", "installed_by": ["modules"] }, "gfastats": { diff --git a/modules/local/create_pedigree_file/main.nf b/modules/local/create_pedigree_file/main.nf index 10ab7e81..fc6eca46 100644 --- a/modules/local/create_pedigree_file/main.nf +++ b/modules/local/create_pedigree_file/main.nf @@ -1,5 +1,5 @@ process CREATE_PEDIGREE_FILE { - tag "${project}" + tag "${meta.id}" label 'process_single' conda "conda-forge::python=3.8.3" @@ -8,20 +8,20 @@ process CREATE_PEDIGREE_FILE { 'biocontainers/python:3.8.3' }" input: - tuple val(project), val(meta) + tuple val(meta), val(metas) output: - tuple val(project), path("*.ped"), emit: ped - path "versions.yml" , emit: versions + tuple val(meta), path("*.ped"), emit: ped + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def out = new File(project + ".ped") - def samples = (meta.collect().size() > 1) ? meta.sort{ a, b -> + def prefix = task.ext.prefix ?: "${meta.id}" + def samples = (metas.collect().size() > 1) ? metas.sort{ a, b -> // First sort on family_id, then on sample id - a.family_id <=> b.family_id ?: a.id <=> b.id } : meta + a.family_id <=> b.family_id ?: a.id <=> b.id } : metas outfile_text = ['#family_id', 'sample_id', 'father', 'mother', 'sex', 'phenotype'].join('\\t') def samples_list = [] for(int i = 0; i${project}.ped + echo -e "$outfile_text" > ${prefix}.ped cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -42,8 +42,9 @@ process CREATE_PEDIGREE_FILE { """ stub: + def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${project}.ped + touch ${prefix}.ped cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/genmod/models/main.nf b/modules/nf-core/genmod/models/main.nf index ff71b660..a869221e 100644 --- a/modules/nf-core/genmod/models/main.nf +++ b/modules/nf-core/genmod/models/main.nf @@ -8,8 +8,7 @@ process GENMOD_MODELS { 'biocontainers/genmod:3.9--pyhdfd78af_0' }" input: - tuple val(meta), path(input_vcf) - path (fam) + tuple val(meta), path(input_vcf), path (fam) path (reduced_penetrance) output: diff --git a/modules/nf-core/genmod/models/meta.yml b/modules/nf-core/genmod/models/meta.yml index dca74095..a6249114 100644 --- a/modules/nf-core/genmod/models/meta.yml +++ b/modules/nf-core/genmod/models/meta.yml @@ -22,9 +22,9 @@ input: type: file description: vcf file pattern: "*.{vcf}" - - - fam: + - fam: type: file - description: file with family information + description: PED file with family information - - reduced_penetrance: type: file description: file with gene ids that have reduced penetrance diff --git a/modules/nf-core/genmod/models/tests/main.nf.test b/modules/nf-core/genmod/models/tests/main.nf.test index afa85dfc..0b9a3ebd 100644 --- a/modules/nf-core/genmod/models/tests/main.nf.test +++ b/modules/nf-core/genmod/models/tests/main.nf.test @@ -15,10 +15,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_annotate.vcf.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_annotate.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) ] - input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) - input[2] = [] + input[1] = [] """ } } @@ -44,10 +44,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_annotate.vcf.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_annotate.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) ] - input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) - input[2] = [] + input[1] = [] """ } } diff --git a/modules/nf-core/genmod/score/main.nf b/modules/nf-core/genmod/score/main.nf index 41d57bdc..756fc731 100644 --- a/modules/nf-core/genmod/score/main.nf +++ b/modules/nf-core/genmod/score/main.nf @@ -8,8 +8,7 @@ process GENMOD_SCORE { 'biocontainers/genmod:3.9--pyhdfd78af_0' }" input: - tuple val(meta), path(input_vcf) - path (fam) + tuple val(meta), path(input_vcf), path (fam) path (score_config) output: diff --git a/modules/nf-core/genmod/score/meta.yml b/modules/nf-core/genmod/score/meta.yml index 32da6468..c5fe2e2a 100644 --- a/modules/nf-core/genmod/score/meta.yml +++ b/modules/nf-core/genmod/score/meta.yml @@ -22,9 +22,9 @@ input: type: file description: vcf file pattern: "*.{vcf}" - - - fam: + - fam: type: file - description: file with family information + description: PED file with family information - - score_config: type: file description: rank model config file diff --git a/modules/nf-core/genmod/score/tests/main.nf.test b/modules/nf-core/genmod/score/tests/main.nf.test index 98c8f35a..6181f63a 100644 --- a/modules/nf-core/genmod/score/tests/main.nf.test +++ b/modules/nf-core/genmod/score/tests/main.nf.test @@ -15,10 +15,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_models.vcf.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_models.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) ] - input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) - input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/genmod/svrank_model_-v1.8-.ini', checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/genmod/svrank_model_-v1.8-.ini', checkIfExists: true) """ } } @@ -44,10 +44,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_models.vcf.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_models.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) ] - input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) - input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/genmod/svrank_model_-v1.8-.ini', checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/genmod/svrank_model_-v1.8-.ini', checkIfExists: true) """ } } diff --git a/subworkflows/local/rank_variants/main.nf b/subworkflows/local/rank_variants/main.nf index c416b248..db7e0139 100644 --- a/subworkflows/local/rank_variants/main.nf +++ b/subworkflows/local/rank_variants/main.nf @@ -12,7 +12,7 @@ workflow RANK_VARIANTS { take: ch_vcf // channel: [mandatory] [ val(meta), path(vcf) ] - ch_pedfile // channel: [mandatory] [ val(meta), path(ped) ] + ch_ped // channel: [mandatory] [ val(meta), path(ped) ] ch_reduced_penetrance // channel: [mandatory] [ val(meta), path(pentrance) ] ch_score_config // channel: [mandatory] [ val(meta), path(ini) ] @@ -22,16 +22,22 @@ workflow RANK_VARIANTS { GENMOD_ANNOTATE ( ch_vcf ) ch_versions = ch_versions.mix(GENMOD_ANNOTATE.out.versions) + GENMOD_ANNOTATE.out.vcf + .join( ch_ped, failOnMismatch: true ) + .set { genmod_models_in } + GENMOD_MODELS ( - GENMOD_ANNOTATE.out.vcf, - ch_pedfile.map { meta, ped -> ped }, + genmod_models_in, ch_reduced_penetrance.map { meta, file -> file } ) ch_versions = ch_versions.mix(GENMOD_MODELS.out.versions) + GENMOD_MODELS.out.vcf + .join( ch_ped, failOnMismatch: true ) + .set { genmod_score_in } + GENMOD_SCORE ( - GENMOD_MODELS.out.vcf, - ch_pedfile.map { meta, ped -> ped }, + genmod_score_in, ch_score_config.map { meta, file -> file } ) ch_versions = ch_versions.mix(GENMOD_SCORE.out.versions) diff --git a/subworkflows/local/rank_variants/tests/main.nf.test b/subworkflows/local/rank_variants/tests/main.nf.test index 473f16c8..a544a445 100644 --- a/subworkflows/local/rank_variants/tests/main.nf.test +++ b/subworkflows/local/rank_variants/tests/main.nf.test @@ -28,7 +28,7 @@ nextflow_workflow { process { """ input[0] = [ - [ id: 'test', num_intervals:1 ], + [ id: 'project', num_intervals:1 ], file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.fastq.gz', checkIfExists: true) ] input[1] = PREPARE_GENOME.out.fasta @@ -46,7 +46,7 @@ nextflow_workflow { input[0] = MINIMAP2_ALIGN.out.bam .join(MINIMAP2_ALIGN.out.index) .join(Channel.of([ - [ id: 'test', num_intervals:1 ], + [ id: 'project', num_intervals:1 ], file(params.pipelines_testdata_base_path + 'reference/test_data.bed', checkIfExists: true) ])) input[1] = PREPARE_GENOME.out.fasta @@ -95,9 +95,9 @@ nextflow_workflow { process { """ input[0] = [ - 'project', + [id:'project'], [ - [ id: 'test', project: 'project', maternal_id: '0', paternal_id: '0', family_id: 'family', sex: '2', phenotype: '2' ] + [ id: 'project', project: 'project', maternal_id: '0', paternal_id: '0', family_id: 'family', sex: '2', phenotype: '2' ] ] ] """ @@ -110,8 +110,8 @@ nextflow_workflow { when { workflow { """ - input[0] = ANNOTATE_CSQ_PLI.out.vcf - input[1] = CREATE_PEDIGREE_FILE.out.ped + input[0] = ANNOTATE_CSQ_PLI.out.vcf.map { meta, vcf -> [ [ id: 'test' ], vcf ] } + input[1] = CREATE_PEDIGREE_FILE.out.ped.map { meta, ped -> [ [ id: 'test' ], ped ] } input[2] = Channel.of([ [ id: 'reduced_penetrance' ], file(params.pipelines_testdata_base_path + 'reference/reduced_penetrance.tsv', checkIfExists: true) @@ -142,8 +142,8 @@ nextflow_workflow { when { workflow { """ - input[0] = ANNOTATE_CSQ_PLI.out.vcf - input[1] = CREATE_PEDIGREE_FILE.out.ped + input[0] = ANNOTATE_CSQ_PLI.out.vcf.map { meta, vcf -> [ [ id: 'test' ], vcf ] } + input[1] = CREATE_PEDIGREE_FILE.out.ped.map { meta, ped -> [ [ id: 'test' ], ped ] } input[2] = Channel.of([ [ id: 'reduced_penetrance' ], file(params.pipelines_testdata_base_path + 'reference/reduced_penetrance.tsv', checkIfExists: true) diff --git a/subworkflows/local/rank_variants/tests/main.nf.test.snap b/subworkflows/local/rank_variants/tests/main.nf.test.snap index 19326d68..a955bed6 100644 --- a/subworkflows/local/rank_variants/tests/main.nf.test.snap +++ b/subworkflows/local/rank_variants/tests/main.nf.test.snap @@ -15,21 +15,17 @@ "0": [ [ { - "id": "test_data.bed", - "project": null, - "contains_affected": false + "id": "test" }, - "test_data.bed_sorted.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test_sorted.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "1": [ [ { - "id": "test_data.bed", - "project": null, - "contains_affected": false + "id": "test" }, - "test_data.bed_sorted.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test_sorted.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "2": [ @@ -42,21 +38,17 @@ "tbi": [ [ { - "id": "test_data.bed", - "project": null, - "contains_affected": false + "id": "test" }, - "test_data.bed_sorted.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test_sorted.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "vcf": [ [ { - "id": "test_data.bed", - "project": null, - "contains_affected": false + "id": "test" }, - "test_data.bed_sorted.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test_sorted.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "versions": [ @@ -72,6 +64,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-11-01T13:03:00.102392544" + "timestamp": "2024-11-04T14:34:36.22073696" } } \ No newline at end of file diff --git a/tests/samplesheet.nf.test.snap b/tests/samplesheet.nf.test.snap index 3fbdad9a..9e77b8bc 100644 --- a/tests/samplesheet.nf.test.snap +++ b/tests/samplesheet.nf.test.snap @@ -1,7 +1,7 @@ { "test profile": { "content": [ - 111, + 112, { "ADD_FOUND_IN_TAG": { "bcftools": 1.2, @@ -185,6 +185,10 @@ "create_pedigree_file": 1.0, "python": "3.8.3" }, + "SOMALIER_PED_FAMILY": { + "create_pedigree_file": 1.0, + "python": "3.8.3" + }, "SPLITUBAM": { "splitubam": "0.1.1" }, @@ -301,7 +305,10 @@ "paraphase/HG002_Revio/HG002_Revio_paraphase_vcfs/HG002_Revio_hba.vcf.gz", "paraphase/HG002_Revio/HG002_Revio_paraphase_vcfs/HG002_Revio_hba.vcf.gz.tbi", "pedigree", - "pedigree/test.ped", + "pedigree/family", + "pedigree/family/FAM.ped", + "pedigree/project", + "pedigree/project/test.ped", "phased_variants", "phased_variants/HG002_Revio", "phased_variants/HG002_Revio/HG002_Revio_phased.vcf.gz", @@ -423,6 +430,7 @@ "multiqc_fastqc.txt:md5,f0717ca13d848aa8f5eaa5d0dba92178", "multiqc_general_stats.txt:md5,c82b773e9d5ab3251280f3f03f35193a", "multiqc_whatshap_stats.txt:md5,c8c212ecc6fbf6803f8de87f2395363f", + "FAM.ped:md5,bd5cec27ba7337a85cf98e787131e2b5", "test.ped:md5,bd5cec27ba7337a85cf98e787131e2b5", "HG002_Revio_cramino_aligned_phased.arrow:md5,72df2934ff8aa7e1bf8cf8a4881a0d2a", "HG002_Revio_cramino_aligned.arrow:md5,72df2934ff8aa7e1bf8cf8a4881a0d2a", @@ -536,6 +544,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-31T16:12:33.482377002" + "timestamp": "2024-11-05T13:41:06.05402932" } } \ No newline at end of file diff --git a/tests/samplesheet_multisample_bam.nf.test.snap b/tests/samplesheet_multisample_bam.nf.test.snap index cb232f89..8c4a97ed 100644 --- a/tests/samplesheet_multisample_bam.nf.test.snap +++ b/tests/samplesheet_multisample_bam.nf.test.snap @@ -1,7 +1,7 @@ { "samplesheet_multisample_bam | --phaser hiphase": { "content": [ - 156, + 157, { "ADD_FOUND_IN_TAG": { "bcftools": 1.2, @@ -182,6 +182,10 @@ "create_pedigree_file": 1.0, "python": "3.8.3" }, + "SOMALIER_PED_FAMILY": { + "create_pedigree_file": 1.0, + "python": "3.8.3" + }, "SPLITUBAM": { "splitubam": "0.1.1" }, @@ -333,7 +337,10 @@ "paraphase/HG002_Revio_B/HG002_Revio_B_paraphase_vcfs/HG002_Revio_B_hba.vcf.gz", "paraphase/HG002_Revio_B/HG002_Revio_B_paraphase_vcfs/HG002_Revio_B_hba.vcf.gz.tbi", "pedigree", - "pedigree/test.ped", + "pedigree/family", + "pedigree/family/FAM.ped", + "pedigree/project", + "pedigree/project/test.ped", "phased_variants", "phased_variants/HG002_Revio_A", "phased_variants/HG002_Revio_A/HG002_Revio_A_phased.blocks.tsv", @@ -530,6 +537,7 @@ "multiqc_fastqc.txt:md5,18ca1a3fb2afa8988dc5d604c049cd9c", "multiqc_general_stats.txt:md5,4a2c114e57d5581b606012d1604d51fa", "multiqc_whatshap_stats.txt:md5,96447de4e14a9b4a570c24513de64970", + "FAM.ped:md5,24d8694d580f782ed77d4d1b5c6f6fb4", "test.ped:md5,24d8694d580f782ed77d4d1b5c6f6fb4", "HG002_Revio_A_phased.blocks.tsv:md5,27ce044ba581da15ef838cbb343a64cf", "HG002_Revio_A_phased.stats.tsv:md5,58ae1b01d01b922d022ad025a81f1026", @@ -733,6 +741,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-31T16:14:41.962593731" + "timestamp": "2024-11-05T13:42:51.526893089" } } \ No newline at end of file diff --git a/tests/samplesheet_multisample_ont_bam.nf.test.snap b/tests/samplesheet_multisample_ont_bam.nf.test.snap index f186dfa3..cf41a33c 100644 --- a/tests/samplesheet_multisample_ont_bam.nf.test.snap +++ b/tests/samplesheet_multisample_ont_bam.nf.test.snap @@ -1,7 +1,7 @@ { "samplesheet_multisample_ont_bam | --preset ONT_R10 --phaser whatshap --parallel_alignments 1 --parallel_snv 1": { "content": [ - 103, + 104, { "ADD_FOUND_IN_TAG": { "bcftools": 1.2, @@ -143,6 +143,10 @@ "create_pedigree_file": 1.0, "python": "3.8.3" }, + "SOMALIER_PED_FAMILY": { + "create_pedigree_file": 1.0, + "python": "3.8.3" + }, "SPLIT_BED_CHUNKS": { "split_bed_chunks": 1.0 }, @@ -247,7 +251,10 @@ "paraphase/HG002_ONT_B/HG002_ONT_B_paraphase_vcfs/HG002_ONT_B_hba.vcf.gz", "paraphase/HG002_ONT_B/HG002_ONT_B_paraphase_vcfs/HG002_ONT_B_hba.vcf.gz.tbi", "pedigree", - "pedigree/test.ped", + "pedigree/family", + "pedigree/family/FAM.ped", + "pedigree/project", + "pedigree/project/test.ped", "phased_variants", "phased_variants/HG002_ONT_A", "phased_variants/HG002_ONT_A/HG002_ONT_A_phased.vcf.gz", @@ -375,6 +382,7 @@ "multiqc_fastqc.txt:md5,5254c5d578af3a24182ccf3248183ac6", "multiqc_general_stats.txt:md5,0722f1462d3502d5383eb86a484192c6", "multiqc_whatshap_stats.txt:md5,5c4b972c8d52b3d997f117b39ba3ad5d", + "FAM.ped:md5,deb1ee6bd38d6e8f7cb92801d8a12f12", "test.ped:md5,deb1ee6bd38d6e8f7cb92801d8a12f12", "HG002_ONT_A_cramino_aligned_phased.arrow:md5,d2a5c81595fa34925ab8f03078487d81", "HG002_ONT_B_cramino_aligned_phased.arrow:md5,61af72539e105cec79db7c9b78eb15a7", @@ -477,6 +485,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-31T16:16:52.848104929" + "timestamp": "2024-11-05T13:44:39.150334649" } } \ No newline at end of file diff --git a/workflows/nallo.nf b/workflows/nallo.nf index 312ae3e0..84aee66d 100644 --- a/workflows/nallo.nf +++ b/workflows/nallo.nf @@ -40,6 +40,7 @@ include { SNV_ANNOTATION } from '../subworkflows/local/ // local include { CREATE_PEDIGREE_FILE as SAMPLESHEET_PED } from '../modules/local/create_pedigree_file/main' include { CREATE_PEDIGREE_FILE as SOMALIER_PED } from '../modules/local/create_pedigree_file/main' +include { CREATE_PEDIGREE_FILE as SOMALIER_PED_FAMILY } from '../modules/local/create_pedigree_file/main' include { ECHTVAR_ENCODE } from '../modules/local/echtvar/encode/main' include { SAMTOOLS_MERGE } from '../modules/nf-core/samtools/merge/main' @@ -190,7 +191,7 @@ workflow NALLO { // Create PED from samplesheet // ch_input - .map { meta, files -> [ meta.project, meta ] } + .map { meta, files -> [ [ id: meta.project ], meta ] } .groupTuple() .set { ch_samplesheet_ped_in } @@ -198,7 +199,6 @@ workflow NALLO { ch_versions = ch_versions.mix(SAMPLESHEET_PED.out.versions) SAMPLESHEET_PED.out.ped - .map { project, ped -> [ [ 'id': project ], ped ] } .collect() .set { ch_samplesheet_pedfile } @@ -216,10 +216,10 @@ workflow NALLO { bam_bai = BAM_INFER_SEX.out.bam_bai // - // Create PED with updated sex + // Create PED with updated sex per project (should perphaps be per SNV-calling region) // bam - .map { meta, files -> [ meta.project, meta ] } + .map { meta, files -> [ [ id: meta.project ], meta ] } .groupTuple() .set { ch_somalier_ped_in } @@ -227,10 +227,23 @@ workflow NALLO { ch_versions = ch_versions.mix(SOMALIER_PED.out.versions) SOMALIER_PED.out.ped - .map { project, ped -> [ [ 'id': project ], ped ] } .collect() .set { ch_updated_pedfile } + // + // Create PED with updated sex - per family + // + bam + .map { meta, files -> [ [ id: meta.family_id ], meta ] } + .groupTuple() + .set { ch_somalier_ped_family_in } + + SOMALIER_PED_FAMILY ( ch_somalier_ped_family_in ) + ch_versions = ch_versions.mix(SOMALIER_PED_FAMILY.out.versions) + + SOMALIER_PED_FAMILY.out.ped + .set { ch_updated_pedfile_family } + // // Run read QC with FastQC, mosdepth and cramino // @@ -356,6 +369,12 @@ workflow NALLO { ) ch_versions = ch_versions.mix(ANN_CSQ_PLI_SNV.out.versions) + // Give pedfile meta from + ANN_CSQ_PLI_SNV.out.vcf + .combine(ch_updated_pedfile.map { meta, ped -> ped } ) + .map { meta, vcf, ped -> [ meta, ped ] } + .set { rank_snvs_ped_in } + // // Ranks one multisample VCF per variant call region // Can only run if samplesheet has affected samples @@ -364,7 +383,7 @@ workflow NALLO { // Only run if we have affected individuals RANK_VARIANTS_SNV ( ANN_CSQ_PLI_SNV.out.vcf, - ch_updated_pedfile, + rank_snvs_ped_in, ch_reduced_penetrance, ch_score_config_snv ) @@ -534,7 +553,7 @@ workflow NALLO { if (!params.skip_rank_variants) { RANK_VARIANTS_SVS ( ANN_CSQ_PLI_SVS.out.vcf, - ch_updated_pedfile, + ch_updated_pedfile_family, ch_reduced_penetrance, ch_score_config_svs )