Пример #1
0
MultiFormatReader * instantiateReader() {
    MultiFormatReader * nexusReader = new MultiFormatReader(-1, NxsReader::WARNINGS_TO_STDERR);
    if (gQuietMode) {
        nexusReader->SetWarningOutputLevel(NxsReader::SKIPPING_CONTENT_WARNING);
    }
    if (gStrictLevel != 2) {
        nexusReader->SetWarningToErrorThreshold((int)NxsReader::FATAL_WARNING + 1 - (int) gStrictLevel);
    }
    NxsCharactersBlock * charsB = nexusReader->GetCharactersBlockTemplate();
    NxsDataBlock * dataB = nexusReader->GetDataBlockTemplate();
    charsB->SetAllowAugmentingOfSequenceSymbols(true);
    dataB->SetAllowAugmentingOfSequenceSymbols(true);
    NxsTreesBlock * treesB = nexusReader->GetTreesBlockTemplate();
    assert(treesB);
    if (gStrictLevel < 2) {
        treesB->SetAllowImplicitNames(true);
    }
    treesB->setValidateInternalNodeLabels(gValidateInternals);
    treesB->setAllowNumericInterpretationOfTaxLabels(true);
    if (gStrictLevel < 2) {
        NxsStoreTokensBlockReader *storerB =  nexusReader->GetUnknownBlockTemplate();
        assert(storerB);
        storerB->SetTolerateEOFInBlock(true);
    }
    nexusReader->conversionOutputRecord.addNumbersToDisambiguateNames = true;
    return nexusReader;
}
Пример #2
0
MultiFormatReader * instantiateReader() {
  MultiFormatReader * nexusReader = new MultiFormatReader(-1, NxsReader::WARNINGS_TO_STDERR);
  if (gQuietMode)
    nexusReader->SetWarningOutputLevel(NxsReader::SKIPPING_CONTENT_WARNING);
  if (gStrictLevel != 2)
    nexusReader->SetWarningToErrorThreshold((int)NxsReader::FATAL_WARNING + 1 - (int) gStrictLevel);
  if (gUnderscoresToSpaces) 
    nexusReader->SetCoerceUnderscoresToSpaces(true);
  NxsCharactersBlock * charsB = nexusReader->GetCharactersBlockTemplate();
  NxsDataBlock * dataB = nexusReader->GetDataBlockTemplate();
  charsB->SetAllowAugmentingOfSequenceSymbols(true);
  dataB->SetAllowAugmentingOfSequenceSymbols(true);
  if (gInterleaveLen > 0) {
    assert(charsB);
    charsB->SetWriteInterleaveLen(gInterleaveLen);
    dataB->SetWriteInterleaveLen(gInterleaveLen);
  }
  
  NxsTreesBlock * treesB = nexusReader->GetTreesBlockTemplate();
  assert(treesB);
  if (gStrictLevel < 2)
    treesB->SetAllowImplicitNames(true);
  treesB->SetWriteFromNodeEdgeDataStructure(gTreesViaInMemoryStruct);
  treesB->setValidateInternalNodeLabels(gValidateInternals);
  if (gAltNexus)
    treesB->setWriteTranslateTable(false);
  if (gStrictLevel < 2) {
    NxsStoreTokensBlockReader *storerB =  nexusReader->GetUnknownBlockTemplate();
    assert(storerB);
    storerB->SetTolerateEOFInBlock(true);
  }
  nexusReader->conversionOutputRecord.addNumbersToDisambiguateNames = true;
  
  if (gSuppressingNameTranslationFile)
    nexusReader->conversionOutputRecord.writeNameTranslationFile = false;
  return nexusReader;
}