Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Check for needed reference only #765

Merged
merged 3 commits into from
Mar 20, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [#744](https://github.com/SciLifeLab/Sarek/pull/744) - Refactor `germlineVC.nf`

### `Added`

- [#753](https://github.com/SciLifeLab/Sarek/pull/753) - Update `binac`, `cfc` configuration

### `Fixed`

- [#749](https://github.com/SciLifeLab/Sarek/pull/749) - Fix config problematic use of queue `core` for uppmax-slurm
- [#751](https://github.com/SciLifeLab/Sarek/pull/751), [#756](https://github.com/SciLifeLab/Sarek/pull/756) - Typos in `igenomes.config`
- [#757](https://github.com/SciLifeLab/Sarek/pull/757) - Typos in `binac`, `cfc` configuration
- [#758](https://github.com/SciLifeLab/Sarek/pull/758) - Typos in `ASCAT` documentation
- [#765](https://github.com/SciLifeLab/Sarek/pull/765) - Check only for references that are needed to fix [#754](https://github.com/SciLifeLab/Sarek/issues/754)

## [2.3.FIX1] - 2019-03-04

Expand Down
24 changes: 13 additions & 11 deletions germlineVC.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ if (workflow.profile == 'awsbatch') {

tools = params.tools ? params.tools.split(',').collect{it.trim().toLowerCase()} : []

referenceMap = defineReferenceMap()
toolList = defineToolList()
if (!SarekUtils.checkParameterList(tools,toolList)) exit 1, 'Unknown tool(s), see --help for more information'

referenceMap = defineReferenceMap(tools)
if (!SarekUtils.checkReferenceMap(referenceMap)) exit 1, 'Missing Reference file(s), see --help for more information'
if (!SarekUtils.checkParameterList(tools,toolList)) exit 1, 'Unknown tool(s), see --help for more information'

if (params.test && params.genome in ['GRCh37', 'GRCh38']) {
referenceMap.intervals = file("$workflow.projectDir/repeats/tiny_${params.genome}.list")
Expand Down Expand Up @@ -454,20 +454,22 @@ def checkUppmaxProject() {
return !(workflow.profile == 'slurm' && !params.project)
}

def defineReferenceMap() {
def defineReferenceMap(tools) {
if (!(params.genome in params.genomes)) exit 1, "Genome ${params.genome} not found in configuration"
return [
'dbsnp' : checkParamReturnFile("dbsnp"),
'dbsnpIndex' : checkParamReturnFile("dbsnpIndex"),
// genome reference dictionary
'genomeDict' : checkParamReturnFile("genomeDict"),
// FASTA genome reference
def referenceMap =
[
'genomeFile' : checkParamReturnFile("genomeFile"),
// genome .fai file
'genomeIndex' : checkParamReturnFile("genomeIndex"),
// intervals file for spread-and-gather processes
'intervals' : checkParamReturnFile("intervals")
]
if ('haplotypecaller' in tools) {
referenceMap.putAll(
'dbsnp' : checkParamReturnFile("dbsnp"),
'dbsnpIndex' : checkParamReturnFile("dbsnpIndex"),
'genomeDict' : checkParamReturnFile("genomeDict")
)
}
return referenceMap
}

def defineToolList() {
Expand Down
31 changes: 18 additions & 13 deletions somaticVC.nf
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ if (workflow.profile == 'awsbatch') {

tools = params.tools ? params.tools.split(',').collect{it.trim().toLowerCase()} : []

referenceMap = defineReferenceMap()
toolList = defineToolList()
if (!SarekUtils.checkParameterList(tools,toolList)) exit 1, 'Unknown tool(s), see --help for more information'

referenceMap = defineReferenceMap(tools)
if (!SarekUtils.checkReferenceMap(referenceMap)) exit 1, 'Missing Reference file(s), see --help for more information'
if (!SarekUtils.checkParameterList(tools,toolList)) exit 1, 'Unknown tool(s), see --help for more information'

if (params.test && params.genome in ['GRCh37', 'GRCh38']) {
referenceMap.intervals = file("$workflow.projectDir/repeats/tiny_${params.genome}.list")
Expand Down Expand Up @@ -748,23 +748,28 @@ def checkUppmaxProject() {
return !(workflow.profile == 'slurm' && !params.project)
}

def defineReferenceMap() {
def defineReferenceMap(tools) {
if (!(params.genome in params.genomes)) exit 1, "Genome ${params.genome} not found in configuration"
return [
// loci file for ascat
'acLoci' : checkParamReturnFile("acLoci"),
'acLociGC' : checkParamReturnFile("acLociGC"),
'dbsnp' : checkParamReturnFile("dbsnp"),
'dbsnpIndex' : checkParamReturnFile("dbsnpIndex"),
// genome reference dictionary
def referenceMap =
[
'genomeDict' : checkParamReturnFile("genomeDict"),
// FASTA genome reference
'genomeFile' : checkParamReturnFile("genomeFile"),
// genome .fai file
'genomeIndex' : checkParamReturnFile("genomeIndex"),
// intervals file for spread-and-gather processes
'intervals' : checkParamReturnFile("intervals")
]
if ('ascat' in tools) {
referenceMap.putAll(
'acLoci' : checkParamReturnFile("acLoci"),
'acLociGC' : checkParamReturnFile("acLociGC")
)
}
if ('mutect2' in tools) {
referenceMap.putAll(
'dbsnp' : checkParamReturnFile("dbsnp"),
'dbsnpIndex' : checkParamReturnFile("dbsnpIndex")
)
}
return referenceMap
}

def defineToolList() {
Expand Down