bundle

Represents a structure to directly compare data between two or more genomes.

class pdm_utils.classes.bundle.Bundle

Bases: object

check_for_errors()

Check evaluation lists of all objects contained in the Bundle and determine how many errors there are.

check_genome_dict(key, expect=True, eval_id=None, success='correct', fail='error', eval_def=None)

Check if a genome is present in the genome dictionary.

Parameters
  • key (str) – The value to be evaluated if it is a valid key in the genome dictionary.

  • expect (bool) – Indicates whether the key is expected to be a valid key in the genome dictionary.

  • eval_id (str) – Unique identifier for the evaluation.

  • success (str) – Default status if the outcome is a success.

  • fail (str) – Default status if the outcome is not a success.

  • eval_def (str) – Description of the evaluation.

check_genome_pair_dict(key, expect=True, eval_id=None, success='correct', fail='error', eval_def=None)

Check if a genome_pair is present in the genome_pair dictionary.

Parameters
  • key – same as for check_genome_dict().

  • expect – same as for check_genome_dict().

  • eval_id – same as for check_genome_dict().

  • success – same as for check_genome_dict().

  • fail – same as for check_genome_dict().

  • eval_def – same as for check_genome_dict().

check_statements(execute_result, execute_msg, eval_id=None, success='correct', fail='error', eval_def=None)

Check if MySQL statements were successfully executed.

Parameters
  • execute_result (int) – Indication if MySQL statements were successfully execute.

  • execute_msg (str) – Description of MySQL statement execution result.

  • eval_id – same as for check_genome_dict().

  • success – same as for check_genome_dict().

  • fail – same as for check_genome_dict().

  • eval_def – same as for check_genome_dict().

check_ticket(eval_id=None, success='correct', fail='error', eval_def=None)

Check for whether a Ticket object is present.

Parameters
  • eval_id – same as for check_genome_dict().

  • success – same as for check_genome_dict().

  • fail – same as for check_genome_dict().

  • eval_def – same as for check_genome_dict().

get_evaluations()

Get all evaluations for all objects stored in the Bundle.

Returns

Dictionary of evaluation lists for each feature.

Return type

dict

set_eval(eval_id, definition, result, status)

Constructs and adds an Evaluation object to the evaluations list.

Parameters
  • eval_id (str) – Unique identifier for the evaluation.

  • definition (str) – Description of the evaluation.

  • result (str) – Description of the outcome of the evaluation.

  • status (str) – Outcome of the evaluation.

set_genome_pair(genome_pair, key1, key2)

Pair two genomes and add to the paired genome dictionary.

Parameters
  • genome_pair (GenomePair) – An empty GenomePair object to stored paried genomes.

  • key1 (str) – A valid key in the Bundle object’s ‘genome_dict’ that indicates the first genome to be paired.

  • key2 (str) – A valid key in the Bundle object’s ‘genome_dict’ that indicates the second genome to be paired.