### Install RanDepict by cloning repository and pip install Source: https://github.com/obrink/randepict/blob/main/README.md Instructions to clone the RanDepict repository, navigate into it, upgrade pip, and install the package in editable mode for local development or usage. ```shell $ git clone https://github.com/OBrink/RanDepict.git $ cd RanDepict $ python -m pip install -U pip #Upgrade pip $ pip install . ``` -------------------------------- ### Install RanDepict from PyPI Source: https://github.com/obrink/randepict/blob/main/README.md Simple command to install the RanDepict package from the Python Package Index (PyPI), which is the standard way to install Python packages. ```shell $ pip install RanDepict ``` -------------------------------- ### Install RanDepict using pip Source: https://github.com/obrink/randepict/blob/main/docs/index.rst Installs the RanDepict library from PyPI using the pip package manager. This command downloads and sets up all necessary dependencies for RanDepict, making it ready for use in Python projects. ```Shell $ pip install RanDepict ``` -------------------------------- ### Run RanDepict for Batch Depiction Generation to TFRecord (Python) Source: https://github.com/obrink/randepict/blob/main/examples/README.md This command runs the `randepict_batch_run_tfrecord_output.py` script to generate random depictions with and without augmentations. It saves batches of images and annotations into TFRecord files, which is beneficial for handling large datasets with Tensorflow. Requires Tensorflow 2.X to be installed. ```Python python3 randepict_batch_run_tfrecord_output.py tfrecord_creation_data_sample.txt ``` -------------------------------- ### Install RanDepict directly from GitHub using pip Source: https://github.com/obrink/randepict/blob/main/README.md Provides an alternative method to install RanDepict directly from its GitHub repository using pip, after ensuring pip is upgraded to its latest version. ```shell $ python -m pip install -U pip #Upgrade pip $ pip install git+https://github.com/OBrink/RanDepict.git ``` -------------------------------- ### Set up Conda environment for RanDepict development Source: https://github.com/obrink/randepict/blob/main/README.md Detailed steps to set up a Conda environment for RanDepict development, including downloading Miniconda, configuring channels, updating Conda, creating and activating a new environment, and installing development dependencies with pytest and tox. ```shell $ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh $ bash Miniconda3-latest-Linux-x86_64.sh $ echo -e "channels:\n - conda-forge\n - nodefaults" > ~/.condarc $ conda update conda $ conda install conda-libmamba-solver $ conda config --set experimental_solver libmamba $ conda create --name RanDepict python=3.8 $ conda activate RanDepict $ pip install -e ".[dev]" # will install pytest and tox $ tox -e py38 ``` -------------------------------- ### Run RanDepict for Random Depiction Generation (Python) Source: https://github.com/obrink/randepict/blob/main/examples/README.md This command executes the `create_random_depictions.py` script to generate random depictions from a sample file containing IDs and SMILES. This script does not use the depiction feature fingerprints. ```Python python3 create_random_depictions.py id_smiles_sample.txt ``` -------------------------------- ### Import Libraries for Data Analysis and Plotting Source: https://github.com/obrink/randepict/blob/main/examples/time_report.ipynb Imports necessary Python libraries for the script. `RandomDepictor` is imported from the `RanDepict` project, `numpy` for numerical operations, `scipy.stats` for statistical functions like linear regression, and `matplotlib.pyplot` for creating plots. ```python from RanDepict import RandomDepictor import numpy as np from scipy import stats import matplotlib.pyplot as plt ``` -------------------------------- ### Project Python Package Dependencies Source: https://github.com/obrink/randepict/blob/main/docs/requirements.txt Lists all external Python libraries and their version requirements. This information is typically found in a `requirements.txt` file and is crucial for setting up the correct development or deployment environment for the project. Each entry specifies a package name, optionally followed by a version constraint (e.g., `>=` for minimum version, `==` for exact version). ```Python Requirements nbsphinx sphinx-autodoc-typehints furo numpy>=1.19 imgaug scikit-image epam.indigo jpype1 ipyplot rdkit-pypi imagecorruptions pillow>=8 pikachu-chem>=1.0.7 omegaconf==2.2.3 ``` -------------------------------- ### Load and Analyze Runtime Data with Linear Regression Source: https://github.com/obrink/randepict/blob/main/examples/time_report.ipynb Reads tab-separated time data from 'time_report.txt', processes it into a NumPy array, and then performs linear regression for four different runtime scenarios: 'FP no augmentation', 'FP with augmentation', 'normal no augmentation', and 'normal with augmentation'. For each scenario, it calculates and prints the regression equation and an extrapolated time needed for 1 million images. ```python with open("time_report.txt", "r") as time_data: time_data = [line[:-1].split('\t') for line in time_data.readlines()] time_data = [[float(num) for num in arr if num != ''] for arr in time_data] time_data = np.array(time_data) number = time_data[:, 0] FP_noaug = [time/60 for time in time_data[:, 1]] slope, intercept, r_value, p_value, std_err = stats.linregress(number, FP_noaug) FP_noaug_regr = [intercept+slope*x for x in number] print(f'FP no aug: {intercept} + {slope} * image_number; R_square = {r_value}') print(f'FP no aug: Extrapolated time needed for 1 million images: {(intercept+slope*1000000)/60} hours') FP_aug = [time/60 for time in time_data[:, 2]] slope, intercept, r_value, p_value, std_err = stats.linregress(number, FP_aug) FP_aug_regr = [intercept+slope*x for x in number] print(f'FP aug: {intercept} + {slope} * image_number; R_square = {r_value}') print(f'FP aug: Extrapolated time needed for 1 million images: {(intercept+slope*1000000)/60} hours') norm_noaug = [time/60 for time in time_data[:, 3]] slope, intercept, r_value, p_value, std_err = stats.linregress(number, norm_noaug) norm_noaug_regr = [intercept+slope*x for x in number] print(f'norm no aug: {intercept} + {slope} * image_number; R_square = {r_value}') print(f'norm no aug: Extrapolated time needed for 1 million images: {(intercept+slope*1000000)/60} hours') norm_aug = [time/60 for time in time_data[:, 4]] slope, intercept, r_value, p_value, std_err = stats.linregress(number, norm_aug) norm_aug_regr = [intercept+slope*x for x in number] print(f'norm no aug: {intercept} + {slope} * image_number; R_square = {r_value}') print(f'norm aug: Extrapolated time needed for 1 million images: {(intercept+slope*1000000)/60} hours') ``` -------------------------------- ### Generate chemical structure depiction using RanDepict Source: https://github.com/obrink/randepict/blob/main/README.md Demonstrates the basic usage of the RandomDepictor class from the RanDepict library. It shows how to import the class, define a SMILES string for a chemical compound, and use a context manager to generate an image depiction. ```python from RanDepict import RandomDepictor smiles = "CN1C=NC2=C1C(=O)N(C(=O)N2C)C" with RandomDepictor() as depictor: image = depictor(smiles) ``` -------------------------------- ### Visualize Runtime Analysis Results Source: https://github.com/obrink/randepict/blob/main/examples/time_report.ipynb Generates a scatter plot using matplotlib, displaying the original data points and the calculated linear regression lines for all four runtime scenarios. The plot includes labels for axes, a legend to distinguish between scenarios, and is saved as 'runtime_analysis.png' with a high DPI before being displayed. ```python plt.plot(number, FP_aug, "rx",label = "with augmentation, with fingerprints") plt.plot(number, FP_aug_regr, "r--") plt.plot(number, FP_noaug, "bo",label = "no augmentation, with fingerprints") plt.plot(number, FP_noaug_regr, "b--") plt.plot(number, norm_aug, "yx",label = "with augmentation") plt.plot(number, norm_aug_regr, "y--") plt.plot(number, norm_noaug, "go",label = "no augmentation") plt.plot(number, norm_noaug_regr, "g--") plt.xlabel("number of depicted structures") plt.ylabel("time (min)") plt.legend() plt.savefig('runtime_analysis.png', dpi=300) plt.show() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.