75 virtual void Init(
void);
76 virtual int Run(
void);
77 virtual void Exit(
void);
91 arg_desc->PrintUsageIfNoArgs();
94 arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
95 "Convert OMSSA ASN.1 and XML output files to PepXML");
98 arg_desc->AddFlag(
"xml",
"Input file is XML");
99 arg_desc->AddFlag(
"bz2",
"Input file is bzipped XML");
100 arg_desc->AddFlag(
"asn",
"Input file is ASN.1");
101 arg_desc->AddFlag(
"asntext",
"Input file is ASN.1 text");
103 arg_desc->AddOptionalKey(
"o",
"outfile",
104 "filename for pepXML formatted search results",
107 arg_desc->AddPositional
109 "The name of the XML file to load",
129 string filename = args[
"filename"].AsString();
132 string fullpath, path, base, ext;
134 fullpath =
file.GetPath();
142 newname = args[
"o"].AsString();
149 if (args[
"xml"] || args[
"bz2"]) {
152 }
else if (args[
"asn"]) {
155 }
else if (args[
"asntext"]) {
163 }
else if (ext ==
".omx") {
165 }
else if (ext ==
".omt") {
169 cout <<
"Reading " << filename <<
" as ";
172 cout <<
"ASN" << endl;
break;
174 cout <<
"XML" << endl;
break;
176 cout <<
"ASN text" << endl;
break;
178 cout <<
"Unable to determine type of file" << endl;
185 cout <<
"Sorry, this file cannot be converted." << endl;
186 cout <<
"The original search needs to have been executed with the '-w' flag set." << endl;
187 cout <<
"The search settings are not availiable in this file. Aborting" << endl;
205 *xml_out << outPepXML;
225 int main (
int argc,
const char* argv[] )
@MSModSpecSet.hpp User-defined methods of the data storage class.
void CreateArrays(void)
creates arrays for the existing set
virtual void Init(void)
Initialize the application.
COmssa2pepxmlApplication()
virtual int Run(void)
Run the application.
virtual void Exit(void)
Cleanup on application exit.
void ConvertFromOMSSA(CMSSearch &inOMSSA, CRef< CMSModSpecSet > Modset, string basename, string newname)
convert OMSSA to PepXML
static int ReadCompleteSearch(const string &Filename, const ESerialDataFormat DataFormat, bool bz2, CMSSearch &MySearch)
Read in a complete search (typically for an iterative search)
static int ReadModFiles(const string &ModFileName, const string &UserModFileName, const string &Path, CRef< CMSModSpecSet > Modset)
read in modification files.
const string & GetProgramExecutablePath(EFollowLinks follow_links=eIgnoreLinks) const
Get the application's executable path.
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
void SetVersion(const CVersionInfo &version)
Set the version number for the program.
@ eString
An arbitrary string.
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
static string CreateAbsolutePath(const string &path, ERelativeToWhat rtw=eRelativeToCwd)
Get an absolute path from some, possibly relative, path.
static bool IsAbsolutePath(const string &path)
Check if a "path" is absolute for the current OS.
static void SplitPath(const string &path, string *dir=0, string *base=0, string *ext=0)
Split a path string into its basic components.
ESerialDataFormat
Data file format.
@ eSerial_AsnText
ASN.1 text.
@ eSerial_AsnBinary
ASN.1 binary.
void SetReferenceSchema(bool use_schema=true)
Make generated XML document reference XML schema.
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
void SetDefaultSchemaNamespace(const string &schema_ns)
Set default value of namespace name of generated DTD documents.
bool CanGetRequest(void) const
Check if it is safe to call GetRequest method.
Magic spell ;-) needed for some weird compilers... very empiric.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
int main(int argc, const char *argv[])