# utils

Here some useful functions in the rest of macsyfinder code

## utils API reference

## get_def_to_detect

`macsypy.utils.``get_def_to_detect`(models, model_registry)
  Parameters

    - models (list of tuple with the following structure: [('model_fqn', ('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.

## get_replicon_names

`macsypy.utils.``get_replicon_names`(genome_path)

  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

## threads_available

`macsypy.utils.``threads_available`()
  Returns

    The maximal number of threads available. It’s nice with cluster scheduler or linux. On Mac it use the number of physical cores

  Return type

    int