Ejemplo n.º 1
0
GtNodeStream* gt_gtf_in_stream_new(const char *filename)
{
  GtGTFInStream *gtf_in_stream;
  GtNodeStream *ns = gt_node_stream_create(gt_gtf_in_stream_class(), false);
  gtf_in_stream = gtf_in_stream_cast(ns);
  gtf_in_stream->genome_node_buffer = gt_queue_new();
  gtf_in_stream->type_checker = gt_type_checker_builtin_new();
  gtf_in_stream->filename = filename ? gt_cstr_dup(filename) : NULL;
  return ns;
}
Ejemplo n.º 2
0
GtTypeChecker* gt_typecheck_info_create_type_checker(const GtTypecheckInfo *tci,
                                                     GtError *err)
{
  GtTypeChecker *type_checker = NULL;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(tci);
  if (tci->typecheck_built_in)
    type_checker = gt_type_checker_builtin_new();
  else {
    GtStr *obo_file;
    gt_assert(gt_option_is_set(tci->typecheck_option));
    if (!gt_str_length(tci->typecheck)) {
      /* a. */
      if (!(obo_file = get_obo_path(err)))
        had_err = -1;
      if (!had_err)
        gt_str_append_cstr(obo_file, "sofa.obo");
    }
    else if (gt_file_exists(gt_str_get(tci->typecheck))) {
      /* b. */
      obo_file = gt_str_new_cstr(gt_str_get(tci->typecheck));
    }
    else {
      /* c. */
      if (!(obo_file = get_obo_path(err)))
        had_err = -1;
      if (!had_err) {
        gt_str_append_str(obo_file, tci->typecheck);
        gt_str_append_cstr(obo_file, ".obo");
      }
    }

    if (!had_err)
      type_checker = gt_type_checker_obo_new(gt_str_get(obo_file), err);

    gt_str_delete(obo_file);
  }
  return type_checker;
}