Beispiel #1
0
char  *PredictionExon_getSeqString(PredictionExon *exon) {
  char *seq;

  if (PredictionExon_getSeqCacheString(exon)) {
    return PredictionExon_getSeqCacheString(exon);
  }

  if (!PredictionExon_getSlice(exon)) {
    fprintf(stderr, "Warning: this exon %s doesn't have a contig you won't get a seq\n", PredictionExon_getDisplayLabel(exon));
    return NULL;
  } else {

    seq = BaseContig_getSubSeq(PredictionExon_getSlice(exon),
                               PredictionExon_getStart(exon),
                               PredictionExon_getEnd(exon),
                               1);

    if (PredictionExon_getStrand(exon) == -1){
      SeqUtil_reverseComplement(seq,strlen(seq));
    }
  }
  PredictionExon_setSeqCacheString(exon, seq);

  return PredictionExon_getSeqCacheString(exon);
}
void PredictionTranscript_addExon(PredictionTranscript *trans, PredictionExon *exon, int *positionP) {
    if (positionP) {
        Vector_setElementAt(trans->exons, *positionP, exon);
    } else {
        Vector_addElement(trans->exons, exon);
    }

    if (exon && (!PredictionTranscript_getStartIsSet(trans) ||
                 PredictionExon_getStart(exon) < PredictionTranscript_getStart(trans))) {
        PredictionTranscript_setStart(trans, PredictionExon_getStart(exon));
    }
    if (exon && (!PredictionTranscript_getEndIsSet(trans) ||
                 PredictionExon_getEnd(exon) > PredictionTranscript_getEnd(trans))) {
        PredictionTranscript_setEnd(trans, PredictionExon_getEnd(exon));
    }
}