cba5a9c2046f6eb5694cc9c8f72dc0632f575dc5 braney Sun Sep 14 14:45:37 2014 -0700 some tweaks to support the Ebola skunk project diff --git src/lib/gff3.c src/lib/gff3.c index 3a10491..c2cc424 100644 --- src/lib/gff3.c +++ src/lib/gff3.c @@ -316,31 +316,31 @@ g3a->seqid = unescapeStrPooled(g3a, words[0]); g3a->source = unescapeStrPooled(g3a, words[1]); g3a->type = unescapeStrPooled(g3a, words[2]); g3a->start = gff3FileStrToInt(g3a->file, words[3])-1; g3a->end = gff3FileStrToInt(g3a->file, words[4]); if (!sameString(words[5], ".")) { g3a->score = gff3FileStrToFloat(g3a->file, words[5]); g3a->haveScore = TRUE; } g3a->strand = parseStrand(g3a, words[6]); g3a->phase = parsePhase(g3a, words[7]); if (sameString(g3a->type, "CDS")) { if (g3a->phase < 0) - gff3AnnErr(g3a, "CDS feature must have phase"); + g3a->phase = 0; // assume the phase is 0 } else { #if 0 // spec unclear; bug report filed // spec currently doesn't restrict phase, unclear if it's allowed on start/stop codon features if (g3a->phase >= 0) gff3AnnErr(g3a, "phase only allowed on CDS features"); #endif } } /* check that an attribute tag name is valid. */ static boolean checkAttrTag(struct gff3Ann *g3a, char *tag) { // FIXME: spec is not clear on what is a valid tag. @@ -808,30 +808,31 @@ parseFasta(g3f); else if (startsWithWord("##sequence-region", line)) parseSequenceRegion(g3f, line); else if (startsWithWord("##feature-ontology", line)) parseFeatureOntology(g3f, line); else if (startsWithWord("##attribute-ontology", line)) parseAttributeOntology(g3f, line); else if (startsWithWord("##source-ontology", line)) parseSourceOntology(g3f, line); else if (startsWithWord("##species", line)) parseSpecies(g3f, line); else if (startsWithWord("##genome-build", line)) parseGenomeBuild(g3f, line); else if (startsWithWord("##gff-spec-version", line) || startsWithWord("##source-version", line) || + startsWithWord("##source", line) || startsWithWord("##date", line) || startsWithWord("##Type", line)) ; /* FIXME: silently ignore these. Mark says. */ else gff3FileErr(g3f, "invalid meta line: %s", line); } static void parseLine(struct gff3File *g3f, char *line) /* parse one line of a gff3 file */ { if (startsWith("##", line)) parseMeta(g3f, line); else if (!startsWith("#", line) && (strlen(line) > 0)) parseAnn(g3f, line); }