{"id":23280264,"url":"https://github.com/moldyn/mosaic","last_synced_at":"2026-03-06T01:03:06.267Z","repository":{"id":37587068,"uuid":"389866266","full_name":"moldyn/MoSAIC","owner":"moldyn","description":"Correlation-based feature selection of Molecular Dynamics simulations","archived":false,"fork":false,"pushed_at":"2024-11-19T05:26:16.000Z","size":45228,"stargazers_count":26,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-17T03:23:29.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://moldyn.github.io/MoSAIC/","language":"Python","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/moldyn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-27T06:02:08.000Z","updated_at":"2024-12-11T22:26:58.000Z","dependencies_parsed_at":"2024-01-02T18:45:55.339Z","dependency_job_id":null,"html_url":"https://github.com/moldyn/MoSAIC","commit_stats":{"total_commits":369,"total_committers":5,"mean_commits":73.8,"dds":0.23577235772357719,"last_synced_commit":"b2811e08613f38f5b341e0f3521d93e619568cd9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldyn%2FMoSAIC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldyn%2FMoSAIC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldyn%2FMoSAIC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldyn%2FMoSAIC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moldyn","download_url":"https://codeload.github.com/moldyn/MoSAIC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230515628,"owners_count":18238284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-19T23:31:20.309Z","updated_at":"2026-03-06T01:03:06.254Z","avatar_url":"https://github.com/moldyn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg class=\"darkmode\" style=\"width: 400px;\" src=\"docs/logo_large_dark.svg#gh-dark-mode-only\" /\u003e\n  \u003cimg class=\"lightmode\" style=\"width: 400px;\" src=\"docs/logo_large_light.svg#gh-light-mode-only\" /\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/wemake-services/wemake-python-styleguide\" alt=\"wemake-python-styleguide\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/style-wemake-000000.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://beartype.rtfd.io\" alt=\"bear-ified\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/mosaic-clustering\" alt=\"PyPI\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/mosaic-clustering\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://anaconda.org/conda-forge/mosaic-clustering\" alt=\"conda version\"\u003e\n\t\u003cimg src=\"https://img.shields.io/conda/vn/conda-forge/mosaic-clustering\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://pepy.tech/project/mosaic-clustering\" alt=\"Downloads\"\u003e\n        \u003cimg src=\"https://static.pepy.tech/badge/mosaic-clustering\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/moldyn/MoSAIC/actions/workflows/pytest.yml\" alt=\"GitHub Workflow Status\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/moldyn/MoSAIC/pytest.yml?branch=main\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/moldyn/MoSAIC\" alt=\"Code coverage\"\u003e\n        \u003cimg src=\"https://codecov.io/gh/moldyn/MoSAIC/branch/main/graph/badge.svg?token=KNWDAUXIGI\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/moldyn/MoSAIC/actions/workflows/codeql.yml\" alt=\"CodeQL\"\u003e\n        \u003cimg src=\"https://github.com/moldyn/MoSAIC/actions/workflows/codeql.yml/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://img.shields.io/pypi/pyversions/mosaic-clustering\" alt=\"PyPI - Python Version\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/pyversions/mosaic-clustering\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://moldyn.github.io/MoSAIC\" alt=\"Docs\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/MkDocs-Documentation-brightgreen\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://moldyn.github.io/MoSAIC/tutorial/t4l_tutorial_github/\" alt=\"Tutorials\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Tutorials-Notebooks-brightgreen\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://doi.org/10.1021/acs.jctc.2c00337\" alt=\"doi\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/doi-10.1021%2Facs.jctc.2c00337-blue\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://arxiv.org/abs/2204.02770\" alt=\"arXiv\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/arXiv-2204.02770-red\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/moldyn/MoSAIC/blob/main/LICENSE\" alt=\"License\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/moldyn/MoSAIC\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://moldyn.github.io/MoSAIC\"\u003eDocs\u003c/a\u003e •\n    \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n    \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n    \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n    \u003ca href=\"https://moldyn.github.io/MoSAIC/faq\"\u003eFAQ\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# Molecular Systems Automated Identification of Cooperativity\nMoSAIC is an unsupervised method for correlation analysis which automatically detects the collective motion in MD simulation data, while simultaneously identifying uncorrelated coordinates as noise.\nHence, it can be used as a feature selection scheme for Markov state modeling or simply to obtain a detailed picture of the key coordinates driving a biomolecular process.  It is based on the Leiden community detection algorithm which is used to bring a correlation matrix in a block-diagonal form.\n\nThe method was published in:\n\u003e **Correlation-Based Feature Selection to Identify Functional Dynamics in Proteins**  \n\u003e G. Diez, D. Nagel, and G. Stock,  \n\u003e *J. Chem. Theory Comput.* **2022** 18 (8), 5079-5088,  \n\u003e doi: [10.1021/acs.jctc.2c00337](https://pubs.acs.org/doi/10.1021/acs.jctc.2c00337)\n\nIf you use this software package, please cite the above mentioned paper.\n\n## Features\n- Intuitive usage via [module](#module---inside-a-python-script) and via [CI](#ci---usage-directly-from-the-command-line)\n- Sklearn-style API for fast integration into your Python workflow\n- No magic, only a  single parameter which can be optimized via cross-validation\n- Extensive [documentation](https://moldyn.github.io/MoSAIC) and detailed discussion in publication\n- Step by step [tutorial](https://moldyn.github.io/MoSAIC/tutorial/t4l_tutorial_github/) to follow\n\n\n## Installation\nThe package is called `mosaic-clustering` and is available via [PyPI](https://pypi.org/project/mosaic-clustering) or [conda](https://anaconda.org/conda-forge/mosaic-clustering). To install it, simply call:\n```bash\npython3 -m pip install --upgrade mosaic-clustering\n```\nor\n```\nconda install -c conda-forge mosaic-clustering\n```\n\nor for the latest dev version\n```bash\n# via ssh key\npython3 -m pip install git+ssh://git@github.com/moldyn/MoSAIC.git\n\n# or via password-based login\npython3 -m pip install git+https://github.com/moldyn/MoSAIC.git\n```\n\nIn case one wants to use the deprecated `UMAPSimilarity` or the module `mosaic umap` one needs to specify the `extras_require='umap'`, so\n```bash\npython3 -m pip install --upgrade moldyn-mosaic[umap]\n```\n\n### Shell Completion\nUsing the `bash`, `zsh` or `fish` shell click provides an easy way to provide shell completion, checkout the [docs](https://click.palletsprojects.com/en/8.0.x/shell-completion).\nIn the case of bash you need to add following line to your `~/.bashrc`\n```bash\neval \"$(_MOSAIC_COMPLETE=bash_source mosaic)\"\n```\n\n## Usage\nIn general one can call the module directly by its entry point `$ MoSAIC` or by calling the module `$ python -m mosaic`. The latter method is preferred to ensure using the desired python environment. For enabling the shell completion, the entry point needs to be used.\n\n### CI - Usage Directly from the Command Line\nThe module brings a rich CI using [click](https://click.palletsprojects.com). Each module and submodule contains a detailed help, which can be accessed by\n```bash\n$ python -m mosaic\nUsage: python -m mosaic [OPTIONS] COMMAND [ARGS]...\n\n  MoSAIC motion v0.5.0\n\n  Molecular systems automated identification of collective motion, is\n  a correlation based feature selection framework for MD data.\n  Copyright (c) 2021-2025, Georg Diez and Daniel Nagel\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  clustering  Clustering similarity matrix of coordinates.\n  similarity  Creating similarity matrix of coordinates.\n  tui         Open Textual TUI for interactive usage.\n```\nFor more details on the submodule one needs to specify one of the two\ncommands, or by opening the terminal user interface (tui).\n\nA simple workflow example for clustering the input file `input_file` using\ncorrelation and Leiden with CPM and the default resolution parameter:\n```bash\n# creating correlation matrix\n$ python -m mosaic similarity -i input_file -o output_similarity --metric correlation -v\n\nMoSAIC SIMILARITY\n~~~ Initialize similarity class\n~~~ Load file input_file\n~~~ Fit input\n~~~ Store similarity matrix in output_similarity\n\n# clustering with CPM and default resolution parameter\n# the latter needs to be fine-tuned to each matrix\n$ python -m mosaic clustering -i output_similarity -o output_clustering --plot -v\n\nMoSAIC CLUSTERING\n~~~ Initialize clustering class\n~~~ Load file output_similarity\n~~~ Fit input\n~~~ Store output\n~~~ Plot matrix\n```\nThis will generate the similarity matrix stored in `output_similarity`,\nthe plotted result in `output_clustering.matrix.pdf`, the raw data of\nthe matrix in `output_clustering.matrix` and a file containing in each\nrow the indices of a cluster.\n\n### Module - Inside a Python Script\n```python\nimport mosaic\n\n# Load file\n# X is np.ndarray of shape (n_samples, n_features)\n\nsim = mosaic.Similarity(\n    metric='correlation',  # or 'NMI', 'GY', 'JSD'\n)\nsim.fit(X)\n\n\n# Cluster matrix\nclust = mosaic.Clustering(\n    mode='CPM',  # or 'modularity', 'linkage'\n)\nclust.fit(sim.matrix_)\n\nclusters = clust.clusters_\nclusterd_X = clust.matrix_\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoldyn%2Fmosaic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoldyn%2Fmosaic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoldyn%2Fmosaic/lists"}