diff --git a/docs/compchem/index.rst b/docs/compchem/index.rst index 1600a7c..4585557 100644 --- a/docs/compchem/index.rst +++ b/docs/compchem/index.rst @@ -24,4 +24,6 @@ construct and run containerized computational chemistry software. psi4v180-mamba141-ase322-jupyter psi4-ase_example pyscf221-mamba141 - pyscf_example \ No newline at end of file + pyscf_example + rdkit-postgres162 + rdkitpostgres-example \ No newline at end of file diff --git a/docs/compchem/rdkit-postgres162.rst b/docs/compchem/rdkit-postgres162.rst new file mode 100644 index 0000000..cafcc4e --- /dev/null +++ b/docs/compchem/rdkit-postgres162.rst @@ -0,0 +1,76 @@ +.. _rdkit_postgres162: + +********************************************************* +{{ rdkit_postgres162.hub_specifications[0]["Source"].split("/")[-1] }} +********************************************************* + +{% set title = rdkit_postgres162.get("name") %} + +{{title}} +========================================================= + +{% block content %} + {{ rdkit_postgres162.description }} +{% endblock content %} + +Source Specifications +===================== + +{% block specifications %} + {% for dc in rdkit_postgres162.source_specifications %} + {% for key, value in dc.items() %} + * **{{ key }}**: {{ value }} + {% endfor %} + {% endfor %} +{% endblock specifications %} + +MolSSI Container Hub Specifications +=================================== + +{% block hub_specifications %} + {% for dc in rdkit_postgres162.hub_specifications %} + {% for key, value in dc.items() %} + * **{{ key }}**: {{ value }} + {% endfor %} + {% endfor %} +{% endblock hub_specifications %} + +* **Image pull command**: + + .. code-block:: bash + + {{ rdkit_postgres162.docker_pull_command }} + +* **Container run command**: + + .. code-block:: bash + + {{ rdkit_postgres162.docker_run_command }} + +{% block note %} +{% if rdkit_postgres162.note != "" %} +.. note:: + + {{ rdkit_postgres162.note }} +{% endif %} +{% endblock note %} + +Image Specifications +==================== + +{% block image_specifications %} + {% for dc in rdkit_postgres162.image_specifications %} + {% for key, value in dc.items() %} + {% if dc[key] is string or dc[key] == "" %} + * **{{ key }}**: {{ value }} + {% else %} + * **{{ key }}**: + {% for key2 in dc[key] %} + {% for key3, val3 in key2.items() %} + + *{{ key3 }}*: {{ val3 }} + {% endfor %} + {% endfor %} + {% endif %} + {% endfor %} + {% endfor %} +{% endblock image_specifications %} \ No newline at end of file diff --git a/docs/compchem/rdkitpostgres-example.rst b/docs/compchem/rdkitpostgres-example.rst new file mode 100644 index 0000000..f442fff --- /dev/null +++ b/docs/compchem/rdkitpostgres-example.rst @@ -0,0 +1,82 @@ +.. _rdkitpostgres_example: + +******************************** +RDKit Postgres Cartridge Example +******************************** + +This example demonstrates how to use the RDKit cartridge with a PostgreSQL database. +When using the RDKit Postgres container, you can launch the container then access the database server using the `psql` command line tool +from the host machine or from within the container. + +Launching the RDKit Postgres Container +-------------------------------------- + +You can launch the server using the following command. +Note that you should replace `mysecretpassword` with a password of your choice. + +.. code-block:: bash + + docker run --name rdkitpostgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d molssi/rdkitpostgres-postgres162:latest + + +This will start the server. +You can access it from within the container using the following command. + +.. code-block:: bash + + docker exec -it rdkitpostgres psql -U postgres + +Because the command set up port mapping (`-p 5432:5432`), you can also access the server from the host machine using the following command. +Note that you will need to have the `psql` command line tool installed on your host machine and enter the password you specified when launching the container. + +.. code-block:: bash + + psql -h localhost -U postgres -d postgres + + +Loading Data +------------ + +For a more detailed tutorial, please refer to the `RDKit PostgreSQL cartridge documentation `_ + +The following example demonstrates how to load data into the database. + +First, make sure the RDKit extension is loaded: + +.. code-block:: sql + + CREATE EXTENSION IF NOT EXISTS rdkit; + + +Next, create a table called `mols` with a `mol` column. + +.. code-block:: sql + + CREATE TABLE mols (id serial primary key, mol mol); + + +Next, load a few molecules into the database using SMILES strings: + +.. code-block:: sql + + INSERT INTO mols (mol) VALUES ('c1ccccc1'); + INSERT INTO mols (mol) VALUES ('CCO'); + INSERT INTO mols (mol) VALUES ('CC(=O)O'); + INSERT INTO mols (mol) VALUES ('C(=O)CC'); + + +Querying Data +-------------- + +You can now perform queries like substring searches, similarity searches, and other analysis associated with RDKit. +For example, to find all molecules that contain a carbonyl group, you can use the following query. + +.. code-block:: sql + + SELECT * FROM mols WHERE mol @> 'C(=O)'; + + + + + + diff --git a/molssi_hub/compchem/rdkit-postgres162/Dockerfile b/molssi_hub/compchem/rdkit-postgres162/Dockerfile new file mode 100644 index 0000000..23c3a5f --- /dev/null +++ b/molssi_hub/compchem/rdkit-postgres162/Dockerfile @@ -0,0 +1,8 @@ +FROM postgres:16.2 + +LABEL maintainer="Jessica A. Nash, \ + Molecular Sciences Software Institute" + +RUN apt update && \ + apt install -y --no-install-recommends postgresql-16-rdkit && \ + rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/molssi_hub/compchem/rdkit-postgres162/metadata.json b/molssi_hub/compchem/rdkit-postgres162/metadata.json new file mode 100644 index 0000000..6647cfe --- /dev/null +++ b/molssi_hub/compchem/rdkit-postgres162/metadata.json @@ -0,0 +1,46 @@ +{ + "name": "RDKit Postgres Cartridge", + "description": "RDKit PostgreSQL cartridge is a PostgreSQL extension that provides chemical structure handling functionality to the PostgreSQL database. It is based on the RDKit cheminformatics library.", + "source_specifications": [ + { + "Developers": "https://github.com/rdkit/rdkit/graphs/contributors", + "Source": "https://github.com/rdkit/rdkit", + "Documentation": "https://www.rdkit.org/docs/Cartridge.html" + } + ], + "hub_specifications": [ + { + "Repository": "https://hub.docker.com/r/molssi/rdkit-postgres162", + "Tags": "https://hub.docker.com/r/molssi/rdkit-postgres162/tags", + "Source":"https://github.com/MolSSI/molssi-hub/tree/main/molssi_hub/compchem/rdkit-postgres162", + "Recipe":"https://github.com/MolSSI/molssi-hub/blob/main/molssi_hub/compchem/rdkit-postgres162/Dockerfile" + } + ], + "docker_pull_command": "docker pull molssi/rdkitpostgres-postgres162:latest", + "docker_run_command": "docker run --name rdkitpostgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d molssi/rdkitpostgres-postgres162:latest", + "note": "See the full documentation for the base PostgreSQL image for alternative environment variables and run commands - https://hub.docker.com/_/postgres", + "tip": "See the full documentation for the base PostgreSQL image for alternative environment variables and run commands - https://hub.docker.com/_/postgres", + "image_specifications":[ + { + "OS/Arch": "debian:bookworm-slim", + "Users (UID)": "root (0)", + "Groups (GID)": "root (0)", + "Environment variables": [ + { + "POSTGRES_PASSWORD": "", + "POSTGRES_USER": "postgres", + "POSTGRES_DB": "postgres" + + } + ], + "Volumes": "None", + "Network": "None", + "Extras": [ + { + "Added directories": "None", + "Important packages installed": "" + } + ] + } + ] +}