-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprobeblast.sh
53 lines (42 loc) · 1.45 KB
/
probeblast.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
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#######################################################
## probeblast.sh
## run after create_probes.py
## authors: Georgina Samaha and Mitchell O'Brien
## run as: bash probeblast.sh <reference.fasta>
## version 1
#######################################################
#PBS -P Georgie
#PBS -l select=1:ncpus=2:mem=10GB
#PBS -l walltime=01:00:00
#PBS -N blast
#PBS -m e
#PBS -M georgina.samaha@sydney.edu.au
#PBS -q defaultQ
#PBS -W umask=022
# written for USyd Artemis HPC which uses PBSpro job scheduler
# run as bash blast.sh $ref
probeseq=Output/probes.fasta
ref=$1 #../../Ref/canfam4.fasta
# run as an interactive session on Artemis
# when writing pbs profile config make sure to qsub
module load blast+/2.9.0
NCPUS=24
#blast+ to convert fasta to indexed and searchable version of the same information .nin, .nsq and .nhr
makeblastdb -in ${ref} \
-dbtype nucl \
-blastdb_version 5 \
-parse_seqids \
-out ${ref}.db
#blastn to search subject fasta with query sequence(s) and return filtered hits
blastn -query ${probeseq} \
-db ${ref}.db \
-evalue 1e-20 \
-outfmt 7 \
-num_threads ${NCPUS} \
-out ${ref}.BLASTn
#extract blast output to readable format
echo "#SNP_ID mappedTo %ID AlnLen Mis Gap qStart qEnd sStartsEnd evalue bit_score" >${ref}.BLASTn_Output
grep -v '#' ${ref}.BLASTn >> ${ref}.BLASTn_Output
mv ${ref}.BLASTn ./Output
mv ${ref}.BLASTn_Output ./Output