Mass spectrometry query language python implementation
Project description
Mass Spec Query Languge
The Mass Spec Query Langauge (MassQL) is a domain specific language meant to be a succinct way to express a query in a mass spectrometry centric fashion. It is inspired by SQL, but it attempts to bake in assumptions of mass spectrometry to make querying much more natural for mass spectrometry users. Broadly we attempt to design it according to several principles:
- Expressiveness - Capture complex mass spectrometry patterns that the community would like to look for
- Precision - Exactly prescribe how to find data without ambiguity
- Scalable - Easily facilitating the querying of one spectrum all the way up to entire repositories of data
- Relatively Natural - MassQL should be relatively easy to read and write and even use as a way to communicate ideas about mass spectrometry, you know like a language.
Repository Structure
This is the repository to define the language and reference implementation. This contains several parts
- Language Grammar
- Reference Implementation Python API
- Commandline Utility to execute
- NextFlow Workflow For Large Scale Analysis
- ProteoSAFe workflow
- Dash interactive exploration
Developers/Contact
Mingxun Wang is the main creator and developer of MassQL. Contact me for contributing or using it!
Language Specification/Documentation
Checkout specifics for the langauge, examples, and design patterns at the documentation.
Python API
To install massql
pip install massql
Here is the most basic operation you can do
from massql import msql_engine
results_df = msql_engine.process_query(input_query, input_filename)
If you want to push in a data frame you already have, you can specify it
from massql import msql_engine
from massql import msql_fileloading
# Loading Data
ms1_df, ms2_df = msql_fileloading.load_data(input_filename)
# Executing Query
results_df = msql_engine.process_query(input_query, input_filename, ms1_df=ms1_df, ms2_df=ms2_df)
Command Line Tool
You can use the command line tool massql
to query things or put things into a pipeline.
A few examples of what you can do
massql test.mzML "QUERY scaninfo(MS2DATA)" --output_file results.tsv
Web API
API Version
/api
Parsing query into intermediate JSON string
/parse?query=<query string>
Visualization of Query
Visualization image of MS1 spectra
/visualize/ms1
Visualization image of MS2 spectra
/visualize/ms2
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file massql-0.0.10.tar.gz
.
File metadata
- Download URL: massql-0.0.10.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 290834331137f00bebfeae41fc70b9945aa773e197b1dff438d3c6101678bcce |
|
MD5 | f90964423ffb92c37ff23f631845d313 |
|
BLAKE2b-256 | af8ff81b03a3a548a46713baebe31cc03a24fec596a55334bb3cef22829edb72 |
File details
Details for the file massql-0.0.10-py3-none-any.whl
.
File metadata
- Download URL: massql-0.0.10-py3-none-any.whl
- Upload date:
- Size: 40.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83bb537930f522b20f2b8840bbc0694e1d0b835cf1f730b74215ad39ab38fad7 |
|
MD5 | 6bb45ceba1569de01c8a5e995dafd824 |
|
BLAKE2b-256 | 1311199011987c9a6ca129e0fe8c18cf0fc9484ff7dcc29c7a1cfc1b1e9cf99a |