-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubmit_blast_n_process.sh
executable file
·43 lines (38 loc) · 1.22 KB
/
submit_blast_n_process.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
#SBATCH --mem=32G
#SBATCH --cpus-per-task=8
#SBATCH -t 08:00:00
#SBATCH -A def-mcristes
#SBATCH --job-name=467_2S
module purge
module load fastqc
module load nixpkgs/16.09
module load gcc/5.4.0
module load trimmomatic
module load fastx-toolkit/0.0.14
module load nixpkgs/16.09 gcc/5.4.0 blast+
module load scipy-stack/2018b
## This is the basic submission for blast and postprocess it.
cd $SLURM_SUBMIT_DIR
if [ -z ${cpus} ]; then cpus=8; fi
#have a nice day! :)
# The job command(s):
out=`echo ${file_path} | rev | cut -d'.' -f 1 | rev`
path="${file_path}/${out}"
do_blast=TRUE
#chek if blast has been done before
if [[ -f "${path}.hits" ]]; then
if [[ `grep "#END" ${path}.hits` != '' ]]; then
do_blast=TRUE
rm ${path}.hits; else
do_blast=FALSE
fi
fi
if [[ ${do_blast} == TRUE ]]; then
blastn -db ${db_path} -query ${file_path}/*.trimmed.derep.fasta \
-evalue 0.0001 -perc_identity 97 -max_target_seqs 40 \
-outfmt "6 qseqid sseqid pident evalue qcovs qlen length staxid stitle" \
-num_threads ${cpus} > ${path}.hits && echo -e "\n#END" >> ${path}.hits
fi
python blast_processing.py ${path}.hits ${path}_98_98 -p 98 -q 98
python blast_processing.py ${path}.hits ${path}_98_90 -p 98 -q 90