Permalink
Browse files

Fix hal2maf for bed version > 9

  • Loading branch information...
1 parent 216ab30 commit ab5d998c57c1ae75828937b5166ba533cfb99f15 @joelarmstrong joelarmstrong committed Nov 7, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 maf/impl/halMafBed.cpp
@@ -87,16 +87,19 @@ void MafBed::visitLine()
for (size_t i = 0; i < _bedLine._blocks.size(); ++i)
{
if (_bedLine._blocks[i]._length == 0 ||
- _bedLine._blocks[i]._start + _bedLine._blocks[i]._length >=
+ _bedLine._start + _bedLine._blocks[i]._start +
+ _bedLine._blocks[i]._length >=
(hal_index_t)refSequence->getSequenceLength())
{
cerr << "Line " << _lineNumber << ", block " << i
<<": BED coordinates invalid\n";
}
else
{
- hal_index_t start = std::max(_bedLine._blocks[i]._start, refStart);
- hal_index_t end = std::min(_bedLine._blocks[i]._start +
+ hal_index_t start = std::max(_bedLine._start +
+ _bedLine._blocks[i]._start, refStart);
+ hal_index_t end = std::min(_bedLine._start +
+ _bedLine._blocks[i]._start +
_bedLine._blocks[i]._length, refEnd);
if (end > start)
{

0 comments on commit ab5d998

Please sign in to comment.