-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
executable file
·132 lines (117 loc) · 5.37 KB
/
Makefile
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/make -rRsf
SHELL=/bin/bash -o pipefail
#USAGE:
#
# make
#
MAKEDIR := $(dir $(firstword $(MAKEFILE_LIST)))
DIR := ${CURDIR}
CONDAROOT = ${DIR}/software/anaconda/install/
orthopath := $(shell ls ${DIR}/software/OrthoFinder/orthofinder/orthofuser.py 2>/dev/null)
orthufuserversion = $(shell orthofuser.py --help | grep "OrthoFinder version" | awk '{print $$3}')
transrate := $(shell ls ${DIR}/software/orp-transrate/transrate 2>/dev/null)
transabysspath := $(shell which ${DIR}/software/transabyss/transabyss 2>/dev/null)
transabyssversion = $(shell conda ${DIR}/software/anaconda/install/bin/activate orp 2>/dev/null; transabyss --version 2>/dev/null; conda deactivate 2> /dev/null)
trinitypath := $(shell which ${DIR}/software/trinityrnaseq-v2.12.0/Trinity 2>/dev/null)
trinityversion = $(shell ${DIR}/software/trinityrnaseq-v2.12.0/Trinity --version | awk '{print $$3}' | head -1 | awk -F 'v' '{print $$2}')
spadespath := $(shell which ${DIR}/software/SPAdes-3.15.2-Linux/bin/spades.py 2>/dev/null)
spadesversion = $(shell ${DIR}/software/SPAdes-3.15.2-Linux/bin/spades.py --version | awk -F 'v' '{print $$2}')
diamond_data := $(shell ls ${DIR}/software/diamond/uniprot_sprot.fasta 2>/dev/null)
busco_data := $(shell ls ${DIR}/busco_dbs/eukaryota_odb10 2>/dev/null)
conda := $(shell conda info 2>/dev/null)
orp := $(shell ${DIR}/software/anaconda/install/bin/conda info --envs | grep orp 2>/dev/null)
VERSION := ${shell cat ${MAKEDIR}version.txt}
all: setup conda orp orthofuser transrate diamond_data busco_data postscript
.DELETE_ON_ERROR:
setup:
@mkdir -p ${DIR}/shared
@mkdir -p ${DIR}/software/anaconda
@mkdir -p ${DIR}/software/diamond
conda:setup
ifdef conda
else
cd ${DIR}/software/anaconda && curl -LO https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
cd ${DIR}/software/anaconda && bash Anaconda3-2020.11-Linux-x86_64.sh -b -p install/
@echo ". ${DIR}/software/anaconda/install/etc/profile.d/conda.sh" >> ~/.bashrc;
@echo ". ${DIR}/software/anaconda/install/etc/profile.d/conda.sh" > pathfile;
source ~/.bashrc;
endif
orp:orp_env.yml conda setup
ifdef orp
else
( \
source ${DIR}/software/anaconda/install/etc/profile.d/conda.sh; \
conda activate; \
conda update -y -n base conda; \
conda config --add channels conda-forge; \
conda config --add channels bioconda; \
conda install mamba -n base -yc conda-forge; \
mamba create -yc bioconda --name orp_spades spades=3.15.2; \
mamba create -yc bioconda --name orp_trinity trinity=2.9.1 bwa=0.7.17 bashplotlib seqtk=1.3; \
mamba create -yc bioconda --name orp_busco busco=5.1.2; \
mamba create -yc bioconda --name orp_transabyss transabyss=2.0.1; \
mamba create -yc bioconda --name orp_rcorrector rcorrector=1.0.4; \
mamba create -yc bioconda --name orp_trimmomatic trimmomatic=0.39; \
mamba create -yc bioconda --name orp_sam samtools=1.12 bwa=0.7.17 seqtk=1.3; \
mamba create -yc bioconda --name orp_salmon salmon=1.4.0; \
mamba create -yc bioconda --name orp_cdhit cd-hit=4.6.8; \
mamba create -yc bioconda --name orp_diamond diamond=2.0.8; \
mamba env create -f ${DIR}/orp_env.yml python=3.8; \
mamba clean -ya; \
conda deactivate; \
)
@echo PATH=\$$PATH:${DIR}/software/anaconda/install/bin >> pathfile;
endif
diamond_data:conda
ifdef diamond_data
@echo "diamond_data is already installed"
else
cd ${DIR}/software/diamond && curl -LO ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz && gzip -d uniprot_sprot.fasta.gz && ${DIR}/software/anaconda/install/envs/orp_diamond/bin/diamond makedb --in uniprot_sprot.fasta -d swissprot
endif
busco_data:conda
ifdef busco_data
else
mkdir ${DIR}/busco_dbs && cd ${DIR}/busco_dbs
cd ${DIR}/busco_dbs && wget https://busco-data.ezlab.org/v5/data/lineages/eukaryota_odb10.2020-09-10.tar.gz && tar -zxf eukaryota_odb10.2020-09-10.tar.gz
endif
transrate:
ifdef transrate
else
cd ${DIR}/software && tar -zxf orp-transrate.tar.gz
@echo PATH=\$$PATH:${DIR}/software/orp-transrate >> pathfile
endif
orthofuser:
ifdef orthopath
ifeq ($(orthufuserversion),2.5.2)
@echo "orthofuser right version is already installed"
else
@echo "version ${orthufuserversion}"
@echo "orthofuser is installed, but not the right version"
cd ${DIR}/software/OrthoFinder/ && git pull
endif
else
@echo "orthofuser is not installed and needs to be installed"
cd ${DIR}/software && curl -LO https://github.com/davidemms/OrthoFinder/releases/download/2.5.2/OrthoFinder.tar.gz
cd ${DIR}/software/ && tar -zxf OrthoFinder.tar.gz
@echo PATH=\$$PATH:${DIR}/software/OrthoFinder/ >> pathfile
endif
postscript: setup orp diamond_data busco_data orthofuser conda transrate
@if [ -f pathfile ]; then\
printf "\n\n*** The following location(s), if any print, need to be added to your PATH ***";\
printf "\n*** They will be automatically to your ~/.profile or ~/.bash_profile ***\n\n";\
cat pathfile;\
cat pathfile >> ~/.profile;\
cat pathfile >> ~/.bash_profile;\
cat pathfile >> ~/.bash_profile;\
export PATH=$$PATH:$$(cat pathfile);\
printf "\n\n\n";\
printf "\n*** type ``source ~/.profile`` to complete the install ***\n\n";\
fi
clean:
${DIR}/software/anaconda/install/bin/conda remove -y --name orp --all
rm -fr ${DIR}/software/anaconda/install
rm -fr ${DIR}/software/OrthoFinder/
rm -fr ${DIR}/software/orp-transrate
rm -fr ${DIR}/software/transabyss
rm -fr ${DIR}/software/anaconda/
rm -fr ${DIR}/pathfile