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
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
Relevant files
No response
System information
No response