Metadata-Version: 2.2
Name: schemist
Version: 0.0.3
Summary: Organizing and processing tables of chemical structures.
Author-email: Eachan Johnson <eachan.johnson@crick.ac.uk>
License: MIT License
        
        Copyright (c) [year] [fullname]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/scbirlab/schemist
Project-URL: Repository, https://github.com/scbirlab/schemist.git
Project-URL: Bug Tracker, https://github.com/scbirlab/schemist/issues
Project-URL: Documentation, https://readthedocs.org/schemist
Keywords: science,chemistry,SMILES,SELFIES,cheminformatics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: carabiner-tools[pd]>=0.0.3.post1
Requires-Dist: descriptastorus==2.6.1
Requires-Dist: nemony
Requires-Dist: openpyxl==3.1.0
Requires-Dist: pandas
Requires-Dist: rdkit>=2022.09.5
Requires-Dist: requests
Requires-Dist: selfies
Provides-Extra: old-glibc
Requires-Dist: rdkit-pypi==2022.09.5; extra == "old-glibc"

# ⬢⬢⬢ schemist

![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/scbirlab/schemist/python-publish.yml)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/schemist)
![PyPI](https://img.shields.io/pypi/v/schemist)
[![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-md-dark.svg)](https://huggingface.co/spaces/scbirlab/chem-converter)

Cleaning, collating, and augmenting chemical datasets.

- [Installation](#installation)
- [Command-line usage](#command-line-usage)
- [Python API](#python-api)
- [Documentation](#documentation)

## Installation

### The easy way

Install the pre-compiled version from PyPI:

```bash
pip install schemist
```

### From source

Clone the repository, then `cd` into it. Then run:

```bash
pip install -e .
```

## Command-line usage

**schemist**  provides command-line utlities. The list of commands can be checked like so:

```bash
$ schemist --help
usage: schemist [-h] [--version] {clean,convert,featurize,collate,dedup,enumerate,react,split} ...

Tools for cleaning, collating, and augmenting chemical datasets.

options:
  -h, --help            show this help message and exit
  --version, -v         show program's version number and exit

Sub-commands:
  {clean,convert,featurize,collate,dedup,enumerate,react,split}
                        Use these commands to specify the tool you want to use.
    clean               Clean and normalize SMILES column of a table.
    convert             Convert between string representations of chemical structures.
    featurize           Convert between string representations of chemical structures.
    collate             Collect disparate tables or SDF files of libraries into a single table.
    dedup               Deduplicate chemical structures and retain references.
    enumerate           Enumerate bio-chemical structures within length and sequence constraints.
    react               React compounds in silico in indicated columns using a named reaction.
    split               Split table based on chosen algorithm, optionally taking account of chemical structure during splits.
```

Each command is designed to work on large data files in a streaming fashion, so that the entire file is not held in memory at once. One caveat is that the scaffold-based splits are very slow with tables of millions of rows.

All commands (except `collate`) take from the input table a named column with a SMILES, SELFIES, amino-acid sequence, HELM, or InChI representation of compounds.

The tools complete specific tasks which 
can be easily composed into analysis pipelines, because the TSV table output goes to
`stdout` by default so they can be piped from one tool to another.

To get help for a specific command, do

```bash
schemist <command> --help
```

For the Python API, [see below](#python-api).


## Python API

**schemist** can be imported into Python to help make custom analyses.

```python
>>> import schemist as sch
```

## Documentation

Full API documentation is at [ReadTheDocs](https://schemist.readthedocs.org).
