Skip to content
Snippets Groups Projects
Commit e6cab1c6 authored by arq5x's avatar arq5x
Browse files

[BUG] change getField() logic in GffRecord

parent 99499249
No related branches found
No related tags found
No related merge requests found
...@@ -120,3 +120,40 @@ void GffRecord::printNull(QuickString &outBuf) const ...@@ -120,3 +120,40 @@ void GffRecord::printNull(QuickString &outBuf) const
} }
} }
const QuickString &GffRecord::getField(int fieldNum) const
{
if (fieldNum == 9 && _numFields == 9) {
return _group;
}
switch (fieldNum) {
case 1:
return _chrName;
break;
case 2:
return _source;
break;
case 3:
return _name;
break;
case 4:
return _startPosStr;
break;
case 5:
return _endPosStr;
break;
case 6:
return _score;
break;
case 7:
return _strand;
break;
case 8:
return _frame;
break;
default:
return Bed6Interval::getField(fieldNum);
break;
}
}
...@@ -27,9 +27,10 @@ public: ...@@ -27,9 +27,10 @@ public:
virtual const QuickString &getSource() const { return _source; } virtual const QuickString &getSource() const { return _source; }
virtual const QuickString &getFrame() const { return _frame; } virtual const QuickString &getFrame() const { return _frame; }
virtual const QuickString &getGroup() const { return _group; } virtual const QuickString &getGroup() const { return _group; }
virtual const int getNumFields() const { return _numFields; } virtual int getNumFields() const { return _numFields; }
virtual void setNumFields(int val) { _numFields = val; } virtual void setNumFields(int val) { _numFields = val; }
virtual const QuickString &getField(int fieldNum) const;
//Note: using the assignment operator in a GffRecord can potentially be a performance hit, //Note: using the assignment operator in a GffRecord can potentially be a performance hit,
//if the number of fields frequently differ between this object and the one being copied. //if the number of fields frequently differ between this object and the one being copied.
const GffRecord &operator=(const GffRecord &other); const GffRecord &operator=(const GffRecord &other);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment