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