

echo "beginning fpcount"
date +"%Y/%m/%d %H:%M:%S"

mkdir ${FPCOUNT_OUT}

for id in ${SAMPLE_ID[@]}
do
       echo "(nohup fp-count -c5,5 -o ${FPCOUNT_OUT}/${id}.txt -b ${BED_SOURCE} -a ${ASITES} ${UNIQUE_READS_OUT}/${id}_unique.bam) &" >> fpcountcommands.sh
       echo "(nohup fp-count -c0,0 -o ${FPCOUNT_OUT}/${id}.mito.txt -b ${BED_SOURCE_MITO} -a ${ASITES_MITO} ${UNIQUE_READS_OUT}/${id}_unique.bam) &" >> fpcountcommands.sh
done
echo "wait" >> fpcountcommands.sh
source fpcountcommands.sh

mv fpcountcommands.sh ${SHELL_IN_OUT}

echo "exiting fpcount"
date +"%Y/%m/%d %H:%M:%S"

mv nohup.out ${SHELL_IN_OUT}/nohup.out.fpcount
