#!/usr/bin/env bash

set -euxo pipefail

RESOLUTIONS=(100000 250000 500000 1000000 2500000 5000000 10000000) #1000 2000 5000 10000 25000 50000 
SAMPLES=$(cat samples.txt)
OUTPUT_DIR='results/coverage'

which cooltools || echo cooltools not installed
mkdir -p $OUTPUT_DIR

for binsize in ${RESOLUTIONS[@]}; do
	for path in $SAMPLES; do
		cooler_basename=$(basename "$path")
		cooltools coverage -p 32 --ignore-diags 2 "$path::resolutions/$binsize" > "$OUTPUT_DIR/${cooler_basename%%.*}.$binsize.cov.tsv"
	done
done
