void gt_scorehandler_delete(GtScoreHandler *scorehandler) { if (scorehandler != NULL) { gt_score_matrix_delete(scorehandler->scorematrix); gt_free(scorehandler); } }
GtScoreMatrix* gt_score_matrix_new_read(const char *path, GtAlphabet *alphabet, GtError *err) { GtScoreMatrix *sm; gt_error_check(err); gt_assert(path && alphabet); sm = gt_score_matrix_new(alphabet); if (parse_score_matrix(sm, path, err)) { gt_score_matrix_delete(sm); return NULL; } return sm; }
GtScoreMatrix* gt_score_matrix_new_read_protein(const char *path, GtError *err) { GtAlphabet *protein_alpha; GtScoreMatrix *sm; int had_err; gt_error_check(err); gt_assert(path); /* create score matrix */ protein_alpha = gt_alphabet_new_protein(); sm = gt_score_matrix_new(protein_alpha); gt_alphabet_delete(protein_alpha); /* parse matrix file */ had_err = parse_score_matrix(sm, path, err); if (had_err) { gt_score_matrix_delete(sm); return NULL; } return sm; }