QSARModelingPy is an open-source computational package to generate and validate QSAR models.
Warning
This project is now archived and should be used only as reference.
The development continues at hellmrf/qsarmodeling (Desktop App) and hellmrf/QSARModelingPy (Python library).
What you can do with QSARModelingPy
- Select variables through either OPS or Genetic Algorithm
- Dimensionality reduction:
- Correlation cut
- Variance cut
- Autocorrelation cut
- Validate your models:
- Cross Validation
- y-randomization / Leave-N-out
- External Validation
Some of these features are not yet fully implemented on all interfaces.
What QSARModelingPy is yet to implement?
- Descriptors extraction using different methodologies
- Graphical outputs
- Faster calculations
- Batch calculations for CLI
QSARModelingPy is divided into three different approaches: you can execute it headless (in command line), in a Jupyter Notebook, or a Graphical User Interface.
If you don't know exactly what you need, here are a rule of thumbs:
- If you are a chemist, physicist, or engineer and just want to build and validate your models, you will probably prefer the GUI mode.
- To run calculations remotely, in a cluster or if you just love the command line (♥), use the CLI version. Versioning control is also possible in CLI.
- If you know Python and want to have more control over what the program is doing, you can use the Jupyter Notebook version.
- If you are a programmer and want to develop a new application using QSARModelingPy's Core, take a look at the package
QSARModelingPyCoreavailable at PyPI.
Maybe the easiest way to install QSARModelingPy on Linux is through the Snap version (for distros with snap support). Just run:
sudo snap install qsarmodelingpy --channel=edge/stableAnd then run the program with qsarmodelingpy on the terminal, or search for QSARModelingPy on your launcher.
The recommended way of installing the GUI is with Miniconda (or Anaconda, if you already have it). If you're using Windows, you may need to use the Anaconda Prompt where we say "terminal" below.
Make sure the
condacommand is accessible in your shell. You may need toconda init <shell>if you're not using the default shell. For example, if you're using zsh on Linux or Powershell on Windows, you may need toconda init zshorconda init powershell, respectively. On Windows, you can also use the Anaconda Prompt and skip this part.
When you have conda, install the GUI for QSARModelingPy:
$ conda install -c helitonmrf -c conda-forge qsarmodelingpy-guiThroughout this guide, you'll see command beginning with
$. This just indicates a shell input, and thus should not be typed.
Then run the application:
$ qsarmodelingpyIf, for some reason, you don't want to use Miniconda (or Anaconda), you can use pip. However, be aware that some of the QSARModeling dependencies don't offer pre-built packages, what basically means that pip will need to build them. Practically, it means you'll need the building apparatus.
Advantages over Miniconda approach:
- You aren't stuck inside an environment, so
qsarmodelingpywill be available system-wide.
Disadvantages over Miniconda approach:
- You may have to install some build dependencies.
First of all, you'll need Python 3 installed, as well as pip.
Then install the application running in a terminal (or command prompt):
$ pip install qsarmodelingpy-guiIf you got some error saying ERROR: Command errored out with exit status 1:, look at the message just before. It'll say what to do. On Debian/Ubuntu, you'll need to install some dependencies:
$ sudo apt install libglib2.0-dev libgirepository1.0-dev libcairo2-devOn Windows, you may need Microsoft C++ Build Tools.
After installing the dependencies, you'll need to run pip install qsarmodelingpy-gui again.
After you have success installing the pip package, you can run the application with:
$ qsarmodelingpyIf you want to use other interfaces or, for any reason, don't want the binaries, start installing Anaconda (or, if you don't need Jupyter Notebook, Minicoda). The use of virtualenv is possible in Linux but will lead to severe problems in Windows (missing icons, missing libraries, fatal erros, civil wars...). As it depends a lot on the system, we've decided to use the conda approach.
Make sure the
condacommand is accessible in your shell. You may need toconda init <shell>if you're not using the default shell. For example, if you're using zsh on Linux or Powershell on Windows, you may need toconda init zshorconda init powershell, respectively.
$ git clone git@github.com:hellmrf/QSARModelingPy.git
$ cd ./QSARModelingPyIf you don't have git installed, you can use the "Download ZIP" option on Github and extract it. Just make sure your terminal is within the QSARModelingPy (or QSARModelingPy-master) folder.
Now you can create a new environment using environment.yml. To do this, make sure you're inside the QSARModelingPy folder and run the following from a terminal (or prompt).
$ conda env create -f environment.ymlThis will create a new environment called QSARModelingPy and install all needed dependencies.
Just run:
$ conda activate QSARModelingPyPlease, note that you must activate your virtual environment each time your terminal has been restarted. You'll get a visual clue that it's active by looking for
(QSARModelingPy)at the beginning of your shell line. If you don't see this even afterconda activate, check the hint above aboutconda initializing your shell.
You're ready. Enter the right directory and do what you need.
(QSARModelingPy) $ cd ./command_lineEnter jupyter directory and run jupyter notebook:
(QSARModelingPy) $ cd ./jupyter
(QSARModelingPy) $ jupyter notebookExecute QSARModelingNotebook.ipynb and you're ready.
The following is applicable only if you downloaded the code and are running directly with Python. If you're using Snap or Binaries, this is not for you.
Now you have to enter the GUI directory and execute the program:
(QSARModelingPy) $ python ./GUI/main.pyYou may notice the lack of some icons. It does not affect in any way the program, but to fix that, you will need to install Adwaita icons, which is normally done by conda when installing dependencies. For Ubuntu Linux, run:
$ sudo apt install adwaita-icon-theme-fullSee this for Windows and this if your distro's package manager does not have this theme. It's not mandatory, however.