-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall-step-1-by-conda.sh
More file actions
91 lines (74 loc) · 5.99 KB
/
Copy pathinstall-step-1-by-conda.sh
File metadata and controls
91 lines (74 loc) · 5.99 KB
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
# note: the line below (which installs the tcsh shell) is part of the manual install of netMHCpan and netMHCstabpan, so the line below is commented out
# sudo apt install tcsh # is required by netMHCpan-4 /usr/bin/tcsh
# note: sshpass is required if we want to run netMHCstabpan command on a remote server
# note: these mirror channels (for example, used with "-c $condaforge -c $bioconda" on the cmd-line) are used to speed up installation in China
# you can set these mirror channels according to your geolocation
condaforge='https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/'
bioconda='https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/'
main='https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/'
free='https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
fastai='https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/'
pytorch='https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/'
for channel in $pytorch $fastai $free $main $bioconda $condaforge ; do
conda config --add channels "${channel}"
done
conda=mamba
neoguider="$1" # neoguider env name
if [ -z "$neoguider" ]; then neoguider=ng; fi
conda install -y mamba -n base
conda create -y -n $neoguider
# Order of packages: common bin, common lib, machine-learning lib, bioinformatics bin, bioinformatics lib
# note:
# pyfasta is replaced by pyfaidx
# kallisto with versions higher than 0.48 is characterized by some non-deterministic behavior, generating different outputs from the same input
# ASNEO requires 'biopython<=1.79' (ASNEO code can be refactored to upgrade biopython)
# ERGO-II requires pytorch-lightning=0.8, but we will change a few lines of source code in ERGO-II
# in the next installation step to make it work with higher versions of pytorch-lightning
# podman can be used to provide a work-around for https://github.com/FRED-2/OptiType/issues/125
# Please feel free to modify other version sets as needed.
$conda install -y -n $neoguider python=3.10 xlrd openpyxl \
gcc openjdk parallel perl podman screen sshpass tcsh \
joblib perl-carp-assert psutil pyyaml requests-cache zlib \
imbalanced-learn numpy scipy pandas pytorch pytorch-lightning scikit-learn scikit-optimize statsmodels xgboost \
bcftools bedtools blast 'bwa=0.7.17' 'ensembl-vep=109.3' 'kallisto=0.48.0' mosdepth 'optitype=1.3.5' samtools snakemake 'star=2.7.8' 'star-fusion=1.12.0' mhcflurry mafft \
'biopython<=1.79' pybiomart pyfaidx pysam
# bcftools blast bwa ensembl-vep kallisto mosdepth optitype samtools snakemake star 'star-fusion>=1.11' \
# $conda run -n $neoguider mhcflurry-downloads fetch # We can manually download the mhcflurry data if this command fails
# Currently, edit-distance based on blosum alignment instead of edit-distance based on edlib is used
# note: if you have encountered the error: *** is not installable because it requires __cuda, which is missing on the system,
# then you can refer to the work-around at
# https://stackoverflow.com/questions/74836151/nothing-provides-cuda-needed-by-tensorflow-2-10-0-cuda112py310he87a039-0
# to solve this error (namely, export CONDA_OVERRIDE_CUDA="11.8" && export CONDA_CUDA_OVERRIDE="11.8").
$conda run -n $neoguider $conda update numexpr # fix warning from pandas
conda run -n $neoguider pip install sj2psi # for ASNEO.py # You may have to use pip install -I sj2psi if you have used conda env create -n ... --file ...yml
# > First work-around for https://github.com/FRED-2/OptiType/issues/125 : use podman to run OptiType
# Please set is_optitype_in_podman=1 in the snakemake config or IS_PODMAN_USED_TO_WORKAROUND_OPTITYPE_MEM_LEAK=True in the Snakefile to enable this work-around.
# On some platforms, the error '''Error: command required for rootless mode with multiple IDs: exec: "newuidmap": executable file not found in $PATH''' pop up for this work-around.
conda run -n $neoguider podman pull quay.io/biocontainers/optitype:1.3.2--py27_3 || true # Docker runs into error here
# > Second work-around for https://github.com/FRED-2/OptiType/issues/125 : use another conda env to run OptiType
# Please set OTITYPE_CONDA_ENV=optitype_env in the Snakefile to enable this work-around.
# On some platforms, conda and mamba cannot install the obsolete python versions that the previous versions of optitype depend on
optitype=optitype_env
conda create -y -n $optitype
$conda install -y -n $optitype optitype=1.3.2
conda run -n ${optitype} pip install --upgrade pyomo # pyomo=5.7.3 # You may have to use pip install -I pyomo if you have used conda env create -n ... --file ...yml
# > Third work-around for https://github.com/FRED-2/OptiType/issues/125 : manually set the comma_sep_hla_list config param to skip HLA typing.
# The following commands can generate the requirements and freeze files
if false; then
conda list -n ${optitype} -e > env/${optitype}.requirements.list_e.txt
conda env export -n ${optitype} > env/${optitype}.freeze.env_export.yml
conda env export -n ${optitype} --no-builds > env/${optitype}.freeze.env_export_no_build.yml
conda env export -n ${optitype} --from-history > env/${optitype}.freeze.env_export_from_history.yml
conda list -n ${neoguider} -e | grep -v "^sj2psi=" > env/requirements.list_e_no_pypi.txt
conda env export -n ${neoguider} > env/freeze.env_export.yml
conda env export -n ${neoguider} --no-builds > env/freeze.env_export_no_builds.yml
conda env export -n ${neoguider} --from-history > env/freeze.env_export_from_history.yml
fi
rootdir="$(dirname -- "$0";)"
rootdir="$(cd "$rootdir"; pwd;)"
mkdir -p ${rootdir}/software/
cd ${rootdir}/software/
wget -c https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.14.1/ncbi-blast-2.14.1+-x64-linux.tar.gz
tar -xvf ncbi-blast-2.14.1+-x64-linux.tar.gz
# You can run the following if the blast installed by conda does not work (e.g., blast complains about mising *.so libraries)
# export PATH="${rootdir}/software/ncbi-blast-2.14.1+/bin:${PATH}"