Skip to content

Commit

Permalink
Finish draft pipeline scripts for TEannot
Browse files Browse the repository at this point in the history
  • Loading branch information
twrightsman committed Jul 11, 2017
1 parent 8bf2106 commit a1806bf
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 35 deletions.
47 changes: 24 additions & 23 deletions TEannot/TEannot_AllSteps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,29 @@ jid_step4=$(sbatch \
TEannot_Step4.sh | \
cut -d" " -f4)

#jid_step5=$(sbatch \
# --kill-on-invalid-dep=yes \
# --dependency=afterok:$jid_step4 \
# TEannot_Step5.sh | \
# cut -d" " -f4)

#jid_step6=$(sbatch \
# --kill-on-invalid-dep=yes \
# --dependency=afterok:$jid_step1 \
# TEannot_Step6.sh | \
# cut -d" " -f4)

#jid_step7=$(sbatch \
# --kill-on-invalid-dep=yes \
# --dependency=afterok:$jid_step3:$jid_step5:$jid_step6 \
# TEannot_Step7.sh | \
# cut -d" " -f4)

#jid_step8=$(sbatch \
# --kill-on-invalid-dep=yes \
# --dependency=afterok:$jid_step7 \
# TEannot_Step8.sh | \
# cut -d" " -f4)
jid_step5=$(sbatch \
--kill-on-invalid-dep=yes \
--dependency=afterok:$jid_step4 \
TEannot_Step5.sh | \
cut -d" " -f4)

jid_step6=$(sbatch \
--kill-on-invalid-dep=yes \
--dependency=afterok:$jid_step1 \
--array=0-1 \
TEannot_Step6.sh | \
cut -d" " -f4)

jid_step7=$(sbatch \
--kill-on-invalid-dep=yes \
--dependency=afterok:$jid_step3:$jid_step5:$jid_step6 \
TEannot_Step7.sh | \
cut -d" " -f4)

jid_step8=$(sbatch \
--kill-on-invalid-dep=yes \
--dependency=afterok:$jid_step7 \
TEannot_Step8.sh | \
cut -d" " -f4)

echo "Finished submitting all jobs at $(date)"
6 changes: 3 additions & 3 deletions TEannot/TEannot_Step5.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

#SBATCH --nodes=1
#SBATCH --ntasks=4
#SBATCH --ntasks=2
#SBATCH --mem-per-cpu=2G
#SBATCH --time=1-00:00:00
#SBATCH --output=TEAnnot_step5.stdout
#SBATCH --output=TEannot-step5.stdout
#SBATCH --job-name="S5_TEannot"
#SBATCH -p intel

module load repet/2.5
source config.txt

TEannot.py -P $ProjectName -C TEannot.cfg -S 5
40 changes: 36 additions & 4 deletions TEannot/TEannot_Step6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,43 @@
#SBATCH --ntasks=4
#SBATCH --mem-per-cpu=2G
#SBATCH --time=1-00:00:00
#SBATCH --output=TEAnnot_step6.stdout
#SBATCH --output=TEannot-step6-%a.stdout
#SBATCH --job-name="S6_TEannot"
#SBATCH -p intel

module load repet/2.5
source config.txt
TEannot.py -P $ProjectName -C TEannot.cfg -S 6 -b tblastx
TEannot.py -P $ProjectName -C TEannot.cfg -S 6 -b blastx

# REPET TEannot - Step 6
# Align RepBase databanks to genome

LOCAL_ALIGNERS=("blastx" "tblastx")
LOCAL_ALIGNER_ABRS=("x" "tx")
LOCAL_ALIGNER=${LOCAL_ALIGNERS[$SLURM_ARRAY_TASK_ID]}
LCL_ALN=${LOCAL_ALIGNER_ABRS[$SLURM_ARRAY_TASK_ID]}

if [ $SLURM_ARRAY_TASK_ID -eq '0' ]; then
OUT_DIR="${ProjectName}_TEdetect/bankBLRx"
elif [ $SLURM_ARRAY_TASK_ID -eq '1' ]; then
OUT_DIR="${ProjectName}_TEdetect/bankBLRtx"
else
echo "SLURM array improperly set up"
exit 1
fi

if [ ! -d "${ProjectName}_TEdetect/bankBLR${LCL_ALN}" ]; then
# if re-running step, drop MySQL tables
MYSQL_HOST=$(grep "repet_host" TEannot.cfg | cut -d" " -f2)
MYSQL_USER=$(grep "repet_user" TEannot.cfg | cut -d" " -f2)
MYSQL_PASS=$(grep "repet_pw" TEannot.cfg | cut -d" " -f2)
MYSQL_DB=$(grep "repet_db" TEannot.cfg | cut -d" " -f2)

echo "DROP TABLE IF EXISTS ${ProjectName}_chk_bankBLR${LCL_ALN}_path;" \
"DROP TABLE IF EXISTS ${ProjectName}_chr_bankBLR${LCL_ALN}_path;" \
"DROP TABLE IF EXISTS ${ProjectName}_bankBLR${LCL_ALN}_nt_seq;" \
"DROP TABLE IF EXISTS ${ProjectName}_bankBLR${LCL_ALN}_prot_seq;" | \
mysql -h $MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS $MYSQL_DB

TEannot.py -P $ProjectName -C TEannot.cfg -S 6 -b $LOCAL_ALIGNER
else
echo "Step 6 output folder detected, skipping..."
fi
4 changes: 2 additions & 2 deletions TEannot/TEannot_Step7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=2G
#SBATCH --time=1-00:00:00
#SBATCH --output=TEAnnot_step7.stdout
#SBATCH --output=TEannot-step7.stdout
#SBATCH --job-name="S7_TEannot"
#SBATCH -p intel

module load repet/2.5
source config.txt

TEannot.py -P $ProjectName -C TEannot.cfg -S 7
9 changes: 6 additions & 3 deletions TEannot/TEannot_Step8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=2G
#SBATCH --time=1-00:00:00
#SBATCH --output=TEAnnot_step8.stdout
#SBATCH --output=TEannot-step8.stdout
#SBATCH --job-name="S8_TEannot"
#SBATCH -p intel

module load repet/2.5
source config.txt
TEannot.py -P $ProjectName -C TEannot.cfg -S 8 -o GFF3

if [ ! -d "${ProjectName}_GFF3" ]; then
TEannot.py -P $ProjectName -C TEannot.cfg -S 8 -o GFF3
fi

0 comments on commit a1806bf

Please sign in to comment.