Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gnps version as a new setting in config file #291

Merged
merged 4 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ Here are some example values for the `nplinker.toml` file:
version = "1"
cutoff = "0.30"

[gnps]
version = "1"

[scoring]
methods = ["metcalf"]
```
Expand Down Expand Up @@ -212,6 +215,9 @@ Here are some example values for the `nplinker.toml` file:
cutoff = "0.30"
parameters = "--mibig_version 3.1 --include_singletons --gcf_cutoffs 0.30"

[gnps]
version = "1"

[scoring]
methods = ["metcalf"]
```
Expand Down
2 changes: 2 additions & 0 deletions src/nplinker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def load_config(config_file: str | PathLike) -> Dynaconf:
Validator("bigscape.parameters", is_type_of=str),
Validator("bigscape.cutoff", required=True, is_type_of=str),
Validator("bigscape.version", required=True, is_type_of=str, is_in=["1", "2"]),
# GNPS
Validator("gnps.version", required=True, is_type_of=str, is_in=["1", "2"]),
# Scoring
## `scoring.methods` must be a list of strings and must contain at least one of the
## supported scoring methods.
Expand Down
8 changes: 8 additions & 0 deletions src/nplinker/data/nplinker.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ parameters = "version1_parameters_or_version2_parameters"
# BiG-SCPAPE v2 also runs a `--mix` analysis by default, so you don't need to set this parameter here.
# An example value could be: "--mibig_version 3.1 --include_singletons --gcf_cutoffs 0.30"

[gnps]
# Settings for GNPS.

version = "1"
# [REQUIRED] Available values are "1" and "2".
# The version of GNPS platform you have used to run the analysis.
# Set the version to "1" if you have used https://gnps.ucsd.edu/;
# Set the version to "2" if you have used https://gnps2.org/.

[scoring]
# Settings for scoring.
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/data/nplinker_local_mode.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ version = "3.1"
version = "1"
cutoff = "0.30"

[gnps]
version = "1"

[scoring]
methods = ["metcalf"]
3 changes: 3 additions & 0 deletions tests/unit/data/nplinker_local_mode.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ version = "3.1"
version = "1"
cutoff = "0.30"

[gnps]
version = "1"

[scoring]
methods = ["metcalf"]
2 changes: 2 additions & 0 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ def test_config(tmp_path):
assert config.bigscape.cutoff == "0.30"
assert config.bigscape.version == "1"

assert config.gnps.version == "1"

assert config.scoring.methods == ["metcalf"]
Loading