65 getline(input_, nextLine_);
71 if (!hasMoreFeature())
72 throw Exception(
"BedGraphFeatureReader::nextFeature(). No more feature in file.");
77 throw Exception(
"BedGraphFeatureReader::nextFeature(). Wrong BedGraph file format: should have 4 tab delimited columns.");
81 unsigned int start = TextTools::to<unsigned int>(st.
nextToken());
82 unsigned int end = TextTools::to<unsigned int>(st.
nextToken());
88 if (value !=
".") feature.
setAttribute(BED_VALUE, value);
97 std::vector< std::string > v;
A very simple implementation of the SequenceFeature class.
void setAttribute(const std::string &attribute, const std::string &value)
Set the value of an attribute.
static const std::string BED_VALUE
static std::string toString(const bpp::SequenceFeature &f)
const BasicSequenceFeature nextFeature()
The base interface for sequence features.
virtual const size_t getEnd() const =0
virtual const std::string & getAttribute(const std::string &attribute) const =0
virtual const size_t getStart() const =0
virtual const std::string & getSequenceId() const =0
size_t numberOfRemainingTokens() const
const std::string & nextToken()
bool isEmpty(const std::string &s)
std::string toString(T t)