utils

Here some useful functions in the rest of macsyfinder code

utils API reference

macsypy.utils.get_def_to_detect(models, model_registry)[source]
Parameters:
  • models (list of tuple with the following structure: [('model_1', ('def1, def2, ..)), ('model_2', ('def1', ..)), ..]) – the list of models to detect as returned by config.models.
  • model_registry (macsypy.registries.ModelRegistry object.) – the models registry for this run.
Returns:

the definitions to parse

Return type:

list of macsypy.registries.DefinitionLocation objects

Raises:

ValueError – if a model name provided in models is not in model_registry.

macsypy.utils.get_replicon_names(genome_path)[source]

parse gembase file and the list of replicon identifiers

Parameters:genome_path (str) – The path to a file containing sequence in gembase format
Returns:the list of replicon identifiers
Return type:list of str