-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure_blasr_install.sh
62 lines (43 loc) · 1.99 KB
/
configure_blasr_install.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
54
55
56
57
58
59
60
61
62
#! /usr/bin/env bash
## unfortunately, the blasr/sparc consensus doesn't often run properly out-of-the-box ##
## this script will configure the blasr/sparc components to install correctly into your $PATH ##
cat <<EOF
This script will download the split_and_run script from Sparc, configure script to work correctly, and move it to the global PATH at /bin/
The easiest way to have all the other parts work is to create a conda environment configured for python2 and install blasr and Sparc into that.
[example]
conda create -n consensus
conda activate consensus
conda install -c bioconda python=2.7 blasr sparc
EOF
# function from user Chronial on StackExchange
# (https://stackoverflow.com/users/758345/chronial)
function git_sparse_clone() (
rurl="$1" localdir="$2" && shift 2
mkdir -p "$localdir"
cd "$localdir"
git init
git remote add -f origin "$rurl"
git config core.sparseCheckout true
# Loops over remaining args
for i; do
echo "$i" >> .git/info/sparse-checkout
done
git pull origin master
)
echo "fetching utility scripts from DBG2OLC github..."
git_sparse_clone "http://github.com/yechengxi/DBG2OLC" "./DBG_consensus" "/utility" &> out.log
rm out.log
cd DBG_consensus/utility
echo "removing unneeded scripts and tweaking split_and_run_sparc.sh"
# remove stuff I won't be using. can be changed if you need other stuff
rm split_and_run_sparc.sh split_and_run_sparc.path.sh *batches.sh *pbdagcon* *.txt
sed -i -e 's/-nproc/--nproc/g' split_and_run_sparc.2.sh
sed -i -e 's/-bestn/--bestn/g' split_and_run_sparc.2.sh
sed -i -e 's/-minMatch/--minMatch/g' split_and_run_sparc.2.sh
sed -i -e 's/-out/--out/g' split_and_run_sparc.2.sh
sed -i -e 's/.\/\Sparc/Sparc/g' split_and_run_sparc.2.sh
chmod +x *
mv split_and_run_sparc.2.sh ./split_and_run_sparc.sh
echo "password needed to move scripts to /bin"
sudo cp * /bin/ && echo -e "Done! split_and_run_sparc, along with the necessary python scripts \n are executable and copied to /bin/" && exit
echo "Error: scripts not copied to path"