#! /bin/bash
# 1 - string list of files to process
# 2 - number of reads to align from each file
# 3 - min_reads (default 10000)

# setup environment
source /cs/bd/tools/4tU_scripts/v3/set_rnadb_env
set -e

nr=${2:-1000000000};
mr=${3:-10000};

for f in $1; do
  let t=n+101;
  n=`zcat $f | head -$t | wc -l`;
  if [ "$n" -ge "$t" ]; then
    echo "$SRC/process_reads $f $nr"
  else
    echoerr "skipped "$f "(only "$n "reads)"
  fi
done
