예제 #1
0
void gt_scorehandler_delete(GtScoreHandler *scorehandler)
{
  if (scorehandler != NULL)
  {
    gt_score_matrix_delete(scorehandler->scorematrix);
    gt_free(scorehandler);
  }
}
예제 #2
0
파일: score_matrix.c 프로젝트: 9beckert/TIR
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;
}
예제 #3
0
파일: score_matrix.c 프로젝트: 9beckert/TIR
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;
}