cafaeval.parser

cafaeval.parser.obo_parser(obo_file, valid_rel=('is_a', 'part_of'), ia_file=None, orphans=True)[source]

Parse a OBO file and returns a list of ontologies, one for each namespace. Obsolete terms are excluded as well as external namespaces.

cafaeval.parser.update_toi(ontologies, toi_file)[source]

Remove terms not of interest from evaluation, eg for terms obsoleted since ontology was created :param ontologies: dict returned from obo_parser :param term_file: file with GO IDs to include in the terms of interest :return: copy of ontologies with updated toi

cafaeval.parser.gt_parser(gt_file, ontologies)[source]

Parse ground truth file. Discard terms not included in the ontology.

cafaeval.parser.gt_exclude_parser(exclude_file, gt, ontologies)[source]

Process terms that should be excluded from evaluation.

cafaeval.parser.pred_parser(pred_file, ontologies, gts, prop_mode, max_terms=None, n_cpu=0)[source]

Parse a prediction file and returns a list of prediction objects, one for each namespace. If a predicted is predicted multiple times for the same target, it stores the max. This is the slow step if the input file is huge, ca. 1 minute for 5GB input on SSD disk.

cafaeval.parser.ia_parser(file)[source]