free(sqinfo->sa);
}
}
-}
+ if (sqinfo->flags & SQINFO_CO){
+ if (NULL != sqinfo->co){ /* FS, r296 -> */
+ free(sqinfo->co);
+ }
+ }
+} /* this is the end of FreeSequence() */
int
SetSeqinfoString(SQINFO *sqinfo, char *sptr, int flag)
if (sq2->flags & SQINFO_TYPE) sq1->type = sq2->type;
if (sq2->flags & SQINFO_SS) sq1->ss = Strdup(sq2->ss);
if (sq2->flags & SQINFO_SA) sq1->sa = Strdup(sq2->sa);
+ if (sq2->flags & SQINFO_CO) sq1->co = Strdup(sq2->co);
}
/* Function: ToDNA()
return(*s == '>');
}
+#ifdef CLUSTALO
+static int
+only_whitespace(const char *s) {
+ while (*s != '\0') {
+ if (!isspace((unsigned char)*s))
+ return 0;
+ s++;
+ }
+ return 1;
+}
+#endif
+
static void
readPearson(struct ReadSeqVars *V)
{
if (V->ssimode >= 0) V->r_off = V->ssioffset;
+#ifdef CLUSTALO
+ while (only_whitespace(V->buf)) {
+ SeqfileGetLine(V);
+ }
+
+ if (feof(V->f) || *V->buf != '>')
+#else
if (*V->buf != '>')
+#endif
+#ifdef CLUSTALO
+ Die("\
+File %s does not appear to be in FASTA format at line %d.\n\
+You may want to specify the file format on the command line.\n\
+Usually this is done with an option --infmt <fmt>.\n",
+ V->fname, V->linenumber);
+#else
Die("\
File %s does not appear to be in FASTA format at line %d.\n\
You may want to specify the file format on the command line.\n\
Usually this is done with an option --informat <fmt>.\n",
V->fname, V->linenumber);
-
+#endif
if ((sptr = strtok(V->buf+1, "\n\t ")) != NULL)
SetSeqinfoString(V->sqinfo, sptr, SQINFO_NAME);
if ((sptr = strtok(NULL, "\n")) != NULL)
#endif
sqinfo->flags |= SQINFO_SA;
}
+ if (V->msa->co != NULL && V->msa->co[V->msa->lastidx] != NULL) {
+/* AW: stopping squid from dealigning sequences and corresponding info */
+#ifdef CLUSTALO
+ sqinfo->co = sre_strdup(V->msa->co[V->msa->lastidx], V->msa->alen);
+#else
+ MakeDealignedString(V->msa->aseq[V->msa->lastidx], V->msa->alen,
+ V->msa->co[V->msa->lastidx], &(sqinfo->co));
+#endif
+ sqinfo->flags |= SQINFO_CO;
+ } /* co */
V->msa->lastidx++;
}
else {
strncmp(buf, "!!NA_SEQUENCE", 13) == 0)
{ fmt = SQFILE_GCG; goto DONE; }
+ if (strncmp(buf, "# DUBLIN 1.", 11) == 0) /* -> r296, FS */
+ { fmt = MSAFILE_DUBLIN; goto DONE; }
+
if (strncmp(buf, "# STOCKHOLM 1.", 14) == 0)
{ fmt = MSAFILE_STOCKHOLM; goto DONE; }
if (strcmp(s2, "FASTA") == 0) code = SQFILE_FASTA;
#ifdef CLUSTALO
- if (strcmp(s2, "FA") == 0) code = SQFILE_FASTA;
+ else if (strcmp(s2, "FA") == 0) code = SQFILE_FASTA;
else if (strcmp(s2, "VIENNA") == 0) code = SQFILE_VIENNA;
else if (strcmp(s2, "VIE") == 0) code = SQFILE_VIENNA;
#endif