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

Sex prediction #13

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
Open
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
28 changes: 28 additions & 0 deletions assets/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,31 @@ report_section_order:
export_plots: true

disable_version_detection: true

table_cond_formatting_rules:
match_certainty:
pass:
- s_eq: 100
warn:
- lt: 99
fail:
- lt: 50

table_columns_name:
sex_prediction:
match_certainty: "Certainty of sex match"
expected_sex: "Expected Sex"
calculated_sex: "Calculated Sex"
calculated_sex_yx: "Calculated sex (XY method)"
calculated_sex_sry: "Calculated sex (SRY method)"
calculated_sex_hetx: "Calculated sex (HETX method)"
ratio_yx: "# reads in chrY / # reads in chrX (XY)"
het_fraction: "Fraction of heterozygous SNPs in chrX (HETX)"
coverage_sry: "Coverage of SRY in chrY (SRY)"
xy_ratio: "X/Y ratio"

custom_plot_config:
sex_prediction:
defaultsort:
- column: "Certainty of sex match"
direction: asc
7 changes: 7 additions & 0 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
"format": "file-path",
"exists": true,
"errorMessage": "snp BAM/CRAM index file must be provided, cannot contain spaces and must have extension '.bai' or '.csi'"
},
"sex": {
"type": "string",
"enum": ["M", "F", "U"],
"default": "U",
"meta": "sex",
"errorMessage": "The value should be one of 'M' (male), 'F' (female) or 'U' (unknown)"
}
},
"uniqueEntries": ["sample"],
Expand Down
10 changes: 10 additions & 0 deletions conf/WGS.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running the pipeline on WGS data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

params {
min_xy_female = 4.5
max_xy_male = 2
}
26 changes: 25 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ process {
].join(" ").trim()}
}

withName: 'MULTIQC' {
withName: "NGSBITS_SAMPLEGENDER_XY" {
ext.prefix = { "${meta.id}.xy" }
ext.args = "-max_female ${params.max_yx_female} -min_male ${params.min_yx_male}"
}

withName: "NGSBITS_SAMPLEGENDER_SRY" {
ext.prefix = { "${meta.id}.sry" }
ext.args = "-sry_cov ${params.min_sry_cov_male}"
}

withName: "NGSBITS_SAMPLEGENDER_HETX" {
ext.prefix = { "${meta.id}.hetx" }
ext.args = "-min_female ${params.min_hetx_female} -max_male ${params.max_hetx_male}"
}

withName: 'MULTIQC_POOLS' {
ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title_$meta.id\"" : "--title \"$meta.id\"" }
publishDir = [
path: { "${params.outdir}/multiqc" },
Expand All @@ -52,4 +67,13 @@ process {
]
}

withName: 'MULTIQC_MAIN' {
ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
publishDir = [
path: { "${params.outdir}/multiqc" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

}
1 change: 1 addition & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ workflow {
file(params.haplotype_map, checkIfExists: true)
]),
params.outdir,
params.skip_steps,
params.multiqc_config,
params.multiqc_logo,
params.multiqc_methods_description
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
"installed_by": ["modules"],
"patch": "modules/nf-core/multiqc/multiqc.diff"
},
"ngsbits/samplegender": {
"branch": "master",
"git_sha": "9e13262b5632b7a1e8247de7ad62fca0e9bbc953",
"installed_by": ["modules"]
},
"picard/crosscheckfingerprints": {
"branch": "master",
"git_sha": "49f4e50534fe4b64101e62ea41d5dc43b1324358",
Expand Down
10 changes: 6 additions & 4 deletions modules/nf-core/multiqc/main.nf

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

5 changes: 5 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.

72 changes: 72 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.

47 changes: 47 additions & 0 deletions modules/nf-core/ngsbits/samplegender/tests/main.nf.test

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

35 changes: 35 additions & 0 deletions modules/nf-core/ngsbits/samplegender/tests/main.nf.test.snap

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

2 changes: 2 additions & 0 deletions modules/nf-core/ngsbits/samplegender/tests/tags.yml

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

20 changes: 15 additions & 5 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@
params {

// Input options
input = null
input = null

// References
fasta = null
fai = null
bwa_index = null
haplotype_map = null
fasta = null
fai = null
bwa_index = null
haplotype_map = null

// Pipeline options
skip_steps = ""

// Sex prediction
max_yx_female = 0.06
min_yx_male = 0.09
min_sry_cov_male = 20
min_hetx_female = 0.25
max_hetx_male = 0.05

// MultiQC options
multiqc_config = null
Expand Down
Loading
Loading