Skip to content

Commit

Permalink
Merge pull request #81 from asp8200/fix_getGenomeAttribute
Browse files Browse the repository at this point in the history
Add fct getGenomeAttribute to main.nf
  • Loading branch information
maxulysse authored Mar 13, 2024
2 parents cc7ad45 + 5608a1e commit b6bcae3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Added`

- [#73](https://github.com/nf-core/bamtofastq/pull/73) Sync TEMPLATE with tools 2.12
- [#75](https://github.com/nf-core/bamtofastq/pull/75), [#78](https://github.com/nf-core/bamtofastq/pull/78) Sync TEMPLATE with tools 2.13
- [#80](https://github.com/nf-core/bamtofastq/pull/80) Sync TEMPLATE with tools 2.13.1

### `Changed`

- [#74](https://github.com/nf-core/bamtofastq/pull/74) Update to samtools to v1.19.2.
- [#76](https://github.com/nf-core/bamtofastq/pull/76) Update modules cat/fastq and samtools/view.
- [#74](https://github.com/nf-core/bamtofastq/pull/74) Update to samtools to v1.19.2
- [#76](https://github.com/nf-core/bamtofastq/pull/76) Update modules cat/fastq and samtools/view

### `Fixed`

- [#77](https://github.com/nf-core/bamtofastq/pull/77) Fix detection of paired-end or single-end for input with less than 1000 reads.
- [#77](https://github.com/nf-core/bamtofastq/pull/77) Fix detection of paired-end or single-end for input with less than 1000 reads
- [#81](https://github.com/nf-core/bamtofastq/pull/81) Add function `getGenomeAttribute` to `main.nf` and remove it from `subworkflows/local/utils_nfcore_bamtofastq_pipeline/main.nf`

### `Dependencies`

Expand Down
21 changes: 19 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ include { BAMTOFASTQ } from './workflows/bamtofastq'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_bamtofastq_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_bamtofastq_pipeline'

include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_bamtofastq_pipeline'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
Expand Down Expand Up @@ -106,6 +104,25 @@ workflow {
)
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FUNCTIONS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

//
// Get attribute from genome config file e.g. fasta
//

def getGenomeAttribute(attribute) {
if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) {
if (params.genomes[ params.genome ].containsKey(attribute)) {
return params.genomes[ params.genome ][ attribute ]
}
}
return null
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE END
Expand Down
12 changes: 0 additions & 12 deletions subworkflows/local/utils_nfcore_bamtofastq_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,6 @@ def validateInputParameters() {
genomeExistsError()
}

//
// Get attribute from genome config file e.g. fasta
//
def getGenomeAttribute(attribute) {
if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) {
if (params.genomes[ params.genome ].containsKey(attribute)) {
return params.genomes[ params.genome ][ attribute ]
}
}
return null
}

//
// Exit pipeline if incorrect --genome key provided
//
Expand Down

0 comments on commit b6bcae3

Please sign in to comment.