cc_py37.def 6.51 KB
Newer Older
1
BootStrap: docker
Martino Bertoni's avatar
Martino Bertoni committed
2
From: centos:8
3
4
5

%environment
    # PATHS
6
    export PATH=/opt/miniconda3/bin:$PATH
7
8
    . /opt/miniconda3/etc/profile.d/conda.sh
    conda activate py37
9

Martino Bertoni's avatar
Martino Bertoni committed
10
11
12
13
%files
    #add node2vec pre-compiled binaries
    container/singularity/binaries/node2vec /opt

14
15
%post
    # bind paths
Martino Bertoni's avatar
Martino Bertoni committed
16
17
18
19
20
21
    mkdir -p /aloy
    mkdir -p /aloy/home
    mkdir -p /aloy/data
    mkdir -p /aloy/scratch
    mkdir -p /aloy/web_checker
    mkdir -p /slgpfs
22
23
24
25
    
    # update yum
    yum update -y

Martino Bertoni's avatar
Martino Bertoni committed
26
    # basic packages (~2 min)
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    yum install -y gcc \
                   gcc-c++ \
                   gcc-gfortran \
                   cmake \
                   make \
                   git \
                   wget \
                   curl \
                   which \
                   vim \
                   bzip2 \
                   bzip2-devel \
                   file \
                   libXrender \
                   libXext \
                   postgresql-server \
Martino Bertoni's avatar
Martino Bertoni committed
43
                   postgresql-contrib \
44
                   epel-release 
Martino Bertoni's avatar
Martino Bertoni committed
45

Martino Bertoni's avatar
Martino Bertoni committed
46
    # MS compatible font for plotting (~3 min.)
47
    yum install -y xorg-x11-font-utils fontconfig libmspack
48
49
    rpm -i http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/c/cabextract-1.5-1.el7.x86_64.rpm
    rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
50
51

    # conda
Martino Bertoni's avatar
Martino Bertoni committed
52
    mkdir -p /opt/miniconda3
53
54
55
56
57
58
59
    cd /opt/miniconda3 
    wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
    bash Miniconda3-latest-Linux-x86_64.sh -p /opt/miniconda3 -b -f
    rm Miniconda3-latest-Linux-x86_64.sh
    export PATH=/opt/miniconda3/bin:$PATH

    # create and activate conda enviroment
60
61
62
    conda update conda -y
    conda create --name=py37 python=3.7 -y
    source activate py37
63

Martino Bertoni's avatar
Martino Bertoni committed
64
    # conda-specific packages (~1 min)
65
66
67
68
69
70
    conda install -y -c rdkit rdkit                  # Open-Source Cheminformatics Software
    conda install -y -c openbabel openbabel          # chemical toolbox
    conda install -y mkl-service                     # change the number of CPU’s MKL is using
    conda install -y anaconda-client                 # client that provides an interface to Anaconda Cloud
    conda install -y -c conda-forge hdbscan          # clustering
    conda install -y -c efelix fpsim2                # fast compound similarity searches (used in TargetMate)
Martino Bertoni's avatar
Martino Bertoni committed
71
    conda install -y -c conda-forge jupyterlab       # Jupyter notebooks
72
73
74
    conda install -y -c anaconda ipython">7.19"      # interactive python
    conda install -y -c anaconda cython              # C extensions
    conda install -y -c pytorch faiss-cpu            # efficient similarity search and clustering
75
76
77
    alias test_faiss='python -c "import faiss, numpy
faiss.Kmeans(10, 20).train(numpy.random.rand(1000, 10).astype(numpy.float32))"'
    if ! test_faiss; then printf -- "\033[31m ERROR: faiss is failing! \033[0m\n"; else printf -- '\033[32m SUCCESS: faiss is working correctly. \033[0m\n'; fi
78

Martino Bertoni's avatar
Martino Bertoni committed
79
    # utility packages (~2 min)
80
81
    pip install six                               # py2/py3 compatibility
    pip install pytest                            # unit-testing
Martino Bertoni's avatar
Martino Bertoni committed
82
    pip install mock                              # mocking for unit-testing
83
84
85
86
87
88
89
90
91
    pip install autologging                       # logging handler
    pip install paramiko                          # ssh client
    pip install psycopg2-binary                   # Postgesql driver
    pip install sqlalchemy                        # ORM SQL
    pip install sphinx                            # to generate docs
    pip install sphinx_rtd_theme                  # docs theme.
    pip install patool                            # unzipping
    pip install wget                              # download library
    pip install tqdm                              # handy progress-bar
Martino Bertoni's avatar
Martino Bertoni committed
92
    pip install munch                             # dictionary that supports attribute-style access
93

94
    # raw data packages
Martino Bertoni's avatar
Martino Bertoni committed
95
    pip install lxml                              # xml parser
Martino Bertoni's avatar
Martino Bertoni committed
96
    pip install xlrd                              # Extract data from Excel spreadsheets
97
98
99
100
    pip install cmapPy                            # interacting with .gctx and .gct files, and other Connectivity Map resources
    pip install csvsort                           # Sort csv

    # chemistry packages
101
    pip install e3fp                              # 3D molecular fingreprints
Oriol Guitart's avatar
Oriol Guitart committed
102
    pip install pubchempy                         # Pubchem rest api
103
    pip install standardiser                      # standardising molecules
104
    pip install chembl_webresource_client         # Chembl API
105

106
107
108
    # ML packages
    pip install scikit-learn                      # entry level ML in python
    pip install gensim                            # topic modelling word2vec
109
110
111
    if ! test_faiss; then printf -- "\033[31m ERROR: faiss is failing! \033[0m\n"; else printf -- '\033[32m SUCCESS: faiss is working correctly. \033[0m\n'; fi
    pip install tensorflow                        # neural network library
    if ! test_faiss; then printf -- "\033[31m ERROR: faiss is failing! \033[0m\n"; else printf -- '\033[32m SUCCESS: faiss is working correctly. \033[0m\n'; fi
Martino Bertoni's avatar
Martino Bertoni committed
112
113
    pip install adanet                            # automl for NN
    pip install keras                             # NN API
114

115
    # numerical packages
116
117
    pip install numpy                             # best numerical library ever
    pip install pandas                            # handles table-like datastracture
118
    pip install openpyxl                          # open xlsx
119
120
    pip install scipy                             # scientific python
    pip install theano                            # Optimize evaluate math expressions
121
    pip install fancyimpute                       # matrix completion and imputation algorithms
Martino Bertoni's avatar
Martino Bertoni committed
122
    pip install protobuf                          # Google serialization library
123

124
125
    # graph packages
    pip install networkx                          # graph data stracture and algos
Martino Bertoni's avatar
Martino Bertoni committed
126
    pip install snap-stanford                     # Python interface for SNAP
127
128

    # visualization packages
Martino Bertoni's avatar
Martino Bertoni committed
129
    pip install matplotlib                        # chart library :)
130
    pip install seaborn                           # prettier graph built on top of matplotlib
Martino Bertoni's avatar
Martino Bertoni committed
131
    pip install datashader                        # plot huge 2D datasets (projetions)
132

133
    # Dimensionality reduction
Martino Bertoni's avatar
Martino Bertoni committed
134
    pip install MulticoreTSNE                     # tSNE algo
135
    pip install umap-learn                        # UMAP algo
136

Martino Bertoni's avatar
Martino Bertoni committed
137
    # Clone the chemical checker package (used as fallback)
Martino Bertoni's avatar
Martino Bertoni committed
138
    cd /opt
139
    git clone http://gitlabsbnb.irbbarcelona.org/packages/chemical_checker.git