Tutorial: Installation#

In this series of tutorials, we will try to install and run ReacNetGenerator.

In this tutorial, we will use pip to install ReacNetGenerator. This is the eastiest way without compiling the package.

Install ReacNetGenerator#

We use pip to install the ReacNetGenerator. It’s very simple as follows!

%%bash
pip install reacnetgenerator
Collecting reacnetgenerator
?25l  Downloading https://files.pythonhosted.org/packages/1f/e9/56819faadf4d9c253b4110fb0e1304a2a80094e03c4e9e9a8a67fb6c1751/reacnetgenerator-1.4.164-cp37-cp37m-manylinux2010_x86_64.whl (4.3MB)
     |████████████████████████████████| 4.3MB 6.3MB/s 
?25hCollecting lz4
?25l  Downloading https://files.pythonhosted.org/packages/e3/52/151c815a486290608e4dc6699a0cfd74141dc5191f8fe928e7d1b28b569e/lz4-3.1.3-cp37-cp37m-manylinux2010_x86_64.whl (1.8MB)
     |████████████████████████████████| 1.8MB 37.9MB/s 
?25hCollecting coloredlogs
?25l  Downloading https://files.pythonhosted.org/packages/84/a6/837dbf6eac344cb74f0ba86b79e8180855570af3e26bcb1ea5f650cf944c/coloredlogs-15.0-py2.py3-none-any.whl (45kB)
     |████████████████████████████████| 51kB 4.6MB/s 
?25hCollecting scour
?25l  Downloading https://files.pythonhosted.org/packages/75/19/f519ef8aa2f379935a44212c5744e2b3a46173bf04e0110fb7f4af4028c9/scour-0.38.2.tar.gz (52kB)
     |████████████████████████████████| 61kB 5.7MB/s 
?25hRequirement already satisfied: networkx in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (2.5)
Collecting ase
?25l  Downloading https://files.pythonhosted.org/packages/a5/36/de17e79f29e06d9a92746d0dd9ec4636487ab03f6af10e78586aae533f7a/ase-3.21.1-py3-none-any.whl (2.2MB)
     |████████████████████████████████| 2.2MB 33.9MB/s 
?25hRequirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (2.23.0)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (3.2.2)
Collecting openbabel-wheel
?25l  Downloading https://files.pythonhosted.org/packages/f3/e8/74018a601ec40dd76b9ba6d0ddfa22a67bb5802fd6ffa46a344915d46ff4/openbabel_wheel-3.1.1.5-cp37-cp37m-manylinux2014_x86_64.whl (13.6MB)
     |████████████████████████████████| 13.6MB 258kB/s 
?25hRequirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (1.19.5)
Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (1.1.5)
Collecting pybase64
?25l  Downloading https://files.pythonhosted.org/packages/71/9c/fc5a2734645f9cdc7c0a549a4ee063cf25c05e728d287508fd14c437ac4e/pybase64-1.1.4-cp37-cp37m-manylinux2014_x86_64.whl (170kB)
     |████████████████████████████████| 174kB 50.0MB/s 
?25hRequirement already satisfied: scipy>=0.20.1 in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (1.4.1)
Collecting rdkit-pypi
?25l  Downloading https://files.pythonhosted.org/packages/6f/1b/053bddf14b39000ff95c59d012934fcbe96fef681ece0f8315c126c0bb5b/rdkit_pypi-2021.3.1.2-cp37-cp37m-manylinux2014_x86_64.whl (31.4MB)
     |████████████████████████████████| 31.4MB 111kB/s 
?25hCollecting hmmlearn>=0.2.1
?25l  Downloading https://files.pythonhosted.org/packages/4b/98/a2829aeb942b7146034d497afb3fc738a78a4fbd4797a039c19a94bb31f7/hmmlearn-0.2.5-cp37-cp37m-manylinux1_x86_64.whl (369kB)
     |████████████████████████████████| 378kB 34.7MB/s 
