autometa.config package

Submodules

autometa.config.databases module

autometa.config.environ module

# License: GNU Affero General Public License v3 or later # A copy of GNU AGPL v3 should have been included in this software package in LICENSE.txt.

Configuration handling for Autometa environment.

autometa.config.environ.bedtools()

Get bedtools version.

Returns

version of bedtools

Return type

str

autometa.config.environ.bowtie2()

Get bowtie2 version.

Returns

version of bowtie2

Return type

str

autometa.config.environ.configure(config: configparser.ConfigParser) Tuple[configparser.ConfigParser, bool]

Checks executable dependencies necessary to run autometa. Will update config with executable dependencies with details: 1. presence/absence of dependency and its location 2. versions

Parameters

config (configparser.ConfigParser) – Description of parameter config.

Returns

(config, satisfied) config updated with executables details Details: 1. location of executable 2. version of executable config : configparser.ConfigParser satisfied : bool

Return type

2-tuple

autometa.config.environ.diamond()

Get diamond version.

Returns

version of diamond

Return type

str

autometa.config.environ.find_executables()

Retrieves executable file paths by looking in Autometa dependent executables.

Returns

{executable:</path/to/executable>, …}

Return type

dict

autometa.config.environ.get_versions(program: Optional[str] = None) Union[Dict[str, str], str]

Retrieve versions from all required executable dependencies. If program is provided will only return version for program.

See: https://stackoverflow.com/a/834451/12671809

Parameters

program (str, optional) – the program to retrieve the version, by default None

Returns

if program is None: dict - {program:version, …} if program: str - version

Return type

dict or str

Raises
  • ValueError – program is not a string

  • KeyError – program is not an executable dependency.

autometa.config.environ.hmmpress()

Get hmmpress version.

Returns

version of hmmpress

Return type

str

autometa.config.environ.hmmscan()

Get hmmscan version.

Returns

version of hmmscan

Return type

str

autometa.config.environ.hmmsearch()

Get hmmsearch version.

Returns

version of hmmsearch

Return type

str

autometa.config.environ.prodigal()

Get prodigal version.

Returns

version of prodigal

Return type

str

autometa.config.environ.samtools()

Get samtools version.

Returns

version of samtools

Return type

str

autometa.config.utilities module

autometa.config.utilities.get_config(fpath: str) configparser.ConfigParser

Load the config provided at fpath.

Parameters

fpath (str) – </path/to/file.config>

Returns

interpolated config object parsed from fpath.

Return type

config.ConfigParser

Raises

FileNotFoundError – Provided fpath does not exist.

autometa.config.utilities.main()
autometa.config.utilities.parse_args(fpath: Optional[str] = None) argparse.Namespace

Generate argparse namespace (args) from config file.

Parameters

fpath (str) – </path/to/file.config> (default is DEFAULT_CONFIG in autometa.config)

Returns

namespace typical to parser.parse_args() method from argparse

Return type

argparse.Namespace

Raises

FileNotFoundError – provided fpath does not exist.

autometa.config.utilities.put_config(config: configparser.ConfigParser, out: str) None

Writes config to out and updates checkpoints checksum.

Parameters
  • config (config.ConfigParser) – configuration containing user provided parameters and files information.

  • out (str) – </path/to/output/file.config>

Returns

Return type

NoneType

autometa.config.utilities.set_home_dir() str

Set the home_dir in autometa’s default configuration (default.config) based on autometa’s current location. If the home_dir variable is already set, then this will be used as the home_dir location.

Returns

</path/to/package/autometa>

Return type

str

autometa.config.utilities.update_config(section: str, option: str, value: str, fpath: str = '/home/docs/checkouts/readthedocs.org/user_builds/autometa/checkouts/2.0.3/autometa/config/default.config') None

Update fpath in section for option with value.

Parameters
  • fpath (str) – </path/to/file.config>

  • section (str) – section header to update within fpath.

  • option (str) – option to update within section.

  • value (str) – value to update option.

Returns

Return type

NoneType

Module contents