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

Fix ch_dbsnp channel #39

Merged
merged 11 commits into from
Sep 27, 2019
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 @@ -125,6 +125,7 @@ Initial release of `nf-core/sarek`, created with the [nf-core](http://nf-co.re/)
- [#31](https://github.com/nf-core/sarek/pull/31) - Fix rcolorbrewer version according to nf-core lint
- [#33](https://github.com/nf-core/sarek/pull/33) - Fix MD Linting
- [#38](https://github.com/nf-core/sarek/pull/38) - Avoid collision in MultiQC
- [#39](https://github.com/nf-core/sarek/pull/39) - Fix `ch_dbsnp` channel

### `Deprecated`

Expand Down
1 change: 0 additions & 1 deletion conf/genomes.config
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ params {
'smallGRCh37' {
acLoci = "${params.genomes_base}/1000G_phase3_20130502_SNP_maf0.3.small.loci"
acLociGC = "${params.genomes_base}/1000G_phase3_20130502_SNP_maf0.3.small.loci.gc"
bwaIndex = "${params.genomes_base}/human_g1k_v37_decoy.small.fasta.{amb,ann,bwt,pac,sa}"
dbsnp = "${params.genomes_base}/dbsnp_138.b37.small.vcf.gz"
fasta = "${params.genomes_base}/human_g1k_v37_decoy.small.fasta"
germlineResource = "${params.genomes_base}/dbsnp_138.b37.small.vcf.gz"
Expand Down
41 changes: 25 additions & 16 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ params.fasta = params.genome && !('annotate' in step) ? params.genomes[params.ge
// The rest can be sorted
params.acLoci = params.genome && 'ascat' in tools ? params.genomes[params.genome].acLoci ?: null : null
params.acLociGC = params.genome && 'ascat' in tools ? params.genomes[params.genome].acLociGC ?: null : null
params.bwaIndex = params.genome && params.fasta && 'mapping' in step ? params.genomes[params.genome].bwa ?: null : null
params.bwaIndex = params.genome && params.fasta && 'mapping' in step ? params.genomes[params.genome].bwaIndex ?: null : null
params.chrDir = params.genome && 'controlfreec' in tools ? params.genomes[params.genome].chrDir ?: null : null
params.chrLength = params.genome && 'controlfreec' in tools ? params.genomes[params.genome].chrLength ?: null : null
params.dbsnp = params.genome && ('mapping' in step || 'controlfreec' in tools || 'haplotypecaller' in tools || 'mutect2' in tools) ? params.genomes[params.genome].dbsnp ?: null : null
Expand Down Expand Up @@ -238,10 +238,10 @@ ch_fastaFai = params.fastaFai && !('annotate' in step) ? Channel.value(file(para
ch_germlineResource = params.germlineResource && 'mutect2' in tools ? Channel.value(file(params.germlineResource)) : "null"
ch_intervals = params.intervals && !('annotate' in step) ? Channel.value(file(params.intervals)) : "null"

// knownIndels is currently a list of file, so transform it in a channel
// knownIndels is currently a list of file for smallGRCh37, so transform it in a channel
li_knownIndels = []
if (params.knownIndels && ('mapping' in step)) params.knownIndels.each { li_knownIndels.add(file(it)) }
ch_knownIndels = params.knownIndels ? Channel.value(li_knownIndels.collect()) : "null"
ch_knownIndels = params.knownIndels && params.genome == 'smallGRCh37' ? Channel.value(li_knownIndels.collect()) : params.knownIndels ? Channel.value(file(params.knownIndels)) : "null"

ch_snpEff_cache = params.snpEff_cache ? Channel.value(file(params.snpEff_cache)) : "null"
ch_snpeffDb = params.snpeffDb ? Channel.value(params.snpeffDb) : "null"
Expand Down Expand Up @@ -287,18 +287,25 @@ summary['Launch dir'] = workflow.launchDir
summary['Working dir'] = workflow.workDir
summary['Script dir'] = workflow.projectDir
summary['User'] = workflow.userName

if (params.acLoci) summary['acLoci'] = params.acLoci
if (params.acLociGC) summary['acLociGC'] = params.acLociGC
if (params.chrDir) summary['chrDir'] = params.chrDir
if (params.chrLength) summary['chrLength'] = params.chrLength
if (params.dbsnp) summary['dbsnp'] = params.dbsnp
if (params.fasta) summary['fasta'] = params.fasta
if (params.germlineResource) summary['germlineResource'] = params.germlineResource
if (params.intervals) summary['intervals'] = params.intervals
if (params.knownIndels) summary['knownIndels'] = params.knownIndels.join(', ')
if (params.snpeffDb) summary['snpeffDb'] = params.snpeffDb
if (params.vepCacheVersion) summary['vepCacheVersion'] = params.vepCacheVersion
summary['genome'] = params.genome

if (params.fasta) summary['fasta'] = params.fasta
if (params.fastaFai) summary['fastaFai'] = params.fastaFai
if (params.dict) summary['dict'] = params.dict
if (params.bwaIndex) summary['bwaIndex'] = params.bwaIndex
if (params.germlineResource) summary['germlineResource'] = params.germlineResource
if (params.germlineResourceIndex) summary['germlineResourceIndex'] = params.germlineResourceIndex
if (params.intervals) summary['intervals'] = params.intervals
if (params.acLoci) summary['acLoci'] = params.acLoci
if (params.acLociGC) summary['acLociGC'] = params.acLociGC
if (params.chrDir) summary['chrDir'] = params.chrDir
if (params.chrLength) summary['chrLength'] = params.chrLength
if (params.dbsnp) summary['dbsnp'] = params.dbsnp
if (params.dbsnpIndex) summary['dbsnpIndex'] = params.dbsnpIndex
if (params.knownIndels) summary['knownIndels'] = params.knownIndels
if (params.knownIndelsIndex) summary['knownIndelsIndex'] = params.knownIndelsIndex
if (params.snpeffDb) summary['snpeffDb'] = params.snpeffDb
if (params.vepCacheVersion) summary['vepCacheVersion'] = params.vepCacheVersion

if (workflow.profile == 'awsbatch') {
summary['AWS Region'] = params.awsregion
Expand Down Expand Up @@ -758,6 +765,8 @@ markDuplicatesReport = markDuplicatesReport.dump(tag:'MD Report')
(bamMD, bamMDToJoin) = duplicateMarkedBams.into(2)
bamBaseRecalibrator = bamMD.combine(intBaseRecalibrator)

bamBaseRecalibrator = bamBaseRecalibrator.dump(tag:'BAM FOR BASERECALIBRATOR')

// STEP 3: CREATING RECALIBRATION TABLES

process BaseRecalibrator {
Expand All @@ -770,8 +779,8 @@ process BaseRecalibrator {
set idPatient, idSample, file(bam), file(bai), file(intervalBed) from bamBaseRecalibrator
file(dbsnp) from ch_dbsnp
file(dbsnpIndex) from ch_dbsnpIndex
file(dict) from ch_dict
file(fasta) from ch_fasta
file(dict) from ch_dict
file(fastaFai) from ch_fastaFai
file(knownIndels) from ch_knownIndels
file(knownIndelsIndex) from ch_knownIndelsIndex
Expand Down