Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 52 lines (38 sloc) 1.03 KB
#!/bin/bash
# module init required when running on non-OSG resources, and has to sourced
# before set -e as sometimes it exits non-0 when a module environment is
# already set up
. /cvmfs/oasis.opensciencegrid.org/osg/sw/module-init.sh
set -e
module load java/8u25
module load stringtie/1.2.2
set -v
BASE_NAME=$1
GFF3=$2
# remove "empty" inputs
for F in `ls *bam`; do
SIZE=`du -sb $F | cut -f 1`
if [ $SIZE -lt 50 ]; then
echo "Removing $F due to it being empty"
rm $F
fi
done
echo
echo
ls -l
echo
echo
# no input files left
COUNT=`ls *.bam 2>/dev/null | wc -l`
if [ $COUNT = 0 ]; then
echo "No bam files left - creating an empty fpkm"
touch $BASE_NAME-merged_counts.fpkm
exit 0
fi
stringtie *.bam -G $GFF3 -e -B > /dev/null
python ST_ttab_parse.py t_data.ctab > $BASE_NAME-merged_counts.fpkm
mv t_data.ctab $BASE_NAME-t_data.ctab
mv e_data.ctab $BASE_NAME-e_data.ctab
mv i_data.ctab $BASE_NAME-i_data.ctab
mv i2t.ctab $BASE_NAME-i2t.ctab
mv e2t.ctab $BASE_NAME-e2t.ctab