| 606 | } |
| 607 | |
| 608 | bool FileHandler::storeFeatures(const String& filename, const FeatureMap& map) |
| 609 | { |
| 610 | //determine file type |
| 611 | FileTypes::Type type; |
| 612 | try |
| 613 | { |
| 614 | type = getType(filename); |
| 615 | } |
| 616 | catch ( Exception::FileNotFound& ) |
| 617 | { |
| 618 | return false; |
| 619 | } |
| 620 | |
| 621 | //store right file |
| 622 | if (type == FileTypes::FEATUREXML) |
| 623 | { |
| 624 | FeatureXMLFile().store(filename, map); |
| 625 | } |
| 626 | else if (type == FileTypes::TSV) |
| 627 | { |
| 628 | MsInspectFile().store(filename, map); |
| 629 | } |
| 630 | else if (type == FileTypes::PEPLIST) |
| 631 | { |
| 632 | SpecArrayFile().store(filename, map); |
| 633 | } |
| 634 | else if (type == FileTypes::KROENIK) |
| 635 | { |
| 636 | KroenikFile().store(filename, map); |
| 637 | } |
| 638 | else |
| 639 | { |
| 640 | OPENMS_LOG_WARN << "Can not store features to " << filename << ". Unknown file extension" << endl; |
| 641 | return false; |
| 642 | } |
| 643 | |
| 644 | return true; |
| 645 | } |
| 646 | |
| 647 | bool FileHandler::storeConsensusFeatures(const String& filename, const ConsensusMap& map) |
| 648 | { |
no test coverage detected