Permalink
Browse files

change exception to warning when running hal2maf with default params …

…on empty genome or seuqnce
  • Loading branch information...
glennhickey committed Nov 20, 2013
1 parent b2b637f commit a5fcdaa985a31148ccd062231effd533f1e8011b
Showing with 12 additions and 2 deletions.
  1. +12 −2 maf/impl/hal2maf.cpp
View
@@ -238,8 +238,18 @@ int main(int argc, char** argv)
}
else
{
- mafExport.convertSegmentedSequence(mafStream, alignment, ref,
- start, length, targetSet);
+ if (start == 0 && length == 0 && ref->getSequenceLength() == 0)
+ {
+ string refSeqName =
+ refSequence != NULL ? refSequence->getName() : refGenome->getName();
+ cerr << "hal2maf: Warning reference sequence " << refSeqName
+ << " has zero length. MAF output will be empty" << endl;
+ }
+ else
+ {
+ mafExport.convertSegmentedSequence(mafStream, alignment, ref,
+ start, length, targetSet);
+ }
}
if (mafPath != "stdout")
{

0 comments on commit a5fcdaa

Please sign in to comment.