?25hRequirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from reacnetgenerator) (4.41.1)
Collecting humanfriendly>=9.1
?25l  Downloading https://files.pythonhosted.org/packages/93/66/363d01a81da2108a5cf446daf619779f06d49a0c4426dd02b40734f10e2f/humanfriendly-9.1-py2.py3-none-any.whl (86kB)
     |████████████████████████████████| 92kB 7.4MB/s 
?25hRequirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from scour->reacnetgenerator) (1.15.0)
Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.7/dist-packages (from networkx->reacnetgenerator) (4.4.2)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (1.24.3)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->reacnetgenerator) (2.10)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (2.8.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (2.4.7)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->reacnetgenerator) (0.10.0)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas->reacnetgenerator) (2018.9)
Requirement already satisfied: scikit-learn>=0.16 in /usr/local/lib/python3.7/dist-packages (from hmmlearn>=0.2.1->reacnetgenerator) (0.22.2.post1)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.16->hmmlearn>=0.2.1->reacnetgenerator) (1.0.1)
Building wheels for collected packages: scour
  Building wheel for scour (setup.py) ... ?25l?25hdone
  Created wheel for scour: filename=scour-0.38.2-cp37-none-any.whl size=54253 sha256=5c236125ed4b03b44f5f87c711b62d82acf7d183e110bee4250ae7cfbd78aa33
  Stored in directory: /root/.cache/pip/wheels/0e/85/c0/989d78aef861a7859c2ec1e56157abc1255498e49dcbfa23f4
Successfully built scour
Installing collected packages: lz4, humanfriendly, coloredlogs, scour, ase, openbabel-wheel, pybase64, rdkit-pypi, hmmlearn, reacnetgenerator
Successfully installed ase-3.21.1 coloredlogs-15.0 hmmlearn-0.2.5 humanfriendly-9.1 lz4-3.1.3 openbabel-wheel-3.1.1.5 pybase64-1.1.4 rdkit-pypi-2021.3.1.2 reacnetgenerator-1.4.164 scour-0.38.2

Now, ReacNetGenerator has been already installed in the environment. Try it now!

%%bash
reacnetgenerator -h
usage: reacnetgenerator [-h] -i [INPUTFILENAME [INPUTFILENAME ...]] -a
                        [ATOMNAME [ATOMNAME ...]] [--nohmm] [--dump]
                        [--type TYPE] [--nopbc] [--cell CELL CELL CELL]
                        [-n NPROC] [-s [SELECTATOMS [SELECTATOMS ...]]]
                        [--stepinterval STEPINTERVAL] [--split SPLIT]
                        [--maxspecies MAXSPECIES]
                        [--matrixa MATRIXA MATRIXA MATRIXA MATRIXA]
                        [--matrixb MATRIXB MATRIXB MATRIXB MATRIXB]
                        [--urls URLS URLS]

ReacNetGenerator 1.4.164

optional arguments:
  -h, --help            show this help message and exit
  -i [INPUTFILENAME [INPUTFILENAME ...]], --inputfilename [INPUTFILENAME [INPUTFILENAME ...]]
                        Input trajectory file, e.g. bonds.reaxc
  -a [ATOMNAME [ATOMNAME ...]], --atomname [ATOMNAME [ATOMNAME ...]]
                        Atomic names in the trajectory, e.g. C H O
  --nohmm               Process trajectory without Hidden Markov Model (HMM)
  --dump                Process the LAMMPS dump file
  --type TYPE, -t TYPE  Input file type
  --nopbc               Disable PBC.
  --cell CELL CELL CELL, -c CELL CELL CELL
                        Cell
  -n NPROC, -np NPROC, --nproc NPROC
                        Number of processes
  -s [SELECTATOMS [SELECTATOMS ...]], --selectatoms [SELECTATOMS [SELECTATOMS ...]]
                        Select atoms in the reaction network, e.g. C
  --stepinterval STEPINTERVAL
                        Step interval
  --split SPLIT         Split number for the time axis
  --maxspecies MAXSPECIES
                        Max number of nodes (species) in the network
  --matrixa MATRIXA MATRIXA MATRIXA MATRIXA
                        Matrix A of HMM parameters
  --matrixb MATRIXB MATRIXB MATRIXB MATRIXB
                        Matrix B of HMM parameters
  --urls URLS URLS      Download files