Skip to content
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
18 changes: 0 additions & 18 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@

process {

publishDir = [
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]

// BWA MEM
withName: "BWA_MEM" {
ext.args = {[
Expand All @@ -33,7 +27,6 @@ process {

// Picard CrosscheckFingerprints
withName: "PICARD_CROSSCHECKFINGERPRINTS" {
publishDir = [ enabled:false ]
ext.args = {[
"--CROSSCHECK_BY SAMPLE",
"--CROSSCHECK_MODE CHECK_ALL_OTHERS",
Expand All @@ -47,7 +40,6 @@ process {
}

withName: "NGSBITS_SAMPLEGENDER" {
publishDir = [ enabled:false ]
ext.prefix = { "${meta.id}.xy" }
ext.args = "-max_female ${params.max_yx_female} -min_male ${params.min_yx_male}"
ext.args2 = "-min_female ${params.min_hetx_female} -max_male ${params.max_hetx_male}"
Expand All @@ -56,20 +48,10 @@ process {

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

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 }
]
}

}
60 changes: 18 additions & 42 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,6 @@ include { SAMPLETRACKING } from './workflows/sampletracking'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_sampletracking_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_sampletracking_pipeline'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NAMED WORKFLOWS FOR PIPELINE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
//
// WORKFLOW: Run main analysis pipeline depending on type of input
//
workflow NFCMGG_SAMPLETRACKING {

take:
samplesheet // channel: samplesheet read in from --input
bwa_index // channel: bwa index file
genome_fasta // channel: genome fasta file
haplotype_map // channel: haplotype map file
outdir // channel: output directory

main:

//
// WORKFLOW: Run pipeline
//
SAMPLETRACKING (
samplesheet,
bwa_index,
genome_fasta,
haplotype_map,
outdir
)
emit:
multiqc_report = SAMPLETRACKING.out.multiqc_report // channel: /path/to/multiqc_report.html
}
/*


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN MAIN WORKFLOW
Expand All @@ -67,7 +32,6 @@ workflow {
PIPELINE_INITIALISATION (
params.version,
params.validate_params,
params.monochrome_logs,
args,
params.outdir,
params.input,
Expand All @@ -79,22 +43,25 @@ workflow {
//
// WORKFLOW: Run main workflow
//
NFCMGG_SAMPLETRACKING (
SAMPLETRACKING (
PIPELINE_INITIALISATION.out.samplesheet,
Channel.value([
channel.value([
[id: "bwa"],
file(params.bwa_index, checkIfExists: true)
]),
Channel.value(
channel.value(
[[id:"genome_fasta"],
file(params.fasta, checkIfExists: true),
file(params.fai, checkIfExists: true),
]),
Channel.value(
channel.value(
[[id:"haplotype_map"],
file(params.haplotype_map, checkIfExists: true)
]),
params.outdir
params.outdir,
params.multiqc_config,
params.multiqc_logo,
params.multiqc_methods_description
)
//
// SUBWORKFLOW: Run completion tasks
Expand All @@ -106,8 +73,17 @@ workflow {
params.outdir,
params.monochrome_logs,
params.hook_url,
NFCMGG_SAMPLETRACKING.out.multiqc_report
SAMPLETRACKING.out.multiqc_report
)

publish:
multiqc_report = SAMPLETRACKING.out.multiqc_report
multiqc_pools = SAMPLETRACKING.out.multiqc_pools
}

output {
multiqc_report { path "multiqc/" }
multiqc_pools { path "multiqc/" }
}

/*
Expand Down
4 changes: 2 additions & 2 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"picard/crosscheckfingerprints": {
"branch": "master",
"git_sha": "df124e87c74d8b40285199f8cc20151f5aa57255",
"git_sha": "4e8415483e3119fc3035ece12ec9236dac261357",
"installed_by": ["modules"],
"patch": "modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff"
},
Expand All @@ -49,7 +49,7 @@
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "05954dab2ff481bcb999f24455da29a5828af08d",
"git_sha": "271e7fc14eb1320364416d996fb077421f3faed2",
"installed_by": ["subworkflows"]
},
"utils_nfschema_plugin": {
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/picard/crosscheckfingerprints/main.nf

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

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

3 changes: 3 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,6 @@ validation {
defaultIgnoreParams = []
monochromeLogs = params.monochrome_logs
}

workflow.output.mode = params.publish_dir_mode
outputDir = params.outdir
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ workflow PIPELINE_INITIALISATION {
take:
version // boolean: Display version and exit
validate_params // boolean: Boolean whether to validate parameters against the schema at runtime
monochrome_logs // boolean: Do not use coloured log outputs
nextflow_cli_args // array: List of positional nextflow CLI args
outdir // string: The output directory where the results will be saved
input // string: Path to input samplesheet
Expand All @@ -39,7 +38,7 @@ workflow PIPELINE_INITIALISATION {

main:

ch_versions = Channel.empty()
ch_versions = channel.empty()

//
// Print version and exit if required and dump pipeline parameters to JSON file
Expand Down Expand Up @@ -89,7 +88,7 @@ workflow PIPELINE_INITIALISATION {
return counts
})

Channel
channel
.fromList(input_list)
.map {
meta, sample_bam, sample_bam_index, snp_fastq_1, snp_fastq_2, snp_bam, snp_bam_index ->
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/nf-core/utils_nfcore_pipeline/main.nf

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

24 changes: 12 additions & 12 deletions workflows/sampletracking.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ workflow SAMPLETRACKING {

main:

def ch_versions = Channel.empty()
def ch_multiqc_files = Channel.empty()
def ch_pool_multiqc_files = Channel.empty()
def ch_versions = channel.empty()
def ch_multiqc_files = channel.empty()
def ch_pool_multiqc_files = channel.empty()


def (ch_sample, ch_snp, ch_rest) = ch_samplesheet
Expand Down Expand Up @@ -109,7 +109,7 @@ workflow SAMPLETRACKING {
// Crosscheck fingerprints
//

def ch_crosscheck_metrics_out = Channel.empty()
def ch_crosscheck_metrics_out = channel.empty()
ch_samplesheet_fixed
.filter { meta, _sample_bam, _sample_bam_index, snp_fastq, snp_bam, _snp_bam_index ->
if(!snp_bam && !snp_fastq) {
Expand Down Expand Up @@ -169,7 +169,7 @@ workflow SAMPLETRACKING {
//
// Determine sample sex
//
def ch_sex_prediction_out = Channel.empty()
def ch_sex_prediction_out = channel.empty()
ch_samplesheet_fixed
.map { meta, sample_bam, sample_bam_index, _snp_fastq, _snp_bam, _snp_bam_index ->
[ meta, sample_bam, sample_bam_index ]
Expand Down Expand Up @@ -267,24 +267,24 @@ workflow SAMPLETRACKING {
//
// MODULE: MultiQC
//
ch_multiqc_config = Channel.fromPath(
ch_multiqc_config = channel.fromPath(
"$projectDir/assets/multiqc_config.yml", checkIfExists: true)
ch_multiqc_custom_config = multiqc_config ?
Channel.fromPath(multiqc_config, checkIfExists: true) :
Channel.empty()
channel.fromPath(multiqc_config, checkIfExists: true) :
channel.empty()
ch_multiqc_logo = multiqc_logo ?
Channel.fromPath(multiqc_logo, checkIfExists: true) :
Channel.empty()
channel.fromPath(multiqc_logo, checkIfExists: true) :
channel.empty()

summary_params = paramsSummaryMap(
workflow, parameters_schema: "nextflow_schema.json")
ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params))
ch_workflow_summary = channel.value(paramsSummaryMultiqc(summary_params))
ch_multiqc_files = ch_multiqc_files.mix(
ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'))
ch_multiqc_custom_methods_description = multiqc_methods_description ?
file(multiqc_methods_description, checkIfExists: true) :
file("$projectDir/assets/methods_description_template.yml", checkIfExists: true)
ch_methods_description = Channel.value(
ch_methods_description = channel.value(
methodsDescriptionText(ch_multiqc_custom_methods_description))

ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions)
Expand Down