-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate_databanks.bash
executable file
·67 lines (45 loc) · 1.61 KB
/
update_databanks.bash
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
PYTHON=/usr/local/bin/python
MAKEBLASTDB=/usr/bin/makeblastdb
RSYNC=/usr/bin/rsync
DATA_DIR=/data
FASTA_DIR=$DATA_DIR/fasta
BLAST_DIR=$DATA_DIR/blast
MODEL_DIR=$DATA_DIR/models
mkdir -p $FASTA_DIR $BLAST_DIR
MODELS_FASTA=$FASTA_DIR/models.fa
MODELS_DB=$BLAST_DIR/models
build_models () {
$PYTHON make_models_fasta.py $MODELS_FASTA
$MAKEBLASTDB -in $MODELS_FASTA -dbtype prot -out $MODELS_DB
}
TEMPLATES_FASTA=$FASTA_DIR/templates.fa
TEMPLATES_DB=$BLAST_DIR/templates
build_templates () {
$PYTHON make_templates_fasta.py $TEMPLATES_FASTA
$MAKEBLASTDB -in $TEMPLATES_FASTA -dbtype prot -out $TEMPLATES_DB
}
SPROT_FASTA=$FASTA_DIR/uniprot_sprot.fasta
SPROT_DB=$BLAST_DIR/uniprot_sprot
build_sprot () {
$RSYNC rsync.ebi.ac.uk::pub/databases/uniprot/knowledgebase/uniprot_sprot.fasta.gz $SPROT_FASTA.gz
gunzip -f $SPROT_FASTA.gz
# To prevent warnings, remove all titles from the fasta.
sed -i 's/^>\([^ ]\+\) .*$/>\1/' $SPROT_FASTA
$MAKEBLASTDB -in $SPROT_FASTA -dbtype prot -out $SPROT_DB
}
TREMBL_FASTA=$FASTA_DIR/uniprot_trembl.fasta
TREMBL_DB=$BLAST_DIR/uniprot_trembl
build_trembl () {
$RSYNC rsync.ebi.ac.uk::pub/databases/uniprot/knowledgebase/uniprot_trembl.fasta.gz $TREMBL_FASTA.gz
gunzip -f $TREMBL_FASTA.gz
# To prevent warnings, remove all titles from the fasta.
sed -i 's/^>\([^ ]\+\) .*$/>\1/' $TREMBL_FASTA
$MAKEBLASTDB -in $TREMBL_FASTA -dbtype prot -out $TREMBL_DB
}
build_models &
build_templates &
build_trembl &
build_sprot &
wait
/bin/echo -e "TITLE uniprot\nDBLIST $BLAST_DIR/uniprot_sprot $BLAST_DIR/uniprot_trembl" > $BLAST_DIR/uniprot.pal