<commit_before>Backend
=======

The backend is written in `Python`, and is where data is processed into the JSON
representation. The API is detailed in :doc:`API`.

Quickstart
----------

A prebuilt script for analysing pairwise combination data in a standard format are
provided in the ``scripts`` folder.  These provide minimum functionality, but the
software is designed for extensibility, so consider writing your own script using
the example datasets inluded in ``backend/synergy_maps/examples/``.

The script can be run using:

.. code-block:: bash

    $ python synergy_map.py example_compounds.smiles example_combinations.csv > map.json

Data structure
^^^^^^^^^^^^^^

Compounds
~~~~~~~~

The example script takes compounds as a smiles file. The smiles should be
provided as a first column, and the identifier as the second column.  The
individual activities are supplied as extra columns.

A sample of a (made up) compound dataset would be:

.. code-block:: bash

    $ head example_compounds.smiles
    SMILES  name    pIC50
    CC  ethane  1.2
    CCC propane 2.1<commit_msg>added install info for backend to docs<commit_after>Backend
=======

The backend is written in `Python`, and is where data is processed into the JSON
representation. The API is detailed in :doc:`API`.

Installation
------------

Change into the backend directory and run the `setup.py` script.

.. code-block:: bash

    $ python setup.py install

Quickstart
----------

A prebuilt script, ``synergy_map.py`` for analysing pairwise combination data
in a standard format is provided in the ``scripts`` folder.  This provides
minimum functionality - the software is designed for extensibility,
so consider writing your own script such as those in the example datasets
inluded in ``backend/synergy_maps/examples/``.

The script can be run using:

.. code-block:: bash

    $ python synergy_map.py example_compounds.smiles example_combinations.csv > map.json

Data structure
^^^^^^^^^^^^^^

Compounds
~~~~~~~~

The example script takes compounds as a smiles file. The smiles should be
provided as a first column, and the identifier as the second column.  The
individual activities are supplied as extra columns.

A sample of a (made up) compound dataset would be:

.. code-block:: bash

    $ head example_compounds.smiles
    SMILES  name    pIC50
    CC  ethane  1.2
    CCC propane 2.1
{'fraction_non_alphanumeric': 0.09156118143459915, 'fraction_numerical': 0.005063291139240506, 'mean_word_length': 3.780241935483871, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6503471', 'n_tokens_mistral': 667, 'n_tokens_neox': 625, 'n_words': 300}