{"id":16466460,"url":"https://github.com/lukasturcani/stk-vis","last_synced_at":"2026-03-03T16:44:30.259Z","repository":{"id":37186390,"uuid":"265633673","full_name":"lukasturcani/stk-vis","owner":"lukasturcani","description":"A cross-platform application for visualization of molecular databases.","archived":false,"fork":false,"pushed_at":"2023-03-05T11:09:52.000Z","size":2409,"stargazers_count":33,"open_issues_count":31,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-03T12:54:54.418Z","etag":null,"topics":["cheminformatics","chemistry","data-visualization","database","molecular-modeling","molecular-structures","molecules","mongodb","visualization"],"latest_commit_sha":null,"homepage":"","language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukasturcani.png","metadata":{"files":{"readme":"readme.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-20T17:07:11.000Z","updated_at":"2024-11-19T02:32:06.000Z","dependencies_parsed_at":"2025-05-28T10:06:44.602Z","dependency_job_id":"1ead3538-9f83-4c21-91d7-3c9f652fb13a","html_url":"https://github.com/lukasturcani/stk-vis","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lukasturcani/stk-vis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasturcani%2Fstk-vis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasturcani%2Fstk-vis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasturcani%2Fstk-vis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasturcani%2Fstk-vis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukasturcani","download_url":"https://codeload.github.com/lukasturcani/stk-vis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasturcani%2Fstk-vis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30052132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T15:26:47.567Z","status":"ssl_error","status_checked_at":"2026-03-03T15:26:17.132Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheminformatics","chemistry","data-visualization","database","molecular-modeling","molecular-structures","molecules","mongodb","visualization"],"created_at":"2024-10-11T11:43:48.716Z","updated_at":"2026-03-03T16:44:30.238Z","avatar_url":"https://github.com/lukasturcani.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":":author: Lukas Turcani\n\n\nstk-vis\n=======\n\n.. figure:: image.png\n\n\nWelcome to ``stk-vis``!\n\nBefore you get started, you might like to watch the demo video\n\n    https://youtu.be/sIXu5W8o53Q\n\n``stk-vis`` is a cross-platform viewer for molecules and molecular\nproperties, specifically targeting cases where you want to browse\nthrough multiple molecules quickly. Its main strength is allowing\nsmoother collaboration between multiple people or between multiple\nresearch groups, but it is also a useful tool for individual users.\n\nSo how does ``stk-vis`` do this? ``stk-vis`` connects to local\nor remote MongoDB molecular databases, which hold the molecules you\nwould like to view, as well as their properties. If you think\nusing a MongoDB database is a bit of a chore, I promise you that\nit is actually trivial, that you don't need to know anything about\ndatabases, and I will show you how to build one!\n\nAssuming that you have your database, or someone has provided one\nfor you, you can connect to it from anywhere. For example, try\ndownloading the `latest release`_ of\n``stk-vis`` for your platform and using the following URL::\n\n    mongodb+srv://stk-vis:example@stk-vis-example.x4bkl.mongodb.net\n\n.. _`latest release`: https://github.com/lukasturcani/stk-vis/releases\n\nHere is a picture of your connection settings:\n\n.. figure:: example-connection.png\n\nThis should connect you to a public database I made. Note that you\ndon't have to change any of the other default values.\n(The connection might be a bit slow because I'm using a free server\nhosted in Europe, but when you use your own database it should be much\nfaster.) You can also make your databases private and only allow access\nto specific users.\n\nTo give an example use case, you can have a group of computational\nscientists depositing molecules and their properties into the database,\nand their  synthetic collaborators can immediately see which molecules\nhave been added and what their properties are, in order to see if they\nwould like to make anything. The synthetic group does not need\nto worry about databases at all, they just need to download ``stk-vis``\nand connect to the URL the computational team provides them with.\nSimilarly, the computational team does not have worry too much about\ndatabases either, as they can deposit molecules and their properties\ninto them with one very simple Python function.\n\nIn fact, any time you are dealing with lots of molecules, or lots\nof molecular files, it is probably a good idea to switch to using a\ndatabase, whether you are working as an individual or not. This keeps\nall your data easy to access and organized.\n\nFeatures\n========\n\n* 3D interactive molecular rendering.\n* 2D molecular projection.\n* Tabulation of any molecular properties deposited into the database.\n* If you have molecules that were constructed from building block\n  molecules, you can see which building blocks were used to make that\n  molecule, and then you can see if those building blocks had building\n  blocks too! You can keep doing this until you run out of building\n  blocks.\n* Sort molecules according to property values to quickly find ones\n  with the best or worst properties.\n* Saving molecular structure files.\n* Sometimes 2D projections are expensive to calculate. As a result,\n  you can toggle the 2D viewer on or off. You can also toggle the 3D\n  viewer, but I suggest you first check if the 2D viewer is the\n  cause of performance problems.\n\nLatest Release\n==============\n\nYou can see the latest release for your platform by clicking on the\nfollowing link:\n\n    https://github.com/lukasturcani/stk-vis/releases\n\nIf you would like to get updates when a new version of ``stk-vis``\nis released, simply click on the ``watch`` button in the top right\ncorner of the GitHub page, and if you only care about new releases,\nselect ``Releases only`` from the dropdown menu.\n\nSetting Up Molecular Databases\n==============================\n\nSo how do you actually get a molecular database? Well, there's a\nPython library called ``stk``, which lets you do just that. But not\nonly that, as ``stk`` lets you easily construct molecules such as\npolymers, organic \u0026 metal-organic frameworks, organic and\nmetal-organic cages, metal complexes, rotaxanes and more!\n\nThe GitHub for ``stk`` is here\n\n    https://github.com/lukasturcani/stk\n\nand the documentation can be found here\n\n    https://stk.readthedocs.io\n\n``stk`` lets you deposit regular or constructed molecules\ninto MongoDB molecular databases. ``stk`` molecules can also be\nconverted to and from ``rdkit`` molecules, if that's\nconvenient for your use-case. ``stk`` also  provides evolutionary\nalgorithms (EAs) for molecular design. This means you can run the EA\nand it will deposit the molecules it discovers into the database\nfor you, and you can use ``stk-vis`` to easily browse the results!\n\nAssuming you have ``stk`` installed and MongoDB running locally,\nbuilding molecular databases  is easy\n\n.. code-block:: python\n\n    import stk\n    import pymongo\n    import rdkit.Chem.AllChem as rdkit\n\n    client = pymongo.MongoClient()\n    db = stk.MoleculeMongoDb(\n        mongo_client=client,\n        # All of the parameters below are optional!\n        database='stk',\n        molecule_collection='molecules',\n        position_matrix_collection='building_block_position_matrices',\n    )\n\n    # Create some molecule. \"BuildingBlock\" is just stk's word for a\n    # plain molecule.\n    molecule1 = stk.BuildingBlock('CCCBr')\n\n    # Place it into the database, this will make the molecule\n    # immediately viewable in stk-vis.\n    db.put(molecule1)\n\n    # Make an stk molecule from an rdkit molecule and deposit it into\n    # the database. Note that the rdkit molecule must have a\n    # position matrix.\n\n    def get_rdkit_molecule(smiles):\n        molecule = rdkit.AddHs(rdkit.MolFromSmiles(smiles))\n        rdkit.EmbedMolecule(molecule, rdkit.ETKDGv2())\n        return molecule\n\n    molecule2 = stk.BuildingBlock.init_from_rdkit_mol(\n        molecule=get_rdkit_molecule('CNCNN'),\n    )\n    db.put(molecule2)\n\n\n``stk`` provides detailed documentation for `stk.MoleculeMongoDb`_.\n\n.. _`stk.MoleculeMongoDb`: https://stk.readthedocs.io/en/latest/stk.databases.mongo_db.molecule.html\n\nLet's say you also want to deposit molecular properties into the\ndatabase so that they are available in ``stk-vis``\n\n.. code-block:: python\n\n    num_atoms_db = stk.ValueMongoDb(client, 'Num Atoms')\n\n    # Place a value associated with the molecule into the database,\n    # this will make it immediately viewable in stk-vis.\n    num_atoms_db.put(molecule1, molecule1.get_num_atoms())\n    num_atoms_db.put(molecule2, molecule2.get_num_atoms())\n\n    # Lets also calculate and store the energy of a molecule with\n    # UFF.\n\n\n    def uff_energy(molecule):\n        rdkit_molecule = molecule.to_rdkit_mol()\n        rdkit.SanitizeMol(rdkit_molecule)\n        ff = rdkit.UFFGetMoleculeForceField(rdkit_molecule)\n        return ff.CalcEnergy()\n\n\n    energy_db = stk.ValueMongoDb(client, 'UFF Energy')\n    energy_db.put(molecule1, uff_energy(molecule1))\n    energy_db.put(molecule2, uff_energy(molecule2))\n\n\nIn general, you can deposit any ``number`` or ``string``, or\n``tuple`` of them\ninto a ``stk.ValueMongoDb``. ``stk`` also has detailed documentation\nfor `stk.ValueMongoDb`_\n\n.. _`stk.ValueMongoDb`: https://stk.readthedocs.io/en/latest/stk.databases.mongo_db.value.html\n\nFinally, let's take a look at depositing constructed molecules.\nThese are molecules ``stk`` can construct from ``BuildingBlock``\nmolecules. There are many different kinds of these molecules, so\ncheck out the documentation of ``stk`` to get a full picture.\nHowever, when it comes to depositing them into a MongoDB, the process\nis always the same.\n\n.. code-block:: python\n\n    # Create a database for depositing constructed molecules.\n    constructed_db = stk.ConstructedMoleculeMongoDb(\n        mongo_client=client,\n        # All of the parameters below are optional!\n        database='stk',\n        molecule_collection='molecules',\n        constructed_molecule_collection='constructed_molecules',\n        position_matrix_collection='position_matrices',\n        building_block_position_matrix_collection='building_block_position_matrices',\n    )\n\n    # Create a constructed molecule, in this case a polymer.\n    polymer = stk.ConstructedMolecule(\n        topology_graph=stk.polymer.Linear(\n            building_blocks=(\n                stk.BuildingBlock('BrC=CBr', [stk.BromoFactory()]),\n                stk.BuildingBlock('BrCNCBr', [stk.BromoFactory()]),\n            ),\n            repeating_unit='AB',\n            num_repeating_units=2,\n        ),\n    )\n\n    # Deposit into the database.\n    constructed_db.put(polymer)\n\n    # You can deposit values same as before.\n    num_atoms_db.put(polymer, polymer.get_num_atoms())\n    energy_db.put(polymer, uff_energy(polymer))\n\nThe reason ``stk.ConstructedMoleculeMongoDb`` is used here, is that\nit will automatically deposit the building blocks of ``polymer`` into\nthe database as well. This means that in ``stk-vis``, we can explicitly\nsearch for the building blocks of ``polymer``. As before, ``stk`` has\ndetailed documentation for `stk.ConstructedMoleculeMongoDb`_.\n\n.. _`stk.ConstructedMoleculeMongoDb`: https://stk.readthedocs.io/en/latest/stk.databases.mongo_db.constructed_molecule.html\n\nTo get ``stk`` you need to run::\n\n    $ pip install stk\n    $ conda install -c conda-forge rdkit\n\nFinally, you need to decide how to host your databases. You can\n`install MongoDB locally on your computer`_, or you can use\n`Mongo Atlas`_ to put your database in the cloud. This part might be a\npain, but it shouldn't be too difficult either. Once this is\ndone, depositing molecules and molecular properties into the database\nwill be  super easy with ``stk``, and then you and your collaborators\ncan then examine them with ``stk-vis``!\n\n.. _`install MongoDB locally on your computer`: https://docs.mongodb.com/manual/installation/\n.. _`Mongo Atlas`: https://www.mongodb.com/cloud/atlas\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasturcani%2Fstk-vis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukasturcani%2Fstk-vis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasturcani%2Fstk-vis/lists"}