cc_py37.def 6.47 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
    source activate py37
8

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

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

Martino Bertoni's avatar
Martino Bertoni committed
25
    # basic packages (~2 min)
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    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
42
                   postgresql-contrib \
43
                   epel-release 
Martino Bertoni's avatar
Martino Bertoni committed
44

Martino Bertoni's avatar
Martino Bertoni committed
45
    # MS compatible font for plotting (~3 min.)
46
    yum install -y xorg-x11-font-utils fontconfig libmspack
47
48
    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
49
50

    # conda
Martino Bertoni's avatar
Martino Bertoni committed
51
    mkdir -p /opt/miniconda3
52
53
54
55
56
57
58
    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
59
60
61
    conda update conda -y
    conda create --name=py37 python=3.7 -y
    source activate py37
62

Martino Bertoni's avatar
Martino Bertoni committed
63
    # conda-specific packages (~1 min)
64
65
66
67
68
69
    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
70
    conda install -y -c conda-forge jupyterlab       # Jupyter notebooks
71
72
73
    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
74
75
76
    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
77

Martino Bertoni's avatar
Martino Bertoni committed
78
    # utility packages (~2 min)
79
80
    pip install six                               # py2/py3 compatibility
    pip install pytest                            # unit-testing
Martino Bertoni's avatar
Martino Bertoni committed
81
    pip install mock                              # mocking for unit-testing
82
83
84
85
86
87
88
89
90
    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
91
    pip install munch                             # dictionary that supports attribute-style access
92

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

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

105
106
107
    # ML packages
    pip install scikit-learn                      # entry level ML in python
    pip install gensim                            # topic modelling word2vec
108
109
110
    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
111
112
    pip install adanet                            # automl for NN
    pip install keras                             # NN API
113

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

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

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

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

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