| 167 | } |
| 168 | |
| 169 | ExitCodes outputTo(ostream& os) |
| 170 | { |
| 171 | //------------------------------------------------------------- |
| 172 | // Parameter handling |
| 173 | //------------------------------------------------------------- |
| 174 | |
| 175 | // File names |
| 176 | String in = getStringOption_("in"); |
| 177 | |
| 178 | // File type |
| 179 | FileHandler fh; |
| 180 | FileTypes::Type in_type = FileTypes::nameToType(getStringOption_("in_type")); |
| 181 | |
| 182 | if (in_type == FileTypes::UNKNOWN) |
| 183 | { |
| 184 | in_type = fh.getType(in); |
| 185 | writeDebug_(String("Input file type: ") + FileTypes::typeToName(in_type), 2); |
| 186 | } |
| 187 | |
| 188 | if (in_type == FileTypes::UNKNOWN) |
| 189 | { |
| 190 | writeLogError_("Error: Could not determine input file type!"); |
| 191 | return PARSE_ERROR; |
| 192 | } |
| 193 | |
| 194 | PeakMap exp; |
| 195 | FeatureMap feat; |
| 196 | ConsensusMap cons; |
| 197 | |
| 198 | if (in_type == FileTypes::FEATUREXML) //features |
| 199 | { |
| 200 | FeatureXMLFile().load(in, feat); |
| 201 | feat.updateRanges(); |
| 202 | } |
| 203 | else if (in_type == FileTypes::CONSENSUSXML) //consensus features |
| 204 | { |
| 205 | ConsensusXMLFile().load(in, cons); |
| 206 | cons.updateRanges(); |
| 207 | } |
| 208 | |
| 209 | //------------------------------------------------------------- |
| 210 | // meta information |
| 211 | //------------------------------------------------------------- |
| 212 | if (getFlag_("m")) |
| 213 | { |
| 214 | os << endl |
| 215 | << "-- General information --" << endl |
| 216 | << endl |
| 217 | << "file name: " << in << endl |
| 218 | << "file type: " << FileTypes::typeToName(in_type) << endl; |
| 219 | |
| 220 | //basic info |
| 221 | os << endl |
| 222 | << "-- Meta information --" << endl |
| 223 | << endl; |
| 224 | |
| 225 | if (in_type == FileTypes::FEATUREXML) //features |
| 226 | { |
nothing calls this directly
no test coverage detected