Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sex check #453

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- New parameters to skip fastqc and haplocheck (`--skip_fastqc` and `--skip_haplocheck`) [#438](https://github.com/nf-core/raredisease/pull/438)
- CNVnator for copy number variant calling [#438](https://github.com/nf-core/raredisease/pull/434)
- A new parameter `svdb_query_bedpedbs` to provide bedpe files as databases for SVDB query [#449](https://github.com/nf-core/raredisease/pull/449)
- ngsbits samplegender to check sex [#453] (https://github.com/nf-core/raredisease/pull/453)

### `Changed`

Expand Down
2 changes: 2 additions & 0 deletions CITATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@

> Pedersen BS, Quinlan AR. Mosdepth: quick coverage calculation for genomes and exomes. Hancock J, ed. Bioinformatics. 2018;34(5):867-868. doi:10.1093/bioinformatics/btx699

- [ngs-bits-samplegender](https://github.com/imgag/ngs-bits/tree/master)

- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/)

> Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924.
Expand Down
11 changes: 11 additions & 0 deletions conf/modules/qc_bam.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ process {
ext.prefix = { "${meta.id}_mosdepth" }
}

withName: '.*QC_BAM:NGSBITS_SAMPLEGENDER' {
// NGSBITS_SAMPLEGENDER needs a chrX and chrY in order to run so we skip it for the two test profiles
ext.when = { !(workflow.profile.tokenize(',').intersect(['test', 'test_one_sample', 'test_sentieon']).size() >= 1) || workflow.stubRun }
Lucpen marked this conversation as resolved.
Show resolved Hide resolved
ext.prefix = { "${meta.id}_ngsbits_sex" }
publishDir = [
path: { "${params.outdir}/ngsbits_samplegender" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*QC_BAM:PICARD_COLLECTWGSMETRICS' {
ext.when = { params.analysis_type.equals("wgs") && params.aligner.equals("bwamem2") }
ext.prefix = { "${meta.id}_wgsmetrics" }
Expand Down
1 change: 1 addition & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ params.known_dbsnp = WorkflowMain.getGenomeAttribute(params,
params.known_dbsnp_tbi = WorkflowMain.getGenomeAttribute(params, 'known_dbsnp_tbi')
params.ml_model = WorkflowMain.getGenomeAttribute(params, 'ml_model')
params.mt_fasta = WorkflowMain.getGenomeAttribute(params, 'mt_fasta')
params.ngsbits_samplegender_method = WorkflowMain.getGenomeAttribute(params, 'ngsbits_samplegender_method')
params.ploidy_model = WorkflowMain.getGenomeAttribute(params, 'ploidy_model')
params.reduced_penetrance = WorkflowMain.getGenomeAttribute(params, 'reduced_penetrance')
params.readcount_intervals = WorkflowMain.getGenomeAttribute(params, 'readcount_intervals')
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@
"git_sha": "a6e11ac655e744f7ebc724be669dd568ffdc0e80",
"installed_by": ["modules"]
},
"ngsbits/samplegender": {
"branch": "master",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"peddy": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/ngsbits/samplegender/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions modules/nf-core/ngsbits/samplegender/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions modules/nf-core/ngsbits/samplegender/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
params {

// Required options
input = null
input = null

// References
genome = 'GRCh38'
Expand All @@ -37,6 +37,9 @@ params {
cadd_resources = null
platform = 'illumina'

// Bam_qc
ngsbits_samplegender_method = 'xy'

// File params
svdb_query_bedpedbs = null
svdb_query_dbs = null
Expand Down
9 changes: 8 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@
"fa_icon": "fas fa-align-center",
"enum": ["illumina"]
},
"ngsbits_samplegender_method": {
"type": "string",
"default": "xy",
"enum": ["xy", "hetx", "sry"],
"description": "Method selection for ngs-bits samplegender",
"fa_icon": "fas fa-align-center"
},
"save_mapped_as_cram": {
"type": "boolean",
"description": "Specifies whether to generate and publish alignment files as cram instead of bam",
Expand Down Expand Up @@ -473,7 +480,7 @@
"cnvnator_binsize": {
"type": "number",
"description": "Bin size for CNVnator",
"default": "1000",
"default": 1000,
"fa_icon": "fas fa-align-center"
},
"sentieon_dnascope_pcr_indel_model": {
Expand Down
27 changes: 17 additions & 10 deletions subworkflows/local/qc_bam.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ include { PICARD_COLLECTWGSMETRICS as PICARD_COLLECTWGSMETRICS } from '../../m
include { PICARD_COLLECTWGSMETRICS as PICARD_COLLECTWGSMETRICS_Y } from '../../modules/nf-core/picard/collectwgsmetrics/main'
include { SENTIEON_WGSMETRICS } from '../../modules/nf-core/sentieon/wgsmetrics/main'
include { SENTIEON_WGSMETRICS as SENTIEON_WGSMETRICS_Y } from '../../modules/nf-core/sentieon/wgsmetrics/main'
include { NGSBITS_SAMPLEGENDER } from '../../modules/nf-core/ngsbits/samplegender/main'

workflow QC_BAM {

take:
ch_bam // channel: [mandatory] [ val(meta), path(bam) ]
ch_bai // channel: [mandatory] [ val(meta), path(bai) ]
ch_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_bait_intervals // channel: [mandatory] [ path(intervals_list) ]
ch_target_intervals // channel: [mandatory] [ path(intervals_list) ]
ch_chrom_sizes // channel: [mandatory] [ path(sizes) ]
ch_intervals_wgs // channel: [mandatory] [ path(intervals) ]
ch_intervals_y // channel: [mandatory] [ path(intervals) ]
ch_bam // channel: [mandatory] [ val(meta), path(bam) ]
ch_bai // channel: [mandatory] [ val(meta), path(bai) ]
ch_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_bait_intervals // channel: [mandatory] [ path(intervals_list) ]
ch_target_intervals // channel: [mandatory] [ path(intervals_list) ]
ch_chrom_sizes // channel: [mandatory] [ path(sizes) ]
ch_intervals_wgs // channel: [mandatory] [ path(intervals) ]
ch_intervals_y // channel: [mandatory] [ path(intervals) ]
ngsbits_samplegender_method // channel [val(method)]

main:
ch_versions = Channel.empty()
Expand Down Expand Up @@ -59,6 +61,9 @@ workflow QC_BAM {
SENTIEON_WGSMETRICS ( ch_bam_bai, ch_genome_fasta, ch_genome_fai, ch_intervals_wgs.map{ interval -> [[:], interval]} )
SENTIEON_WGSMETRICS_Y ( ch_bam_bai, ch_genome_fasta, ch_genome_fai, ch_intervals_y.map{ interval -> [[:], interval]} )

// Check sex
NGSBITS_SAMPLEGENDER(ch_bam_bai, ch_genome_fasta, ch_genome_fai, ngsbits_samplegender_method)

ch_cov = Channel.empty().mix(PICARD_COLLECTWGSMETRICS.out.metrics, SENTIEON_WGSMETRICS.out.wgs_metrics)
ch_cov_y = Channel.empty().mix(PICARD_COLLECTWGSMETRICS_Y.out.metrics, SENTIEON_WGSMETRICS_Y.out.wgs_metrics)

Expand All @@ -67,6 +72,7 @@ workflow QC_BAM {
ch_versions = ch_versions.mix(TIDDIT_COV.out.versions.first())
ch_versions = ch_versions.mix(UCSC_WIGTOBIGWIG.out.versions.first())
ch_versions = ch_versions.mix(MOSDEPTH.out.versions.first())
ch_versions = ch_versions.mix(NGSBITS_SAMPLEGENDER.out.versions.first())
ch_versions = ch_versions.mix(PICARD_COLLECTWGSMETRICS.out.versions.first(), SENTIEON_WGSMETRICS.out.versions.first())
ch_versions = ch_versions.mix(PICARD_COLLECTWGSMETRICS_Y.out.versions.first(), SENTIEON_WGSMETRICS_Y.out.versions.first())

Expand All @@ -78,6 +84,7 @@ workflow QC_BAM {
bigwig = UCSC_WIGTOBIGWIG.out.bw // channel: [ val(meta), path(bw) ]
d4 = MOSDEPTH.out.per_base_d4 // channel: [ val(meta), path(d4) ]
global_dist = MOSDEPTH.out.global_txt // channel: [ val(meta), path(txt) ]
sex_check = NGSBITS_SAMPLEGENDER.out.tsv // channel: [val(meta), path(tsv) ]
cov = ch_cov // channel: [ val(meta), path(metrics) ]
cov_y = ch_cov_y // channel: [ val(meta), path(metrics) ]
versions = ch_versions // channel: [ path(versions.yml) ]
Expand Down
3 changes: 2 additions & 1 deletion workflows/raredisease.nf
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ workflow RAREDISEASE {
ch_target_intervals,
ch_genome_chrsizes,
ch_intervals_wgs,
ch_intervals_y
ch_intervals_y,
Channel.value(params.ngsbits_samplegender_method)
)
ch_versions = ch_versions.mix(QC_BAM.out.versions)

Expand Down