void registerOptionsAndFlags_() { registerInputFile_("in", "<file>", "", "featureXML or consensusXML file"); setValidFormats_("in", ListUtils::create<String>("featureXML,consensusXML")); registerOutputFile_("out", "<file>", "", "mzTab file"); setValidFormats_("out", ListUtils::create<String>("csv")); registerOutputFile_("out_annotation", "<file>", "", "A copy of the input file, annotated with matching hits from the database.", false); setValidFormats_("out_annotation", ListUtils::create<String>("featureXML,consensusXML")); // move some params from algorithm section to top level (to support input file functionality) Param p = AccurateMassSearchEngine().getDefaults(); registerTOPPSubsection_("db", "Database files which contain the identifications"); registerInputFile_("db:mapping", "<file>", p.getValue("db:mapping"), p.getDescription("db:mapping"), true, false, ListUtils::create<String>("skipexists")); setValidFormats_("db:mapping", ListUtils::create<String>("tsv")); registerInputFile_("db:struct", "<file>", p.getValue("db:struct"), p.getDescription("db:struct"), true, false, ListUtils::create<String>("skipexists")); setValidFormats_("db:struct", ListUtils::create<String>("tsv")); registerInputFile_("positive_adducts_file", "<file>", p.getValue("positive_adducts_file"), p.getDescription("positive_adducts_file"), true, false, ListUtils::create<String>("skipexists")); setValidFormats_("positive_adducts_file", ListUtils::create<String>("tsv")); registerInputFile_("negative_adducts_file", "<file>", p.getValue("negative_adducts_file"), p.getDescription("negative_adducts_file"), true, false, ListUtils::create<String>("skipexists")); setValidFormats_("negative_adducts_file", ListUtils::create<String>("tsv")); // addEmptyLine_(); // addText_("Parameters for the accurate mass search can be given in the 'algorithm' part of INI file."); registerSubsection_("algorithm", "Algorithm parameters section"); }
Param p300; TEST_EXCEPTION(Exception::UnableToCreateFile, paramFile.store("/does/not/exist/FileDoesNotExist.xml",p300)) String filename; NEW_TMP_FILE(filename); paramFile.store(filename,p2); Param p3; paramFile.load(filename,p3); TEST_REAL_SIMILAR(float(p2.getValue("test:float")), float(p3.getValue("test:float"))) TEST_EQUAL(p2.getValue("test:string"), p3.getValue("test:string")) TEST_EQUAL(p2.getValue("test:int"), p3.getValue("test:int")) TEST_REAL_SIMILAR(float(p2.getValue("test2:float")), float(p3.getValue("test2:float"))) TEST_EQUAL(p2.getValue("test2:string"), p3.getValue("test2:string")) TEST_EQUAL(p2.getValue("test2:int"), p3.getValue("test2:int")) TEST_STRING_EQUAL(p2.getDescription("test:float"), p3.getDescription("test:float")) TEST_STRING_EQUAL(p2.getDescription("test:string"), p3.getDescription("test:string")) TEST_STRING_EQUAL(p2.getDescription("test:int"), p3.getDescription("test:int")) TEST_EQUAL(p3.getSectionDescription("test"),"sectiondesc") TEST_EQUAL(p3.getDescription("test:a:a1"),"a1desc\"<>\nnewline") TEST_EQUAL(p3.getSectionDescription("test:b"),"bdesc\"<>\nnewline") TEST_EQUAL(p3.getSectionDescription("test2:a"),"adesc") TEST_EQUAL(p3.hasTag("test2:b:b1","advanced"),true) TEST_EQUAL(p3.hasTag("test2:a:a1","advanced"),false) TEST_EQUAL(ParamXMLFile().isValid(filename, std::cerr),true) //advanced NEW_TMP_FILE(filename); Param p7; p7.setValue("true",5,"",ListUtils::create<String>("advanced")); p7.setValue("false",5,"");