# utils

class integron_finder.utils.FastaIterator(path, replicon_name=None, dist_threshold=4000, alphabet=None)

  Allow to parse over a multi fasta file, and iterate over it

  Warning

  The sequences order is not guarantee.

  __init__(path, replicon_name=None, dist_threshold=4000, alphabet=None)
    Parameters

      - path (str) – The path to the file containing the sequences.

      - alphabet (Bio.SeqIUPAC member) – The authorized alphabet

      - replicon_name (str) – The name of the replicon, if this specify all sequence.name will have this value

      - dist_threshold (int) – The minimum length for a replicon to be considered as circular. Under this threshold even the provided topology is ‘circular’ the computation will be done with a ‘linear’ topology.

  __len__()
    Returns

      The number of sequence in the file

  __next__()
    Returns

      The next sequence (the order of sequences is not guaranteed).

    Return type

      a `Bio.SeqRecord` object or None if the sequence is not compliant with the alphabet.

  __weakref__

    list of weak references to the object (if defined)

  _check_seq_alphabet_compliance(seq)
    Parameters

      seq (`Bio.Seq.Seq` instance) – the sequence to check

    Returns

      True if sequence letters are a subset of the alphabet, False otherwise.

  _set_topologies(topologies)
    Parameters

      topologies (`integron_finder.Topology` onject) –

    Returns

integron_finder.utils.get_name_from_path(path)
  Parameters

    path – The path to extract name for instance the fasta file to the replicon

  Returns

    the name of replicon for instance if path = /path/to/replicon.fasta name = replicon

integron_finder.utils.log_level(verbose, quiet)
  Returns

    the level to apply to loggers. 0 <= level <=50

  Return type

    int

integron_finder.utils.make_multi_fasta_reader(alphabet)

  fasta generator maker

  Parameters

    alphabet – the alphabet store in the fasta generator closure

  Returns

    generator to iterate on the fasta file in the same order as in fasta file

integron_finder.utils.model_len(path)
  Parameters

    path (str) – the path to the covariance model file

  Returns

    the length of the model

  Return type

    int

integron_finder.utils.read_multi_fasta(path)
  Parameters

    path – The path to the fasta file.

  Returns

    The sequence parsed.

  Return type

    `Bio.SeqRecord.SeqRecord` object.