Exemplo n.º 1
0
static void xml_show_pgl(GthPGL *pgl, unsigned long pglnum,
                         unsigned long translationtable, GthInput *input,
                         unsigned int indentlevel, GthOutput *out)
{
  unsigned long i;

  gth_indent(out->outfp, indentlevel);
  gt_file_xprintf(out->outfp, "<predicted_gene_location>\n");
  indentlevel++;
  gth_indent(out->outfp, indentlevel);
  gt_file_xprintf(out->outfp,
                     "<PGL_line PGL_serial=\"%lu\" PGL_strand=\"%c\" "
                     "PGL_start=\"%lu\" PGL_stop=\"%lu\"/>\n",
                     pglnum + OUTPUTOFFSET,
                     SHOWSTRAND(gth_pgl_is_forward(pgl)),
                     SHOWGENPOS(gth_pgl_is_forward(pgl),
                                gth_pgl_total_length(pgl),
                                gth_pgl_genomic_offset(pgl),
                                pgl->maxrange.start),
                     SHOWGENPOS(gth_pgl_is_forward(pgl),
                                gth_pgl_total_length(pgl),
                                gth_pgl_genomic_offset(pgl),
                                pgl->maxrange.end));

  for (i = 0; i < gth_pgl_num_of_ags(pgl); i++) {
    xml_show_ags(gth_pgl_get_ags(pgl, i), pglnum, i, translationtable, input,
                 indentlevel, out);
  }

  indentlevel--;
  gth_indent(out->outfp, indentlevel);
  gt_file_xprintf(out->outfp, "</predicted_gene_location>\n");
}
Exemplo n.º 2
0
static void show_pgl(GthPGL *pgl, GtUword pglnum,
                     GtUword translationtable, GthInput *input,
                     unsigned int indentlevel, GthOutput *out)
{
  GtUword i;
  GtFile *outfp = out->outfp;

  gt_assert(!out->gff3out);

  if (out->xmlout) {
    gth_indent(outfp, indentlevel);
    gt_file_xprintf(outfp, "<predicted_gene_location>\n");
    indentlevel++;
    gth_indent(outfp, indentlevel);
    gt_file_xprintf(outfp, "<PGL_line PGL_serial=\"" GT_WU "\" "
                    "PGL_strand=\"%c\" PGL_start=\"" GT_WU "\" PGL_stop=\""
                    GT_WU "\"/>\n",
                    pglnum + OUTPUTOFFSET,
                    SHOWSTRAND(gth_pgl_is_forward(pgl)),
                    SHOWGENPOS(gth_pgl_is_forward(pgl),
                               gth_pgl_total_length(pgl),
                               gth_pgl_genomic_offset(pgl),
                               pgl->maxrange.start),
                    SHOWGENPOS(gth_pgl_is_forward(pgl),
                               gth_pgl_total_length(pgl),
                               gth_pgl_genomic_offset(pgl),
                               pgl->maxrange.end));
  }
  else {
    gt_file_xprintf(outfp, "PGL %3" GT_WUS " (%c strand):      " GT_WU "     "
                    GT_WU,
                    pglnum + OUTPUTOFFSET,
                    SHOWSTRAND(gth_pgl_is_forward(pgl)),
                    SHOWGENPOS(gth_pgl_is_forward(pgl),
                               gth_pgl_total_length(pgl),
                               gth_pgl_genomic_offset(pgl),
                               pgl->maxrange.start),
                    SHOWGENPOS(gth_pgl_is_forward(pgl),
                               gth_pgl_total_length(pgl),
                               gth_pgl_genomic_offset(pgl),
                               pgl->maxrange.end));
    if (out->pglgentemplate)
      gt_file_xprintf(outfp, " (genomic template '%s')", gth_pgl_gen_id(pgl));
    gt_file_xfputc('\n', outfp);
  }

  for (i = 0; i < gt_array_size(pgl->assemblies); i++) {
    show_ags(gth_pgl_get_ags(pgl, i), pglnum, i, translationtable, input,
             indentlevel, out);
  }

  if (out->xmlout) {
    indentlevel--;
    gth_indent(outfp, indentlevel);
    gt_file_xprintf(outfp, "</predicted_gene_location>\n");
  }
}