Skip to content

Config File

Configuration Template

#############################
# NPLinker configuration file
#############################

# The root directory of the NPLinker project. You need to create it first.
# The value is required and must be a full path.
root_dir = "<NPLinker root directory>"
# The mode for preparing dataset.
# The available modes are "podp" and "local".
# "podp" mode is for using the PODP platform (https://pairedomicsdata.bioinformatics.nl/) to prepare the dataset.
# "local" mode is for preparing the dataset locally. So uers do not need to upload their data to the PODP platform.
# The value is required.
mode = "podp"
# The PODP project identifier.
# The value is required if the mode is "podp".
podp_id = ""


[log]
# Log level. The available levels are same as the levels in python package `logging`:
# "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL".
# The default value is "INFO".
level = "INFO"
# The log file to append log messages.
# The value is optional.
# If not set or use empty string, log messages will not be written to a file.
# The file will be created if it does not exist. Log messages will be appended to the file if it exists.
file = "path/to/logfile"
# Whether to write log meesages to console.
# The default value is true.
use_console = true


[mibig]
# Whether to use mibig metadta (json).
# The default value is true.
to_use = true
# The version of mibig metadata.
# Make sure using the same version of mibig in bigscape.
# The default value is "3.1"
version = "3.1"


[bigscape]
# The parameters to use for running BiG-SCAPE.
# Version of BiG-SCAPE to run. Make sure to change the parameters property below as well
# when changing versions.
version = 1
# Required BiG-SCAPE parameters.
# --------------
# For version 1:
# -------------
# Required parameters are: `--mix`, `--include_singletons` and `--cutoffs`. NPLinker needs them to run the analysis properly.
# Do NOT set these parameters: `--inputdir`, `--outputdir`, `--pfam_dir`. NPLinker will automatically configure them.
# If parameter `--mibig` is set, make sure to set the config `mibig.to_use` to true and `mibig.version` to the version of mibig in BiG-SCAPE.
# The default value is "--mibig --clans-off --mix --include_singletons --cutoffs 0.30".
# --------------
# For version 2:
# --------------
# Note that BiG-SCAPE v2 has subcommands. NPLinker requires the `cluster` subcommand and its parameters.
# Required parameters of `cluster` subcommand are: `--mibig_version`, `--include_singletons` and `--gcf_cutoffs`.
# DO NOT set these parameters: `--pfam_path`, `--inputdir`, `--outputdir`. NPLinker will automatically configure them.
# BiG-SCPAPE v2 also runs a `--mix` analysis by default, so you don't need to set this parameter here.
# Example parameters for BiG-SCAPE v2: "--mibig_version 3.1 --include_singletons --gcf_cutoffs 0.30"
parameters = "--mibig --clans-off --mix --include_singletons --cutoffs 0.30"
# Which bigscape cutoff to use for NPLinker analysis.
# There might be multiple cutoffs in bigscape output.
# Note that this value must be a string.
# The default value is "0.30".
cutoff = "0.30"


[scoring]
# Scoring methods.
# Valid values are "metcalf" and "rosetta".
# The default value is "metcalf".
methods = ["metcalf"]

Default Configurations

The default configurations are automatically used by NPLinker if you don't set them in your config file.

# NPLinker default configurations

[log]
level = "INFO"
use_console = true

[mibig]
to_use = true
version = "3.1"

[bigscape]
version = 1
parameters = "--mibig --clans-off --mix --include_singletons --cutoffs 0.30"
cutoff = "0.30"

[scoring]
methods = ["metcalf"]

Config loader

You can load the configuration file using the load_config function.

from nplinker.config import load_config
config = load_config('path/to/nplinker.toml')

When you use NPLinker as an application, you can get access to the configuration object directly:

from nplinker import NPLinker
npl = NPLinker('path/to/nplinker.toml')
print(npl.config)