#!/bin/bash -Ceuo pipefail set -euo pipefail export JAVA_TOOL_OPTIONS='-Xmx8g -XX:+UseParallelGC' PicardCommandLine MarkDuplicates \ I='three.sorted.bam' \ O='three.markdup.bam' \ M='three.markdup_metrics.txt' \ TMP_DIR="$PWD" \ VALIDATION_STRINGENCY=SILENT \ MAX_RECORDS_IN_RAM=250000 \ REMOVE_DUPLICATES=false \ CREATE_INDEX=true \ TAG_DUPLICATE_SET_MEMBERS=true \ TAGGING_POLICY=All \ OPTICAL_DUPLICATE_PIXEL_DISTANCE=2500 # Picard/htsjdk may write .markdup.bai; we standardize on .markdup.bam.bai for Nextflow outputs if [[ -f 'three.markdup.bam.bai' ]]; then : elif [[ -f 'three.markdup.bai' ]]; then ln -sf 'three.markdup.bai' 'three.markdup.bam.bai' else echo "MarkDuplicates did not create 'three.markdup.bam.bai' or 'three.markdup.bai'" >&2 exit 1 fi