Ejemplo n.º 1
0
static void xml_outputAGSline(const GthAGS *ags, unsigned long agsnum,
                              unsigned int indentlevel, GtFile *outfp)
{
  GthExonAGS *exon;
  unsigned long i;

  gth_indent(outfp, indentlevel);
  gt_file_xprintf(outfp, "<AGS_line AGS_serial=\"%lu\">\n",
                  agsnum + OUTPUTOFFSET);
  indentlevel++;
  gth_indent(outfp, indentlevel);
  gt_file_xprintf(outfp, "<exon_coordinates>\n");
  indentlevel++;

  for (i = 0; i < gth_ags_num_of_exons(ags); i++) {
    exon = gth_ags_get_exon(ags, i);
    gth_indent(outfp, indentlevel);
    gt_file_xprintf(outfp, "<exon e_start=\"%lu\" e_stop=\"%lu\"/>\n",
                    SHOWGENPOSAGS(exon->range.start),
                    SHOWGENPOSAGS(exon->range.end));
  }

  indentlevel--;
  gth_indent(outfp, indentlevel);
  gt_file_xprintf(outfp, "</exon_coordinates>\n");
  indentlevel--;
  gth_indent(outfp, indentlevel);
  gt_file_xprintf(outfp, "</AGS_line>\n");
}
Ejemplo n.º 2
0
static void outputAGSline(const GthAGS *ags, GtUword agsnum,
                          GtFile *outfp)
{
  GthExonAGS *exon;
  GtUword i;

  gt_file_xprintf(outfp, "AGS-" GT_WU " (",  agsnum + OUTPUTOFFSET);
  for (i = 0; i < gth_ags_num_of_exons(ags); i++) {
    exon = gth_ags_get_exon(ags, i);
    if (i > 0)
      gt_file_xfputc(',', outfp);
    gt_file_xprintf(outfp, GT_WU "  " GT_WU, SHOWGENPOSAGS(exon->range.start),
                    SHOWGENPOSAGS(exon->range.end));
  }
  gt_file_xprintf(outfp, ")\n");
}
Ejemplo n.º 3
0
static void output_exon_intron_lines(const GthAGS *ags, int widthforgenpos,
                                     GtFile *outfp)
{
  GthSpliceSiteProb *splicesiteprob;
  GthExonAGS *exon;
  GtUword i, leftexonborder, rightexonborder, exonlength,
                leftintronborder = GT_UNDEF_UWORD, rightintronborder,
                intronlength;
  GthDbl exonscore;
  GthFlt donorsiteprob, acceptorsiteprob;

  for (i = 0; i < gt_array_size(ags->exons); i++) {
    exon            = (GthExonAGS*) gt_array_get(ags->exons, i);
    leftexonborder  = exon->range.start;
    rightexonborder = exon->range.end;
    exonlength      = rightexonborder - leftexonborder + 1;
    exonscore       = exon->score;

    if (i > 0) {
      rightintronborder = leftexonborder - 1;
      intronlength      = rightintronborder - leftintronborder + 1;
      splicesiteprob    = (GthSpliceSiteProb*)
                          gt_array_get(ags->splicesiteprobs, i-1);
      donorsiteprob     = splicesiteprob->donorsiteprob;
      acceptorsiteprob  = splicesiteprob->acceptorsiteprob;

      /* output intron */
      gt_file_xprintf(outfp,
                      "    Intron %2" GT_WUS " %*" GT_WUS " %*" GT_WUS " (%4"
                      GT_WUS " n);           " "Pd: %5.3f  Pa: %5.3f\n",
                      i - 1 + OUTPUTOFFSET, widthforgenpos,
                      SHOWGENPOSAGS(leftintronborder), widthforgenpos,
                      SHOWGENPOSAGS(rightintronborder), intronlength,
                      donorsiteprob, acceptorsiteprob);
    }
    leftintronborder = rightexonborder + 1;

    /* output exon */
    gt_file_xprintf(outfp,
                    "  Exon %2" GT_WUS " %*" GT_WUS " %*" GT_WUS " (%4" GT_WUS
                    " n); score: %5.3f\n",
                    i + OUTPUTOFFSET, widthforgenpos,
                    SHOWGENPOSAGS(leftexonborder), widthforgenpos,
                    SHOWGENPOSAGS(rightexonborder), exonlength, exonscore);
  }
  gt_file_xfputc('\n', outfp);
}
Ejemplo n.º 4
0
static void xml_output_exon_intron_lines(const GthAGS *ags,
                                         unsigned int indentlevel,
                                         GtFile *outfp)
{
  GthSpliceSiteProb *splicesiteprob;
  GthExonAGS *exon;
  unsigned long i, leftexonborder, rightexonborder, exonlength,
                leftintronborder = GT_UNDEF_ULONG, rightintronborder,
                intronlength;
  GthDbl exonscore;
  GthFlt donorsiteprob, acceptorsiteprob;

  gth_indent(outfp, indentlevel);
  gt_file_xprintf(outfp,
                  "<exon-intron_info xmlns=\"http://www.genomethreader.org/"
                  "GTH_output/PGL_module/predicted_gene_location/"
                  "AGS_information/exon-intron_info/\">\n");
  indentlevel++;

  for (i = 0; i < gt_array_size(ags->exons); i++) {
    exon            = (GthExonAGS*) gt_array_get(ags->exons, i);
    leftexonborder  = exon->range.start;
    rightexonborder = exon->range.end;
    exonlength      = rightexonborder - leftexonborder + 1;
    exonscore       = exon->score;

    if (i > 0) {
      rightintronborder = leftexonborder - 1;
      intronlength      = rightintronborder - leftintronborder + 1;
      splicesiteprob    = (GthSpliceSiteProb*)
                          gt_array_get(ags->splicesiteprobs, i-1);
      donorsiteprob     = splicesiteprob->donorsiteprob;
      acceptorsiteprob  = splicesiteprob->acceptorsiteprob;

      /* output intron */
      gth_indent(outfp, indentlevel);
      gt_file_xprintf(outfp, "<intron i_serial=\"%lu\" don_prob=\"%.3f\" "
                      "acc_prob=\"%.3f\">\n",  i - 1 + OUTPUTOFFSET,
                      donorsiteprob, acceptorsiteprob);
      indentlevel++;
      gth_indent(outfp, indentlevel);
      gt_file_xprintf(outfp,
                      "<gDNA_intron_boundary i_start=\"%lu\" i_stop=\"%lu\" "
                      "i_length=\"%lu\"/>\n",
                      SHOWGENPOSAGS(leftintronborder),
                      SHOWGENPOSAGS(rightintronborder),  intronlength);
      indentlevel--;
      gth_indent(outfp, indentlevel);
      gt_file_xprintf(outfp, "</intron>\n");
    }
    leftintronborder = rightexonborder + 1;

    /* output exon */
    gth_indent(outfp, indentlevel);
    gt_file_xprintf(outfp, "<exon e_serial=\"%lu\" e_score=\"%.3f\">\n",
                    i + OUTPUTOFFSET, exonscore);
    indentlevel++;
    gth_indent(outfp, indentlevel);
    gt_file_xprintf(outfp,
                    "<gDNA_exon_boundary e_start=\"%lu\" e_stop=\"%lu\" "
                    "e_length=\"%lu\"/>\n", SHOWGENPOSAGS(leftexonborder),
                    SHOWGENPOSAGS(rightexonborder), exonlength);
    indentlevel--;
    gth_indent(outfp, indentlevel);
    gt_file_xprintf(outfp, "</exon>\n");
  }

  indentlevel--;
  gth_indent(outfp, indentlevel);
  gt_file_xprintf(outfp, "</exon-intron_info>\n");
}