From 1726b582f55e66aa1a396c2546d1eea064d45423 Mon Sep 17 00:00:00 2001 From: acquayefrank Date: Mon, 25 Aug 2025 12:21:39 +0000 Subject: [PATCH 1/4] updated documentation --- MSMetaEnhancer/libs/utils/ConverterBuilder.py | 1 + README.md | 9 +- docs/source/CHANGELOG.md | 177 ++++++++++++++++++ docs/source/CONTRIBUTING.md | 37 ++++ docs/source/readme.md | 76 ++++++++ 5 files changed, 296 insertions(+), 4 deletions(-) create mode 100644 docs/source/CHANGELOG.md create mode 100644 docs/source/CONTRIBUTING.md create mode 100644 docs/source/readme.md diff --git a/MSMetaEnhancer/libs/utils/ConverterBuilder.py b/MSMetaEnhancer/libs/utils/ConverterBuilder.py index 072eb1c..9f28d5f 100644 --- a/MSMetaEnhancer/libs/utils/ConverterBuilder.py +++ b/MSMetaEnhancer/libs/utils/ConverterBuilder.py @@ -15,6 +15,7 @@ def validate_converters(converters): for converter in converters: try: eval(converter) + except NameError: raise UnknownConverter(f'Converter {converter} unknown.') diff --git a/README.md b/README.md index 23f6e6b..0095e5f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ The app uses asynchronous implementation of annotation process allowing for opti If you use MSMetaEnhancer in your work, please cite the following publication: Troják et al., (2022). MSMetaEnhancer: A Python package for mass spectra metadata annotation. Journal of Open Source Software, 7(79), 4494, https://doi.org/10.21105/joss.04494 + ### Usage ```python @@ -23,7 +24,7 @@ from MSMetaEnhancer import Application app = Application() # import your .msp file -app.load_spectra('tests/test_data/sample.msp', file_format='msp') +app.load_data('sample.msp', file_format='msp') # curate given metadata (e.g. fix CAS numbers) app.curate_metadata() @@ -38,8 +39,8 @@ jobs = [('name', 'inchi', 'IDSM'), ('inchi', 'formula', 'IDSM'), ('inchi', 'inch # run asynchronous annotations of spectra data asyncio.run(app.annotate_spectra(services, jobs)) -# export .msp file -app.save_spectra('tests/test_data/sample_out.msp', file_format='msp') +# export .msp file +app.save_data('sample_out.msp', file_format='msp') ``` ### Installation @@ -66,7 +67,7 @@ Create your development environment using the provided [script](conda/environmen #### Contributing -We appreciate contributions - feel free to open an issue on our repository, create your own fork, work on the problem and post a PR. +We appreciate contributions - feel free to open an issue on our repository, create your own fork, work on the problem and post a PR. Please add your contributions to the [changelog](CHANGELOG.md) and to adhere to the [versioning](https://semver.org/spec/v2.0.0.html). For more information see [here](CONTRIBUTING.md). diff --git a/docs/source/CHANGELOG.md b/docs/source/CHANGELOG.md new file mode 100644 index 0000000..de9d245 --- /dev/null +++ b/docs/source/CHANGELOG.md @@ -0,0 +1,177 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.5.0] - 2025-06-09 + +### Added + +- Added `smiles_to_formula` and `inchi_to_formula` conversions to the RDKit converter. +- Added unit tests for `smiles_to_formula`. +- Added support for tabular files, which are treated like tsv files. + +### Changed + +- Updated `matchms` dependency to `^0.30.0` in `pyproject.toml`. + +### Fixed + +- Minor documentation and test improvements. + +## [0.4.1] - 2025-05-19 + +### Changed + +- updated dependencies [#157](https://github.com/RECETOX/MSMetaEnhancer/pull/157) + +## [0.4.0] - 2024-03-13 + +### Changed + +- Update IDSM SPARQL queries to achieve better performance by @galgonek in [#152](https://github.com/RECETOX/MSMetaEnhancer/pull/152) +- Switched to poetry and added additional converters by @hechth in [#155](https://github.com/RECETOX/MSMetaEnhancer/pull/155) + +## [0.3.0] - 2023-05-12 + +### Added + +- general class Data for input handling [#141](https://github.com/RECETOX/MSMetaEnhancer/pull/141) +- DataFrame class to read and handle tabular metadata input [#141](https://github.com/RECETOX/MSMetaEnhancer/pull/141) +- implementation of blocking time in PubChem [#145](https://github.com/RECETOX/MSMetaEnhancer/pull/145) + +### Changed + +- Spectra class is an instantiation of Data class [#141](https://github.com/RECETOX/MSMetaEnhancer/pull/141) +- fix throttling freezing the app [#144](https://github.com/RECETOX/MSMetaEnhancer/pull/144) + +### Removed + +- retired NLM (ChemIDplus) service [#140](https://github.com/RECETOX/MSMetaEnhancer/pull/140) + +## [0.2.5] - 2022-10-15 + +### Added + +- added Pytest config file `pytest.ini` and set it to automatically detect asynchronous tests [#124](https://github.com/RECETOX/MSMetaEnhancer/pull/124) + +### Changed + +- fixed Circuit Breaker implementation to be compatible with Python 3.9 [#124](https://github.com/RECETOX/MSMetaEnhancer/pull/124) + +### Removed + +## [0.2.4] - 2022-08-30 + +### Changed + +- escaping of single quotes in IDSM arguments [#102](https://github.com/RECETOX/MSMetaEnhancer/issues/102) +- unified environment and packaging management [#115](https://github.com/RECETOX/MSMetaEnhancer/issues/115) +- apply circuit breaker pattern in WebConverter [#113](https://github.com/RECETOX/MSMetaEnhancer/issues/113) + +### Removed + +- removed test case from curator which fails in matchms > 0.14 [#112](https://github.com/RECETOX/MSMetaEnhancer/issues/112) + +## [0.2.3] - 2022-05-12 + +### Added + +- KEGG ID conversions support to BridgeDb service [#101](https://github.com/RECETOX/MSMetaEnhancer/issues/101) + +### Changed + +- double quotes to single quotes in IDSM [#102](https://github.com/RECETOX/MSMetaEnhancer/issues/102) + +## [0.2.2] - 2022-04-27 + +### Added + +- introduced `error` level into logging [#95](https://github.com/RECETOX/MSMetaEnhancer/issues/95) +- logging of unknown errors in Annotator [#90](https://github.com/RECETOX/MSMetaEnhancer/issues/90) + +### Changed + +- the log file is now written continuously during annotation and the metrics added at the end of the file [#92](https://github.com/RECETOX/MSMetaEnhancer/issues/92) + +### Removed + +## [0.2.1] - 2022-04-05 + +### Added + +- try-finally block to ensure the Monitor thread is always terminated [#86](https://github.com/RECETOX/MSMetaEnhancer/issues/86) + +### Changed + +- improved parsing of PubChem responses [#84](https://github.com/RECETOX/MSMetaEnhancer/issues/84) + +## [0.2.0] - 2022-03-19 + +### Added + +- BridgeDb supporting conversion of several database IDs [#76](https://github.com/RECETOX/MSMetaEnhancer/issues/76) +- ComputeConverter class for conversions based on computation instead of querying [#75](https://github.com/RECETOX/MSMetaEnhancer/issues/75) +- ConverterBuilder which validates and initialises converters [#75](https://github.com/RECETOX/MSMetaEnhancer/issues/75) +- reintroduced PubChem service using direct REST web interface [#76](https://github.com/RECETOX/MSMetaEnhancer/issues/76) + +### Changed + +- reorganised Converter class to support computation approach [#75](https://github.com/RECETOX/MSMetaEnhancer/issues/75) +- renamed PubChem service to IDSM to avoid confusion [#73](https://github.com/RECETOX/MSMetaEnhancer/issues/73) + +## [0.1.3] - 2022-02-15 + +### Added + +- multidict package requirement +- tracking of attributes validation in log [#68](https://github.com/RECETOX/MSMetaEnhancer/issues/68) +- CIR: Inchi -> SMILES conversion [#66](https://github.com/RECETOX/MSMetaEnhancer/issues/66) + +### Changed + +- passed `multidict` instead of `frozendict` to `aiohttp.ClientSession.post` (required by package) +- take only first result when there are multiple hits in CIR conversions [#69](https://github.com/RECETOX/MSMetaEnhancer/issues/69) +- support `ISOMERIC_SMILES` and `CANONICAL_SMILES` in PubChem instead of generic `SMILES` [#67](https://github.com/RECETOX/MSMetaEnhancer/issues/67) + +## [0.1.2] - 2022-01-06 + +### Added + +- `generate_options()` function in `Galaxy` submodule to create all possible conversions supported by the tool in a format suitable for the galaxy tool form [#58](https://github.com/RECETOX/MSMetaEnhancer/pull/58) +- monitoring of services status during annotation process [#56](https://github.com/RECETOX/MSMetaEnhancer/issues/56) +- validation of obtained metadata [#59](https://github.com/RECETOX/MSMetaEnhancer/issues/59) + +### Changed + +- structure and contents of documentation [#51](https://github.com/RECETOX/MSMetaEnhancer/pull/51) + +### Removed + +- tests checking contents and consistency of individual services [#54](https://github.com/RECETOX/MSMetaEnhancer/pull/61) + +## [0.1.1] - 2021-12-07 + +### Added + +- `get_conversion_functions` on the level of `Converter` + +### Changed + +- computation of all available jobs in `Application` + +### Removed + +- `get_all_conversions` on the level of `Annotator` + +## [0.1.0] - 2021-11-16 + +### Added + +- Added conda environment files [#35](https://github.com/RECETOX/MSMetaEnhancer/pull/35) +- Usage of IDSM SPARQL for PubChem service [#25](https://github.com/RECETOX/MSMetaEnhancer/pull/25) +- Added logging and quantitative progress of annotation process [#22](https://github.com/RECETOX/MSMetaEnhancer/pull/22) +- Generalised requests to obtain multiple values at once [#20](https://github.com/RECETOX/MSMetaEnhancer/pull/20) +- Added asynchronous requests [#15](https://github.com/RECETOX/MSMetaEnhancer/pull/15) diff --git a/docs/source/CONTRIBUTING.md b/docs/source/CONTRIBUTING.md new file mode 100644 index 0000000..a742372 --- /dev/null +++ b/docs/source/CONTRIBUTING.md @@ -0,0 +1,37 @@ +# Contributing + +We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). + +A contribution can be one of the following cases: + +1. you have a question; +1. you think you may have found a bug (including unexpected behavior); +1. you want to make some kind of change to the code base (e.g. to fix a bug, to add a new feature, to update documentation); + +The sections below outline the steps in each case. + +## You have a question + +1. use the search functionality in the issues to see if someone already filed the same issue; +1. if your issue search did not yield any relevant results, make a new issue; + +## You think you may have found a bug + +1. use the search functionality in the issues to see if someone already filed the same issue; +1. if your issue search did not yield any relevant results, make a new issue, making sure to provide enough information to the rest of the community to understand the cause and context of the problem. Depending on the issue, you may want to include: + - some identifying information (name and version number) for dependencies you're using; + - information about the operating system; + +## You want to make some kind of change to the code base + +In case you feel like you've made a valuable contribution, but you don't know how to write or run tests for it, or how to generate the documentation: don't let this discourage you from making the pull request; we can help you! Just go ahead and submit the pull request, but keep in mind that you might be asked to append additional commits to your pull request. + +1. (**important**) announce your plan to the rest of the community *before you start working*. This announcement should be in the form of a (new) issue; +1. (**important**) wait until some kind of consensus is reached about your idea being a good idea; +1. if needed, fork the repository to your own Github profile and create your own feature branch off of the latest master commit. While working on your feature branch, make sure to stay up to date with the main branch by pulling in changes, possibly from the 'upstream' repository (follow the instructions [here](https://help.github.com/articles/configuring-a-remote-for-a-fork/) and [here](https://help.github.com/articles/syncing-a-fork/)); +1. make sure the existing tests still work by running ``pytest``; +1. add your own tests (if necessary); +1. update or expand the documentation; +1. update the [CHANGELOG](CHANGELOG.md) file with change; +1. [push](http://rogerdudler.github.io/git-guide/>) your feature branch to (your fork of) this repository on GitHub; +1. create the pull request, e.g. following the instructions [here](https://help.github.com/articles/creating-a-pull-request/). diff --git a/docs/source/readme.md b/docs/source/readme.md new file mode 100644 index 0000000..0095e5f --- /dev/null +++ b/docs/source/readme.md @@ -0,0 +1,76 @@ +## MSMetaEnhancer + +[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/msmetaenhancer/README.html) +[![docs](https://readthedocs.org/projects/msmetaenhancer/badge/?version=latest)](https://msmetaenhancer.readthedocs.io/en/latest/) +[![Conda](https://img.shields.io/conda/v/bioconda/msmetaenhancer)](https://anaconda.org/bioconda/msmetaenhancer) +[![PyPI - Python Version](https://img.shields.io/pypi/v/msmetaenhancer)](https://pypi.org/project/msmetaenhancer/) +[![DOI](https://joss.theoj.org/papers/10.21105/joss.04494/status.svg)](https://doi.org/10.21105/joss.04494) + +**MSMetaEnhancer** is a tool used for `.msp` files annotation. +It adds metadata like SMILES, InChI, and CAS number fetched from the following services: [CIR](https://cactus.nci.nih.gov/chemical/structure_documentation), [CTS](https://cts.fiehnlab.ucdavis.edu/), [PubChem](https://pubchem.ncbi.nlm.nih.gov/), [IDSM](https://idsm.elixir-czech.cz/), and [BridgeDb](https://bridgedb.github.io/). +The app uses asynchronous implementation of annotation process allowing for optimal fetching speed. + +If you use MSMetaEnhancer in your work, please cite the following publication: + +Troják et al., (2022). MSMetaEnhancer: A Python package for mass spectra metadata annotation. Journal of Open Source Software, 7(79), 4494, https://doi.org/10.21105/joss.04494 + +### Usage + +```python +import asyncio + +from MSMetaEnhancer import Application + +app = Application() + +# import your .msp file +app.load_data('sample.msp', file_format='msp') + +# curate given metadata (e.g. fix CAS numbers) +app.curate_metadata() + +# specify requested services (these are supported) +services = ['CTS', 'CIR', 'IDSM', 'PubChem', 'BridgeDb', 'RDKit'] + +# specify requested jobs +jobs = [('name', 'inchi', 'IDSM'), ('inchi', 'formula', 'IDSM'), ('inchi', 'inchikey', 'IDSM'), + ('inchi', 'iupac_name', 'IDSM'), ('inchi', 'canonical_smiles', 'IDSM')] + +# run asynchronous annotations of spectra data +asyncio.run(app.annotate_spectra(services, jobs)) + +# export .msp file +app.save_data('sample_out.msp', file_format='msp') +``` + +### Installation + +Prerequisites: + +- Python 3.9+ +- Anaconda + +Install `MSMetaEnhancer` from Bioconda with: + +``` +# install MSMetaEnhancer in a new virtual environment to avoid dependency clashes +conda create --name MSMetaEnhancer python=3.9 +conda activate MSMetaEnhancer +conda install --channel bioconda --channel conda-forge MSMetaEnhancer +``` + +### Developer Documentation + +#### Setup + +Create your development environment using the provided [script](conda/environment-dev.yml) via conda to install all required dependencies. + +#### Contributing + +We appreciate contributions - feel free to open an issue on our repository, create your own fork, work on the problem and post a PR. +Please add your contributions to the [changelog](CHANGELOG.md) and to adhere to the [versioning](https://semver.org/spec/v2.0.0.html). +For more information see [here](CONTRIBUTING.md). + +#### Testing + +All functionality is tested with the [pytest](https://docs.pytest.org/en/6.2.x/contents.html) framework. From f25c6e2d978ae372d87b7146b84abad93566fc9b Mon Sep 17 00:00:00 2001 From: Helge Hecht Date: Mon, 15 Dec 2025 15:02:40 +0000 Subject: [PATCH 2/4] Delete docs/source/CHANGELOG.md --- docs/source/CHANGELOG.md | 177 --------------------------------------- 1 file changed, 177 deletions(-) delete mode 100644 docs/source/CHANGELOG.md diff --git a/docs/source/CHANGELOG.md b/docs/source/CHANGELOG.md deleted file mode 100644 index de9d245..0000000 --- a/docs/source/CHANGELOG.md +++ /dev/null @@ -1,177 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [0.5.0] - 2025-06-09 - -### Added - -- Added `smiles_to_formula` and `inchi_to_formula` conversions to the RDKit converter. -- Added unit tests for `smiles_to_formula`. -- Added support for tabular files, which are treated like tsv files. - -### Changed - -- Updated `matchms` dependency to `^0.30.0` in `pyproject.toml`. - -### Fixed - -- Minor documentation and test improvements. - -## [0.4.1] - 2025-05-19 - -### Changed - -- updated dependencies [#157](https://github.com/RECETOX/MSMetaEnhancer/pull/157) - -## [0.4.0] - 2024-03-13 - -### Changed - -- Update IDSM SPARQL queries to achieve better performance by @galgonek in [#152](https://github.com/RECETOX/MSMetaEnhancer/pull/152) -- Switched to poetry and added additional converters by @hechth in [#155](https://github.com/RECETOX/MSMetaEnhancer/pull/155) - -## [0.3.0] - 2023-05-12 - -### Added - -- general class Data for input handling [#141](https://github.com/RECETOX/MSMetaEnhancer/pull/141) -- DataFrame class to read and handle tabular metadata input [#141](https://github.com/RECETOX/MSMetaEnhancer/pull/141) -- implementation of blocking time in PubChem [#145](https://github.com/RECETOX/MSMetaEnhancer/pull/145) - -### Changed - -- Spectra class is an instantiation of Data class [#141](https://github.com/RECETOX/MSMetaEnhancer/pull/141) -- fix throttling freezing the app [#144](https://github.com/RECETOX/MSMetaEnhancer/pull/144) - -### Removed - -- retired NLM (ChemIDplus) service [#140](https://github.com/RECETOX/MSMetaEnhancer/pull/140) - -## [0.2.5] - 2022-10-15 - -### Added - -- added Pytest config file `pytest.ini` and set it to automatically detect asynchronous tests [#124](https://github.com/RECETOX/MSMetaEnhancer/pull/124) - -### Changed - -- fixed Circuit Breaker implementation to be compatible with Python 3.9 [#124](https://github.com/RECETOX/MSMetaEnhancer/pull/124) - -### Removed - -## [0.2.4] - 2022-08-30 - -### Changed - -- escaping of single quotes in IDSM arguments [#102](https://github.com/RECETOX/MSMetaEnhancer/issues/102) -- unified environment and packaging management [#115](https://github.com/RECETOX/MSMetaEnhancer/issues/115) -- apply circuit breaker pattern in WebConverter [#113](https://github.com/RECETOX/MSMetaEnhancer/issues/113) - -### Removed - -- removed test case from curator which fails in matchms > 0.14 [#112](https://github.com/RECETOX/MSMetaEnhancer/issues/112) - -## [0.2.3] - 2022-05-12 - -### Added - -- KEGG ID conversions support to BridgeDb service [#101](https://github.com/RECETOX/MSMetaEnhancer/issues/101) - -### Changed - -- double quotes to single quotes in IDSM [#102](https://github.com/RECETOX/MSMetaEnhancer/issues/102) - -## [0.2.2] - 2022-04-27 - -### Added - -- introduced `error` level into logging [#95](https://github.com/RECETOX/MSMetaEnhancer/issues/95) -- logging of unknown errors in Annotator [#90](https://github.com/RECETOX/MSMetaEnhancer/issues/90) - -### Changed - -- the log file is now written continuously during annotation and the metrics added at the end of the file [#92](https://github.com/RECETOX/MSMetaEnhancer/issues/92) - -### Removed - -## [0.2.1] - 2022-04-05 - -### Added - -- try-finally block to ensure the Monitor thread is always terminated [#86](https://github.com/RECETOX/MSMetaEnhancer/issues/86) - -### Changed - -- improved parsing of PubChem responses [#84](https://github.com/RECETOX/MSMetaEnhancer/issues/84) - -## [0.2.0] - 2022-03-19 - -### Added - -- BridgeDb supporting conversion of several database IDs [#76](https://github.com/RECETOX/MSMetaEnhancer/issues/76) -- ComputeConverter class for conversions based on computation instead of querying [#75](https://github.com/RECETOX/MSMetaEnhancer/issues/75) -- ConverterBuilder which validates and initialises converters [#75](https://github.com/RECETOX/MSMetaEnhancer/issues/75) -- reintroduced PubChem service using direct REST web interface [#76](https://github.com/RECETOX/MSMetaEnhancer/issues/76) - -### Changed - -- reorganised Converter class to support computation approach [#75](https://github.com/RECETOX/MSMetaEnhancer/issues/75) -- renamed PubChem service to IDSM to avoid confusion [#73](https://github.com/RECETOX/MSMetaEnhancer/issues/73) - -## [0.1.3] - 2022-02-15 - -### Added - -- multidict package requirement -- tracking of attributes validation in log [#68](https://github.com/RECETOX/MSMetaEnhancer/issues/68) -- CIR: Inchi -> SMILES conversion [#66](https://github.com/RECETOX/MSMetaEnhancer/issues/66) - -### Changed - -- passed `multidict` instead of `frozendict` to `aiohttp.ClientSession.post` (required by package) -- take only first result when there are multiple hits in CIR conversions [#69](https://github.com/RECETOX/MSMetaEnhancer/issues/69) -- support `ISOMERIC_SMILES` and `CANONICAL_SMILES` in PubChem instead of generic `SMILES` [#67](https://github.com/RECETOX/MSMetaEnhancer/issues/67) - -## [0.1.2] - 2022-01-06 - -### Added - -- `generate_options()` function in `Galaxy` submodule to create all possible conversions supported by the tool in a format suitable for the galaxy tool form [#58](https://github.com/RECETOX/MSMetaEnhancer/pull/58) -- monitoring of services status during annotation process [#56](https://github.com/RECETOX/MSMetaEnhancer/issues/56) -- validation of obtained metadata [#59](https://github.com/RECETOX/MSMetaEnhancer/issues/59) - -### Changed - -- structure and contents of documentation [#51](https://github.com/RECETOX/MSMetaEnhancer/pull/51) - -### Removed - -- tests checking contents and consistency of individual services [#54](https://github.com/RECETOX/MSMetaEnhancer/pull/61) - -## [0.1.1] - 2021-12-07 - -### Added - -- `get_conversion_functions` on the level of `Converter` - -### Changed - -- computation of all available jobs in `Application` - -### Removed - -- `get_all_conversions` on the level of `Annotator` - -## [0.1.0] - 2021-11-16 - -### Added - -- Added conda environment files [#35](https://github.com/RECETOX/MSMetaEnhancer/pull/35) -- Usage of IDSM SPARQL for PubChem service [#25](https://github.com/RECETOX/MSMetaEnhancer/pull/25) -- Added logging and quantitative progress of annotation process [#22](https://github.com/RECETOX/MSMetaEnhancer/pull/22) -- Generalised requests to obtain multiple values at once [#20](https://github.com/RECETOX/MSMetaEnhancer/pull/20) -- Added asynchronous requests [#15](https://github.com/RECETOX/MSMetaEnhancer/pull/15) From b95f8f943a698ba47dd79a92b545cadd1ec6a0ab Mon Sep 17 00:00:00 2001 From: Helge Hecht Date: Mon, 15 Dec 2025 15:02:55 +0000 Subject: [PATCH 3/4] Delete docs/source/CONTRIBUTING.md --- docs/source/CONTRIBUTING.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 docs/source/CONTRIBUTING.md diff --git a/docs/source/CONTRIBUTING.md b/docs/source/CONTRIBUTING.md deleted file mode 100644 index a742372..0000000 --- a/docs/source/CONTRIBUTING.md +++ /dev/null @@ -1,37 +0,0 @@ -# Contributing - -We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). - -A contribution can be one of the following cases: - -1. you have a question; -1. you think you may have found a bug (including unexpected behavior); -1. you want to make some kind of change to the code base (e.g. to fix a bug, to add a new feature, to update documentation); - -The sections below outline the steps in each case. - -## You have a question - -1. use the search functionality in the issues to see if someone already filed the same issue; -1. if your issue search did not yield any relevant results, make a new issue; - -## You think you may have found a bug - -1. use the search functionality in the issues to see if someone already filed the same issue; -1. if your issue search did not yield any relevant results, make a new issue, making sure to provide enough information to the rest of the community to understand the cause and context of the problem. Depending on the issue, you may want to include: - - some identifying information (name and version number) for dependencies you're using; - - information about the operating system; - -## You want to make some kind of change to the code base - -In case you feel like you've made a valuable contribution, but you don't know how to write or run tests for it, or how to generate the documentation: don't let this discourage you from making the pull request; we can help you! Just go ahead and submit the pull request, but keep in mind that you might be asked to append additional commits to your pull request. - -1. (**important**) announce your plan to the rest of the community *before you start working*. This announcement should be in the form of a (new) issue; -1. (**important**) wait until some kind of consensus is reached about your idea being a good idea; -1. if needed, fork the repository to your own Github profile and create your own feature branch off of the latest master commit. While working on your feature branch, make sure to stay up to date with the main branch by pulling in changes, possibly from the 'upstream' repository (follow the instructions [here](https://help.github.com/articles/configuring-a-remote-for-a-fork/) and [here](https://help.github.com/articles/syncing-a-fork/)); -1. make sure the existing tests still work by running ``pytest``; -1. add your own tests (if necessary); -1. update or expand the documentation; -1. update the [CHANGELOG](CHANGELOG.md) file with change; -1. [push](http://rogerdudler.github.io/git-guide/>) your feature branch to (your fork of) this repository on GitHub; -1. create the pull request, e.g. following the instructions [here](https://help.github.com/articles/creating-a-pull-request/). From af0c55ae7dc6b20f7a429eac3d1a6bb0d22779db Mon Sep 17 00:00:00 2001 From: Helge Hecht Date: Mon, 15 Dec 2025 15:03:11 +0000 Subject: [PATCH 4/4] Delete docs/source/readme.md --- docs/source/readme.md | 76 ------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 docs/source/readme.md diff --git a/docs/source/readme.md b/docs/source/readme.md deleted file mode 100644 index 0095e5f..0000000 --- a/docs/source/readme.md +++ /dev/null @@ -1,76 +0,0 @@ -## MSMetaEnhancer - -[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/msmetaenhancer/README.html) -[![docs](https://readthedocs.org/projects/msmetaenhancer/badge/?version=latest)](https://msmetaenhancer.readthedocs.io/en/latest/) -[![Conda](https://img.shields.io/conda/v/bioconda/msmetaenhancer)](https://anaconda.org/bioconda/msmetaenhancer) -[![PyPI - Python Version](https://img.shields.io/pypi/v/msmetaenhancer)](https://pypi.org/project/msmetaenhancer/) -[![DOI](https://joss.theoj.org/papers/10.21105/joss.04494/status.svg)](https://doi.org/10.21105/joss.04494) - -**MSMetaEnhancer** is a tool used for `.msp` files annotation. -It adds metadata like SMILES, InChI, and CAS number fetched from the following services: [CIR](https://cactus.nci.nih.gov/chemical/structure_documentation), [CTS](https://cts.fiehnlab.ucdavis.edu/), [PubChem](https://pubchem.ncbi.nlm.nih.gov/), [IDSM](https://idsm.elixir-czech.cz/), and [BridgeDb](https://bridgedb.github.io/). -The app uses asynchronous implementation of annotation process allowing for optimal fetching speed. - -If you use MSMetaEnhancer in your work, please cite the following publication: - -Troják et al., (2022). MSMetaEnhancer: A Python package for mass spectra metadata annotation. Journal of Open Source Software, 7(79), 4494, https://doi.org/10.21105/joss.04494 - -### Usage - -```python -import asyncio - -from MSMetaEnhancer import Application - -app = Application() - -# import your .msp file -app.load_data('sample.msp', file_format='msp') - -# curate given metadata (e.g. fix CAS numbers) -app.curate_metadata() - -# specify requested services (these are supported) -services = ['CTS', 'CIR', 'IDSM', 'PubChem', 'BridgeDb', 'RDKit'] - -# specify requested jobs -jobs = [('name', 'inchi', 'IDSM'), ('inchi', 'formula', 'IDSM'), ('inchi', 'inchikey', 'IDSM'), - ('inchi', 'iupac_name', 'IDSM'), ('inchi', 'canonical_smiles', 'IDSM')] - -# run asynchronous annotations of spectra data -asyncio.run(app.annotate_spectra(services, jobs)) - -# export .msp file -app.save_data('sample_out.msp', file_format='msp') -``` - -### Installation - -Prerequisites: - -- Python 3.9+ -- Anaconda - -Install `MSMetaEnhancer` from Bioconda with: - -``` -# install MSMetaEnhancer in a new virtual environment to avoid dependency clashes -conda create --name MSMetaEnhancer python=3.9 -conda activate MSMetaEnhancer -conda install --channel bioconda --channel conda-forge MSMetaEnhancer -``` - -### Developer Documentation - -#### Setup - -Create your development environment using the provided [script](conda/environment-dev.yml) via conda to install all required dependencies. - -#### Contributing - -We appreciate contributions - feel free to open an issue on our repository, create your own fork, work on the problem and post a PR. -Please add your contributions to the [changelog](CHANGELOG.md) and to adhere to the [versioning](https://semver.org/spec/v2.0.0.html). -For more information see [here](CONTRIBUTING.md). - -#### Testing - -All functionality is tested with the [pytest](https://docs.pytest.org/en/6.2.x/contents.html) framework.