| 85 | } |
| 86 | |
| 87 | ExitCodes main_(int, const char**) override |
| 88 | { |
| 89 | FileHandler fh; |
| 90 | |
| 91 | //input file type |
| 92 | String in = getStringOption_("in"); |
| 93 | FileTypes::Type in_type = FileTypes::nameToType(getStringOption_("in_type")); |
| 94 | |
| 95 | if (in_type == FileTypes::UNKNOWN) |
| 96 | { |
| 97 | in_type = fh.getType(in); |
| 98 | writeDebug_(String("Input file type: ") + FileTypes::typeToName(in_type), 2); |
| 99 | } |
| 100 | |
| 101 | if (in_type == FileTypes::UNKNOWN) |
| 102 | { |
| 103 | writeLogError_("Error: Could not determine input file type!"); |
| 104 | return PARSE_ERROR; |
| 105 | } |
| 106 | |
| 107 | //output file names and types |
| 108 | String out = getStringOption_("out"); |
| 109 | FileTypes::Type out_type = FileTypes::nameToType(getStringOption_("out_type")); |
| 110 | |
| 111 | if (out_type == FileTypes::UNKNOWN) |
| 112 | { |
| 113 | out_type = fh.getTypeByFileName(out); |
| 114 | } |
| 115 | |
| 116 | if (out_type == FileTypes::UNKNOWN) |
| 117 | { |
| 118 | writeLogError_("Error: Could not determine output file type!"); |
| 119 | return PARSE_ERROR; |
| 120 | } |
| 121 | |
| 122 | bool legacy_traml_id = getFlag_("legacy_traml_id"); |
| 123 | |
| 124 | //--------------------------------------------------------------------------- |
| 125 | // Start Conversion |
| 126 | //--------------------------------------------------------------------------- |
| 127 | TargetedExperiment targeted_exp; |
| 128 | if (in_type == FileTypes::TSV || in_type == FileTypes::MRM) |
| 129 | { |
| 130 | Param reader_parameters = getParam_().copy("algorithm:", true); |
| 131 | TransitionTSVFile tsv_reader; |
| 132 | tsv_reader.setLogType(log_type_); |
| 133 | tsv_reader.setParameters(reader_parameters); |
| 134 | tsv_reader.convertTSVToTargetedExperiment(in.c_str(), in_type, targeted_exp); |
| 135 | tsv_reader.validateTargetedExperiment(targeted_exp); |
| 136 | } |
| 137 | else if (in_type == FileTypes::PQP) |
| 138 | { |
| 139 | TransitionPQPFile pqp_reader; |
| 140 | Param reader_parameters = getParam_().copy("algorithm:", true); |
| 141 | pqp_reader.setLogType(log_type_); |
| 142 | pqp_reader.setParameters(reader_parameters); |
| 143 | pqp_reader.convertPQPToTargetedExperiment(in.c_str(), targeted_exp, legacy_traml_id); |
| 144 | pqp_reader.validateTargetedExperiment(targeted_exp); |
nothing calls this directly
no test coverage detected