55 while (blockBuffer_.size() == 0) {
57 unique_ptr<MafBlock> block;
59 block.reset(iterator_->nextBlock());
60 if (!block.get())
return 0;
63 if (!block->hasSequenceForSpecies(refSpecies_))
67 const MafSequence& refSeq = block->getSequenceForSpecies(refSpecies_);
69 std::map<std::string, RangeSet<size_t> >::iterator mr = ranges_.find(refSeq.
getChromosome());
70 if (mr == ranges_.end())
82 (*logstream_ <<
"Strand: " << refSeq.
getStrand()).endLine();
86 it != ranges.
getSet().end();
103 (*logstream_ <<
"FEATURE EXTRACTOR: extracting " << ranges.
getSet().size() <<
" features from block " << block->getDescription() <<
".").endLine();
108 it != ranges.
getSet().end();
116 newBlock->
setScore(block->getScore());
117 newBlock->
setPass(block->getPass());
120 for (
size_t j = 0; j < block->getNumberOfSequences(); ++j) {
121 unique_ptr<MafSequence> subseq;
122 subseq.reset(block->getSequence(j).subSequence(a, b - a + 1));
123 if (!ignoreStrand_) {
130 (*logstream_ << subseq->getName()).endLine();
133 blockBuffer_.push_back(newBlock);
141 MafBlock* nxtBlock = blockBuffer_.front();
142 blockBuffer_.pop_front();
A synteny block data structure, the basic unit of a MAF alignement file.
void setScore(double score)
void setPass(unsigned int pass)
void addSequence(const MafSequence &sequence)
A sequence class which is used to store data from MAF files.
const std::string & getChromosome() const
size_t getSrcSize() const
Range< size_t > getRange(bool origin=true) const
void addRange(const Range< T > &r)
const std::set< Range< T > *, rangeComp_< T > > & getSet() const
void filterWithin(const Range< T > &r)
void restrictTo(const Range< T > &r)
a coordinate range on a sequence. Stores coordinates as a Range<size_t> object, but also keep the str...
virtual char getStrand() const
virtual bool isNegativeStrand() const
size_t getAlignmentPosition(size_t seqPos)