ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gclib/gff.cpp
(Generate patch)
# Line 159 | Line 159
159   ftype=t[2];
160   info=t[8];
161   char* p=t[3];
162 < if (!parseUInt(p,fstart))
163 <   GError("Error parsing start coordinate from GFF line:\n%s\n",l);
162 > if (!parseUInt(p,fstart)) {
163 >   //FIXME: chromosome_band entries in Flybase
164 >   GMessage("Warning: invalid start coordinate at line:\n%s\n",l);
165 >   return;
166 >   }
167   p=t[4];
168 < if (!parseUInt(p,fend))
169 <   GError("Error parsing end coordinate from GFF line:\n%s\n",l);
168 > if (!parseUInt(p,fend)) {
169 >   GMessage("Warning: invalid end coordinate at line:\n%s\n",l);
170 >   return;
171 >   }
172   if (fend<fstart) swap(fend,fstart); //make sure fstart>=fend, always
173   p=t[5];
174   if (p[0]=='.' && p[1]==0) {
# Line 188 | Line 193
193     is_exon=true;
194     is_t_data=true;
195     }
196 <  else if (strstr(fnamelc, "exon")!=NULL) {
196 >  else if (endsWith(fnamelc, "exon")) {
197     exontype=exgffExon;
198     is_exon=true;
199     is_t_data=true;
# Line 971 | Line 976
976   bool GffReader::addExonFeature(GfoHolder* prevgfo, GffLine* gffline, GHash<CNonExon>& pex, bool noExonAttr) {
977    bool r=true;
978    if (gffline->strand!=prevgfo->gffobj->strand) {
979 <     GMessage("GFF Error: duplicate GFF ID '%s' (exons found on different strands of %s)\n",
980 <        prevgfo->gffobj->gffID, prevgfo->gffobj->getGSeqName());
981 <      r=false;
979 >         if (prevgfo->gffobj->strand=='.') {
980 >        prevgfo->gffobj->strand=gffline->strand;
981 >            }
982 >         else {
983 >                 GMessage("GFF Error at %s (%c): exon %d-%d (%c) found on different strand; discarded.\n",
984 >                        prevgfo->gffobj->gffID, prevgfo->gffobj->strand,
985 >                        gffline->fstart, gffline->fend, gffline->strand, prevgfo->gffobj->getGSeqName());
986 >                 //r=false;
987 >                 return true; //FIXME: split trans-spliced mRNAs by strand
988 >                 }
989       }
990    int gdist=(gffline->fstart>prevgfo->gffobj->end) ? gffline->fstart-prevgfo->gffobj->end :
991                        ((gffline->fend<prevgfo->gffobj->start)? prevgfo->gffobj->start-gffline->fend :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines