Skip to content

NFCORE_CUTANDRUN:CUTANDRUN:FILTER_READS:SAMTOOLS_VIEW #295

@kartikeyasingh1

Description

@kartikeyasingh1

Description of the bug

NFCORE_CUTANDRUN:CUTANDRUN:FILTER_READS:SAMTOOLS_VIEW meant to remove specific regions but code in modules/local/for_patch/samtools/view/main.nf (line 28)

def blacklist = regions ? "-L $regions" : ""

extracts blacklist region instead of removing, as samtools view option -L used (https://www.htslib.org/doc/samtools-view.html). This led to the code extracting only blacklisted region. Change of option to -U makes it work.

Command used and terminal output

cat .command.sh

#!/bin/bash -euo pipefail
samtools \
    view \
    --threads 5 \
     \
    -L blacklist.bed \
    -b -q 20 -F 0x004 -F 0x0008 -f 0x001 \
    foxp3_native_R1.target.sorted.bam \
     \
    > foxp3_native_R1.target.filtered.bam

cat <<-END_VERSIONS > versions.yml
"NFCORE_CUTANDRUN:CUTANDRUN:FILTER_READS:SAMTOOLS_VIEW":
    samtools: $(echo $(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*$//')
END_VERSIONS

Relevant files

No response

System information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions