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

Add fct getGenomeAttribute to main.nf #81

Merged
merged 3 commits into from
Mar 13, 2024
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
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
Loading