def processPassageAnnotation(pred, true, countDict, checkID): anns_pred = pred['annotations'] anns_true = Annotation.sortAnns(true['annotations'], TBDFilter= False) for ann_pred in anns_pred: if Annotation.gettype(ann_pred) == 'Gene': countDict['pred_gene_num'] += 1 else: continue flag = False for ann_true in anns_true: if Annotation.isSame(ann_pred, ann_true, checkID): countDict['tp'] += 1 flag = True break if not flag: countDict['fp'] += 1 # print(ann_pred) countDict['true_gene_num'] += len(anns_true) for ann_true in anns_true: flag = False for ann_pred in anns_pred: if Annotation.isSame(ann_pred, ann_true, checkID): flag = True break if not flag: countDict['fn'] += 1