Metamist is a database designed for storing de-identified -omics metadata.
The project provides an interface to interact with the -omics database via the Python client as well as the GraphQL + HTTP APIs.
- Project-Based Resource Organization: Every resource in Metamist is associated with a specific project.
- Access Control: Access to resources is controlled through a basic permissions system. Users can have one of the following permissions for a project.
readerpermission allows viewing of all metadata within a projectcontributorpermission allows creating comments on metadata within a projectwriterpermission allows writing of all metadata within a project.
It comprises three key components:
-
System-Versioned MariaDB Database: A robust database system for managing -omics metadata.
-
Python Web API: This component is responsible for:
- Managing permissions.
- Storing frequently used queries.
- Providing a GraphQL/HTTP API for efficient querying of the database.
-
Installable Python Library: Wraps the Python Web API using the OpenAPI generator, facilitating easier interaction with the system.
-
Web client UI A react application that allows viewing the metadata for projects.
There are a few different ways that you may need to interact with metamist.
If you only need to interact with production metamist data, then you do not need to clone this repository or have a working local installation of metamist. You can install the python client from pypi:
pip install metamistAnd use it in your python scripts:
from metamist.graphql import gql, query
def main():
my_query = gql("""
{
myProjects {
id
name
}
}
""")
result = query(my_query)
print(result)
if __name__ == "__main__":
main()- GraphiQL UI, for exploration of the GraphQL API
- Python client documentation
- Swagger HTTP API documentation
When writing more complex scripts it is a good idea to test them against a local version of metamist. To do this, follow the local installation instructions to set up the API. Setting up the web client is optional and only necessary if you need to view your data in the UI.
Once you have the API set up locally, set the SM_ENVIRONMENT variable to local
export SM_ENVIRONMENT=localThis will tell the metamist python client to point to your local metamist install.
If you are working on developing features, fixing bugs or want to contribute to metamist in other ways then you will need a local installation of metamist. Follow the local installation instructions.
As of Jan 15, 2024 this schema should reflect the data structure on the tables:
You can also find this at DbDiagram.
The codebase contains the following modules worth noting:
models-> General data models + enumsdb/python/tables-> Interaction with MariaDB / BigQuerydb/python/layers-> Logicapi/graphql: GraphQL API schema and modelsapi/routes: HTTP + OpenAPI
And metamist maintains two clients:
web-> React app that consumes a generated Typescript API + GraphQLmetamist-> autogenerated Python API
This project is licensed under the MIT License. You can see it in the LICENSE file in the root directory of this source tree.
