https://github.com/arjunrajlaboratory/RajLabSeqTools
Tip revision: c5b88eb5aa3fa9f6a657d8b078405ce82f7e0e2d authored by Eric Sanford on 09 October 2019, 20:53:45 UTC
Updated STAR version, set default reference genome to hg38, added gene_names from gtf file when there is no HGNC symbol match, made it easier to change the reference genome by defining it in the setEnvironmentVariables.sh script. Modified some snakemake files to make that alternate pipeline almost runnable on the cluster in an interactive node.
Updated STAR version, set default reference genome to hg38, added gene_names from gtf file when there is no HGNC symbol match, made it easier to change the reference genome by defining it in the setEnvironmentVariables.sh script. Modified some snakemake files to make that alternate pipeline almost runnable on the cluster in an interactive node.
Tip revision: c5b88eb
prepareSamForHTSeq.sh
#!
# run from within "repo" directory
EXPERIMENT=$1
SAMPLEID=$2
ALIGNMENT_TOOL_NAME=rum
if [[ ! -z "$3" ]]; then
ALIGNMENT_TOOL_NAME="$3"
fi
commandName=prepareSamForHTSeq
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
if [ ! -d $EXPERIMENT/analyzed/$SAMPLEID/htseq ]; then
mkdir $EXPERIMENT/analyzed/$SAMPLEID/htseq
fi
readNameSortCmd="samtools sort -n \
$EXPERIMENT/analyzed/$SAMPLEID/$ALIGNMENT_TOOL_NAME/$SAMPLEID.sorted.mapped.unique.bam \
$EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted"
fixMateCmd="samtools fixmate \
$EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted.bam \
$EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted.mateFixed.bam"
toSamCmd="samtools view -h \
$EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted.mateFixed.bam \
> $EXPERIMENT/analyzed/$SAMPLEID/htseq/$SAMPLEID.nameSorted.mateFixed.sam"
echo "Starting..." >> $JOURNAL
date >> $JOURNAL
echo "$readNameSortCmd" >> $JOURNAL
eval "$readNameSortCmd"
echo "$fixMateCmd" >> $JOURNAL
eval "$fixMateCmd"
echo "$toSamCmd" >> $JOURNAL
eval "$toSamCmd"
date >> $JOURNAL
echo "Done" >> $JOURNAL
