Skip to content

Commit

Permalink
Merge pull request #20 from UMCUGenetics/develop
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
rernst authored Sep 9, 2020
2 parents c4f6d9a + df79413 commit 607e121
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 10 deletions.
12 changes: 11 additions & 1 deletion WES.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ params {
exoncov_bed = 'Tracks/ENSEMBL_UCSC_merged_collapsed_sorted_v3_20bpflank.bed'

exomedepth_path= '/hpc/diaggen/software/production/Dx_resources/ExomeDepth/'
exomedepth_refset = 'Aug2020v2'

picard_bait = 'Tracks/SureSelect_CREv2_elidS30409818_Covered.list'
picard_target = 'Tracks/ENSEMBL_UCSC_merged_collapsed_sorted_v3_20bpflank.list'
Expand Down Expand Up @@ -164,6 +163,17 @@ process {
]
}

withLabel: ExomeDepthSummary {
cpus = 2
memory = '5G'
time = '20m'

publishDir {
path = "$params.outdir/QC/CNV"
mode = 'copy'
}
}

withLabel: Kinship {
cpus = 2
memory = '8G'
Expand Down
46 changes: 37 additions & 9 deletions WES.nf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ workflow {
ExonCov(Sambamba_Merge.out.map{sample_id, bam_file, bai_file -> [analysis_id, sample_id, bam_file, bai_file]})

// ExomeDepth
ExomeDepth(Sambamba_Merge.out.map{sample_id, bam_file, bai_file -> [analysis_id, sample_id, bam_file, bai_file, params.exomedepth_refset]})
ExomeDepth(Sambamba_Merge.out.map{sample_id, bam_file, bai_file -> [analysis_id, sample_id, bam_file, bai_file]})
ExomeDepthSummary(analysis_id, ExomeDepth.out.HC_stats_log.collect())

// Kinship
Kinship(GATK_CombineVariants.out)
Expand All @@ -93,11 +94,11 @@ workflow {
GetStatsFromFlagstat(Sambamba_Flagstat.out.collect())

MultiQC(analysis_id, Channel.empty().mix(
FastQC.out.collect(),
PICARD_CollectMultipleMetrics.out.collect(),
PICARD_EstimateLibraryComplexity.out.collect(),
PICARD_CollectHsMetrics.out.collect()
))
FastQC.out,
PICARD_CollectMultipleMetrics.out,
PICARD_EstimateLibraryComplexity.out,
PICARD_CollectHsMetrics.out
).collect())

TrendAnalysisTool(
GATK_CombineVariants.out.map{id, vcf_file, idx_file -> [id, vcf_file]}
Expand Down Expand Up @@ -158,15 +159,42 @@ process ExomeDepth {
shell = ['/bin/bash', '-eo', 'pipefail']

input:
tuple(analysis_id, sample_id, path(bam_file), path(bai_file), refset)
tuple(analysis_id, sample_id, path(bam_file), path(bai_file))

output:
path("*.xml", emit: ED_xml)
path("*.log", emit: ED_log)
path("HC_*.igv", emit: HC_igv)
path("UMCU_*.igv", emit: UMCU_igv)
path("HC_*.vcf", emit: HC_vcf)
path("UMCU_*.vcf", emit: UMCU_vcf)
path('HC_*_stats.log', emit: HC_stats_log)
path('UMCU_*_stats.log', emit: UMCU_stats_log)

script:
"""
source ${params.exomedepth_path}/venv/bin/activate
python ${params.exomedepth_path}/run_ExomeDepth.py callcnv ./ ${bam_file} ${analysis_id} ${sample_id}
"""
}

process ExomeDepthSummary {
// Custom process to stats from ExomeDepth analysis
tag {"ExomeDepthSummary"}
label 'ExomeDepthSummary'
shell = ['/bin/bash', '-eo', 'pipefail']

input:
val(analysis_id)
path(exomedepth_logs)

output:
tuple(sample_id, refset, path("UMCU_${refset}_${sample_id}*.vcf"), path("HC_${refset}_${sample_id}*.vcf"), path("${sample_id}*.xml"), path("UMCU_${refset}_${sample_id}*.log"), path("HC_${refset}_${sample_id}*.log"), path("UMCU_${refset}_${sample_id}*.igv"), path("HC_${refset}_${sample_id}*.igv"))
path("${analysis_id}_exomedepth_summary.txt")

script:
"""
source ${params.exomedepth_path}/venv/bin/activate
python ${params.exomedepth_path}/run_ExomeDepth.py callcnv ./ ${bam_file} ${analysis_id} ${sample_id} ${refset}
python ${params.exomedepth_path}/exomedepth_summary.py ${exomedepth_logs} > ${analysis_id}_exomedepth_summary.txt
"""
}

Expand Down

0 comments on commit 607e121

Please sign in to comment.