https://github.com/arjunrajlaboratory/RajLabSeqTools
Raw File
Tip revision: c8b8c79b2ec9c1bd9eb7ced427bb2aec25f19506 authored by Benjamin Emert on 26 March 2020, 17:37:11 UTC
Updated reorganizeBasespaceFiles.py to better parse samples with same first index (e.g. sample 1 and sample10)
Tip revision: c8b8c79
teardownSamForHTSeq.sh
#!
# run from within "repo" directory

EXPERIMENT=$1
SAMPLEID=$2

commandName=teardownSamForHTSeq

if [ ! -d $EXPERIMENT/analyzed/$SAMPLEID/log ]; then
    mkdir $EXPERIMENT/analyzed/$SAMPLEID/log
fi
JOURNAL=$EXPERIMENT/analyzed/$SAMPLEID/log/$(date +%Y-%m-%d_%H-%M).$commandName.log

nameSortedBamFile="$EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted.bam"
mateFixedBamFile="$EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted.mateFixed.bam"
mateFixedSamFile="$EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted.mateFixed.sam"

filesToLookFor=($nameSortedBamFile $mateFixedBamFile $mateFixedSamFile)

echo "Starting..." >> $JOURNAL
date >> $JOURNAL

for fileName in "${filesToLookFor[@]}" ; do
	if [ -e $fileName ]; then
		cmdToRun="unlink $fileName"
		echo "$cmdToRun" >> $JOURNAL
		eval "$cmdToRun"
	fi
done

date >> $JOURNAL
echo "Done" >> $JOURNAL
back to top