Skip to content

Commit

Permalink
Merge pull request #170 from nf-core/fix-forward-stranded
Browse files Browse the repository at this point in the history
Fix "Access to undefined parameter `forwardStranded`" warnings
  • Loading branch information
edmundmiller authored Oct 21, 2024
2 parents f61aac0 + f458d8b commit f84692e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#137](https://github.com/nf-core/nascent/pull/137) - Use singularity containers for PINTS
- [#142](https://github.com/nf-core/nascent/pull/142) - Updated CHM13 references

### Fixed

- [#170](https://github.com/nf-core/nascent/pull/170) - Remove "Access to undefined parameter forwardStranded" warnings

## v2.2.0 - 2024-03-05

### Added
Expand Down
7 changes: 6 additions & 1 deletion modules/local/dreg_prep/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ process DREG_PREP {
input:
tuple val(meta), path(bam_file), val(index)
path sizes
val assay_type

output:
tuple val(meta), path("${prefix}.pos.bw"), path("${prefix}.neg.bw"), emit: dreg_bigwig
Expand All @@ -21,6 +22,10 @@ process DREG_PREP {

script:
prefix = task.ext.prefix ?: "${meta.id}"
// NOTE https://github.com/hyulab/PINTS/blob/700f2c44b967413a19fc6b66bd876b53b6f31002/pints/io_engine.py#L436-L446
def forwardStranded_assays = ["PROseq", "mNETseq"]
def forwardStranded = forwardStranded_assays.contains(assay_type)

if (meta.single_end) {
"""
echo "Creating BigWigs suitable as inputs to dREG"
Expand Down Expand Up @@ -74,7 +79,7 @@ process DREG_PREP {
echo "bedGraph to bigwig done"
"""
} else {
if (params.forwardStranded) {
if (forwardStranded) {
"""
samtools view -@ $task.cpus -bf 0x2 ${bam_file} | samtools sort -n -@ $task.cpus \\
> ${prefix}.dreg.bam
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/coverage_graphs.nf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ workflow COVERAGE_GRAPHS {

DREG_PREP (
bam_bai,
sizes
sizes,
params.assay_type,
)

emit:
Expand Down

0 comments on commit f84692e

Please sign in to comment.