Skip to content

Commit

Permalink
fixed sample dataset test script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ka Ming Nip committed Jul 18, 2014
1 parent 23436ca commit 08b153c
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions sample_dataset/analyze.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
#!/bin/bash

set -euo pipefail
set -eo pipefail

cd $(dirname $0)

name='test'
reads1=./reads/rnaseq_1.fq.gz
reads2=./reads/rnaseq_2.fq.gz
assemblydir=./${name}/assembly/
assemblydir=./${name}/assembly
finalassembly=${assemblydir}/${name}-final.fa

# set up the environment
TRANSABYSS_PATH=$(readlink -f ..)
export PATH=${TRANSABYSS_PATH}:${TRANSABYSS_PATH}/bin/:${PATH}
if [[ -z "$PYTHONPATH" ]]
then
# Set the Trans-ABySS code base directory as PYTHONPATH
export PYTHONPATH=${TRANSABYSS_PATH}
else
# Prepend the Trans-ABySS code base directory to PYTHONPATH
export PYTHONPATH=${TRANSABYSS_PATH}:$PYTHONPATH
fi

# assemble the test dataset
transabyss --se ${reads1} ${reads2} --outdir ${assemblydir} --name ${name} --threads 2 --island 0 -c 1

# check completeness of the assembly
if [ ! -e ${assemblydir}/${name}.FINAL.COMPLETE ] || [ $(cat ${finalassembly} | wc -l) -lt 2 ]
then
echo 'Assembly is incomplete!'
echo 'ERROR: Assembly is incomplete!'
exit 1
fi

analysesdir=./${name}/analyses/
analysesdir=./${name}/analyses
antisensefusionsfile=${analysesdir}/fusions/antisense_fusion.tsv
indelsfile=${analysesdir}/indels/events_filtered.tsv
splicefile=${analysesdir}/splicing/events_filtered.tsv
Expand All @@ -35,17 +43,17 @@ transabyss-analyze -a ${finalassembly} -1 ${reads1} -2 ${reads2} -n ${name} --ou
# check completeness of fusions stage
if [ ! -e ${analysesdir}/fusions/${name}.FUSIONS.COMPLETE ] || [ $(cat ${antisensefusionsfile} | wc -l) -lt 2 ]
then
echo 'Fusions stage is incomplete!'
exit 1
echo 'ERROR: No fusion events!'
#exit 1
else
echo "fusion: " $(grep 'antisense_fusion' ${antisensefusionsfile} |cut -f 13)
fi

# check completeness of indels stage
if [ ! -e ${analysesdir}/indels/${name}.INDELS.COMPLETE ] || [ $(cat ${indelsfile} | wc -l) -lt 2 ]
then
echo 'Indels stage is incomplete!'
exit 1
echo 'ERROR: No indel events!'
#exit 1
else
echo "insertion: " $(grep 'ins' ${indelsfile} |cut -f 3,4,5)
echo "deletion: " $(grep 'del' ${indelsfile} |cut -f 3,4,5)
Expand All @@ -54,8 +62,8 @@ fi
# check completeness of splicing stage
if [ ! -e ${analysesdir}/splicing/${name}.SPLICING.COMPLETE ] || [ $(cat ${splicefile} | wc -l) -lt 2 ]
then
echo 'Splices stage is incomplete!'
exit 1
echo 'ERROR: No splice events!'
#exit 1
else
echo "skip-exon: " $(grep 'skipped_exon' ${splicefile} |cut -f 8)
fi
Expand Down

0 comments on commit 08b153c

Please sign in to comment.