#!/bin/bash

cd /data/cellrangerdata
ID="200423_lane6"

/home/ssm-user/cellranger/cellranger-3.1.0/cellranger count \
--id=${ID} \
--transcriptome=/home/ssm-user/cellranger/refdata-cellranger-GRCh38-3.0.0 \
--libraries=/data/cellrangerdata/200423/${ID}_libraries.csv \
--feature-ref=/data/cellrangerdata/feature_ref.csv &
--localcores=16						#set this to prevent error 255
#--localmem=128 

pid=$!				

echo ${pid}			
du -h --max-depth 1		#monitor disk usage in current folder and make it human readable in Gb


while ps -p $pid >/dev/null
do
    du -h --max-depth 1
    sleep 100
done

rm -rf /data/cellrangerdata/${ID}/SC_RNA_COUNTER_CS	#remove temporary files of cellranger count

