#!/bin/bash -Ceuo pipefail
samtools \
merge \
-c \
--threads 15 \
--write-index \
\
\
HCC1395_tumor.bam##idx##HCC1395_tumor.bai \
1/HCC1395_tumor.bam 2/HCC1395_tumor.bam 3/HCC1395_tumor.bam 4/HCC1395_tumor.bam 5/HCC1395_tumor.bam 6/HCC1395_tumor.bam 7/HCC1395_tumor.bam 8/HCC1395_tumor.bam
# Touch index to ensure timestamp is newer than aligned file
touch HCC1395_tumor.bai
cat <<-END_VERSIONS > versions.yml
"DAQ:SAMTOOLS_MERGE":
samtools: $(echo $(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*$//')
END_VERSIONS