nplinker
A python framework for microbial natural products data mining by integrating genomics and metabolomics data
Science Score: 64.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
1 of 14 committers (7.1%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A python framework for microbial natural products data mining by integrating genomics and metabolomics data
Basic Info
- Host: GitHub
- Owner: NPLinker
- License: apache-2.0
- Language: Python
- Default Branch: dev
- Homepage: https://nplinker.github.io/nplinker
- Size: 116 MB
Statistics
- Stars: 20
- Watchers: 5
- Forks: 13
- Open Issues: 15
- Releases: 19
Topics
Metadata Files
README.dev.md
nplinker developer documentation
If you're looking for user documentation, go here.
Code editor
We use Visual Studio Code (VS Code) as code editor.
The VS Code Profile for this project is vscode/nplinker.code-profile, which contains the settings, extensions and snippets for the project.
To use the profile, you must first import it by clicking the following menus: Code -> Settings -> Profiles -> Import Profile....
Then select the file vscode/nplinker.code-profile to import the profile.
VS Code will take a while to install the extensions and apply the settings. Want more info? See vscode profiles guide.
If you want to add more settings, you can update the workspace settings, see the guide for more info.
Setup
We use Python 3.11 for development environment.
```shell
Create a virtual environment
conda create -n npl-dev python=3.11
activate virtual environment
conda activate npl-dev
Clone the repository
git clone https://github.com/NPLinker/nplinker.git cd nplinker
install development dependencies
pip install -e ".[dev]"
install non-pypi dependencies
install-nplinker-deps ```
Running the tests
Run unit tests with ```shell pytest
or
pytest -n 2 tests/unit
``
Parallel testing is supported withpytest-xdistplugin. To run tests in parallel, use the-noption, e.g.-n 2to run tests in parallel with 2 CPUs.
By default,pytest` will use all available CPUs to run the tests in parallel.
Run integration tests with
shell
pytest -n 0 tests/integration
-n 0 means no parallel testing.
Test coverage
In addition to just running the tests to see if they pass, they can be used for coverage statistics, i.e. to determine how much of the package's code is actually executed during tests. In an activated virtual environment with the development tools installed, inside the package directory, run:
shell
coverage run
This runs tests and stores the result in a .coverage file.
To see the results on the command line, run
shell
coverage report
coverage can also generate output in HTML and other formats; see coverage help for more information.
Linting and formatting
We use ruff for linting, sorting imports and formatting code. The configurations of ruff are set in pyproject.toml file.
Running the linters and formatters requires an activated virtual environment with the development tools installed.
```shell
Lint all files in the current directory.
ruff check .
Lint all files in the current directory, and fix any fixable errors.
ruff check . --fix
Format all files in the current directory
ruff format .
Format a single python file
ruff format filename.py ```
Static typing
We use inline type annotation for static typing rather than stub files (i.e. .pyi files).
Since Python 3.11 is used as dev environment (older NPLinker must support Python version ≥3.9), you may see various typing issues at runtime. Here is a guide to solve the potential runtime issues.
By default, we use from __future__ import annotations at module level to stop evaluating annotations at function definition time (see PEP 563), which would solve most of compatibility issues between different Python versions. Make sure you're aware of the caveats.
We use Mypy as static type checker:
```
install mypy
pip install mypy
run mypy
mypy src/nplinker ```
Mypy configurations are set in pyproject.toml file.
For more info about static typing and mypy, see: - Static typing with Python - Mypy doc
Docs
We use MkDocs and its theme Material for MkDocs to generate documentations. The configurations of MkDocs are set in mkdocs.yml file.
To watch the changes of current doc in real time, run: ```shell mkdocs serve
or to watch src and docs directories
mkdocs serve -w docs -w src ``` Then open your browser and go to http://127.0.0.1:8000/.
Publishing the docs
Documentation is published to GitHub Pages using mike, which also manages versioning on the gh-pages branch.
Deploying a new version
To deploy version 2.0 of the docs and mark it as the latest, run:
bash
make deploy-docs version=2.0
This command does the following:
- Fetches the latest README from the
nplinker-webapprepository. - Builds and deploys the documentation to the
gh-pagesbranch. - Updates the
latestalias to point to this version. - Creates a commit on the
gh-pagesbranch to record the deployment.
If you want to undo a deployment, you can run:
bash
mike delete 2.0
Previewing the docs
- To preview all committed versions from
gh-pages, use:
bash
mike serve
- To preview your local, uncommitted changes, use:
bash
make build-docs
make build-docswill also update the webapp README before serving the docs.
Versioning
Updating the version of the NPLinker package is done with make command update-version, e.g.
shell
make update-version CURRENT_VERSION=0.0.1 NEW_VERSION=0.0.2
This command will update the version in the following files:
- src/nplinker/__init__.py
- pyproject.toml
- CITATION.cff
Making a release
This section describes how to make a release in 2 parts:
- Create Github release
- Publish to Pypi
(1/2) Create Github release
We use the Github action Draft or publish Github release to create a Github release.
Click the right corner Run workflow button, then fill in the current version number and new version number, and choose publish to publish Github release, then click the Run workflow button.
The action will first update the version with the command make update-version. Then it will generate a release notes and update the CHANGELOG.md file with the notes. After that, the action will commit and push the changes. In the end, the action will create a Github release with the new version number and create a tag for the release.
After the action is finished successfully, you can go to the release page to check the release.
This repository uses the GitHub-Zenodo integration, the new Github release will trigger Zenodo into making a snapshot of the repository and sticking a DOI on it. Check the Zenodo page to see the new snapshot.
(2/2) Publish to Pypi
You can publish the package to pypi with the following steps:
```shell
Go to your local nplinker repository
cd path-to-nplinker-repo
Clean the repository
make clean
Build the source distribution and the wheel
make build
Publish to pypi
make release ```
After publishing to pypi, you can check the pypi page to see the new version.
Owner
- Name: NPLinker
- Login: NPLinker
- Kind: organization
- Repositories: 3
- Profile: https://github.com/NPLinker
Natural product (NP) genome and metabolome mining
Citation (CITATION.cff)
# YAML 1.2
---
cff-version: "1.1.0"
title: "NPLinker"
authors:
-
given-names: Cunliang
family-names: Geng
affiliation: "Netherlands eScience Center"
orcid: "https://orcid.org/0000-0002-1409-8358"
-
given-names: Giulia
family-names: Crocioni
affiliation: "Netherlands eScience Center"
-
given-names: Simon
family-names: Rogers
-
given-names: Andrew
family-names: Ramsay
-
given-names: Katherine
family-names: Duncan
-
given-names: Justin
family-names: van
-
given-names: Grímur
family-names: Hjörleifsson
-
given-names: Sylvia
family-names: Soldatou
-
given-names: Florian
family-names: Huber
-
given-names: Joe
family-names: Wandy
-
given-names: Ronan
family-names: Daly
-
given-names: Joris
family-names: Louwen
-
given-names: Marnix
family-names: Medema
version: "2.0.0-beta.1"
repository-code: "https://github.com/NPLinker/nplinker"
keywords:
- Genome
- Metabolome
- Natural Products
- Data Mining
message: "If you use this software, please cite it using these metadata."
license: Apache-2.0
GitHub Events
Total
- Create event: 37
- Release event: 1
- Issues event: 21
- Watch event: 3
- Delete event: 37
- Issue comment event: 108
- Push event: 102
- Pull request review comment event: 63
- Pull request review event: 81
- Pull request event: 72
- Fork event: 2
Last Year
- Create event: 37
- Release event: 1
- Issues event: 21
- Watch event: 3
- Delete event: 37
- Issue comment event: 108
- Push event: 102
- Pull request review comment event: 63
- Pull request review event: 81
- Pull request event: 72
- Fork event: 2
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 907
- Total Committers: 14
- Avg Commits per committer: 64.786
- Development Distribution Score (DDS): 0.416
Top Committers
| Name | Commits | |
|---|---|---|
| Andrew Ramsay | a****y@u****m | 530 |
| Simon Rogers | s****s@g****m | 98 |
| Andrew Ramsay | g****b@a****t | 73 |
| louwe015 | j****n@w****l | 60 |
| Grimur Hjorleifsson | g****h@g****m | 43 |
| louwenjjr | j****n@h****m | 28 |
| florian-huber | 3****r@u****m | 19 |
| Andrew Ramsay | a****w@a****t | 18 |
| Cunliang Geng | c****g@e****l | 14 |
| Andrew Ramsay | a****y@g****m | 10 |
| dependabot[bot] | 4****]@u****m | 9 |
| CunliangGeng | C****g@u****m | 2 |
| Helge Hecht | h****t@r****z | 2 |
| Rónán Daly | r****y@g****k | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 97
- Total pull requests: 220
- Average time to close issues: 6 months
- Average time to close pull requests: 10 days
- Total issue authors: 20
- Total pull request authors: 10
- Average comments per issue: 3.0
- Average comments per pull request: 2.03
- Merged pull requests: 197
- Bot issues: 0
- Bot pull requests: 6
Past Year
- Issues: 14
- Pull requests: 73
- Average time to close issues: 3 months
- Average time to close pull requests: 8 days
- Issue authors: 6
- Pull request authors: 6
- Average comments per issue: 1.21
- Average comments per pull request: 1.81
- Merged pull requests: 57
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- CunliangGeng (41)
- gcroci2 (12)
- andrewramsay (8)
- hechth (8)
- louwenjjr (5)
- liannette (4)
- justinjjvanderhooft (2)
- jeep3 (2)
- MenusGarg (2)
- sdrogers (2)
- AMao-0512 (1)
- ialas (1)
- shendricks464 (1)
- wkipandula (1)
- adraismawur (1)
Pull Request Authors
- CunliangGeng (223)
- liannette (16)
- adraismawur (8)
- gcroci2 (7)
- hechth (7)
- dependabot[bot] (6)
- louwenjjr (4)
- rtlortega (4)
- grimur (1)
- sdrogers (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 185 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 12
- Total maintainers: 1
pypi.org: nplinker
Natural Products Linker
- Homepage: https://github.com/NPLinker/nplinker
- Documentation: https://nplinker.readthedocs.io/
- License: Apache-2.0 license
-
Latest release: 1.3.2
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- SonarSource/sonarcloud-github-action master composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- actions/checkout v3 composite
- citation-file-format/cffconvert-github-action main composite
- actions/checkout v3 composite
- gaurav-nelson/github-action-markdown-link-check v1 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- stefanzweifel/git-auto-commit-action v4 composite
- actions/checkout master composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v4 composite
- tj-actions/changed-files v44 composite
- SonarSource/sonarcloud-github-action master composite
- actions/checkout v4 composite
- actions/setup-python v3 composite
- actions/checkout b4ffde65f46336ab88eb53be808477a3936bae11 composite
- actions/upload-artifact 97a0fba1372883ab732affbe8f94b823f91727db composite
- github/codeql-action/upload-sarif 1b1aada464948af03b950897e5eb522f92603cc2 composite
- ossf/scorecard-action 0864cf19026789058feabb7e87baa5f140aac736 composite