ProteoWizard
ExtendedReadTest.cpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Robert Burke <robert.burke@proteowizard.org>
6//
7// Copyright 2009 Spielberg Family Center for Applied Proteomics
8// University of Southern California, Los Angeles, California 90033
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21//
22
23#include "IdentDataFile.hpp"
24#include "DefaultReaderList.hpp"
25#include "IO.hpp"
27
28using namespace pwiz::identdata;
29
30const char* filenames[] =
31{
32 "Mascot_MSMS_example.mzid",
33 "omssa_example_full.mzid",
34 "Mascot_mzml_example.mzid",
35 "PMF_example.mzid",
36 "Mascot_N15_example.mzid",
37 "Sequest_example.mzid",
38 "Mascot_NA_example.mzid",
39 "spectraST.mzid",
40 "Mascot_top_down_example.mzid",
41 "xtandem_example_full.mzid",
42 "MPC_example.mzid"
43};
44
45void testFile(const string& inFilepath, const string& outFilepath)
46{
47 cout << "reading file in from " << inFilepath << endl;
48 IdentDataFile mzid(inFilepath);
49
50 cout << "writing file out to " << outFilepath << endl;
51 mzid.write(outFilepath);
52 cout << "done.\n";
53}
54
55
56int main(int argc, char* argv[])
57{
58 TEST_PROLOG(argc, argv)
59
60 try
61 {
62 if (argc == 3)
63 testFile(argv[1], argv[2]);
64 else
65 {
66 cout << "only have " << argc << " arguments:\n";
67 for(int i=0; i<argc; i++)
68 cout << argv[i] << endl;
69 }
70
71 cout << "\nhttps://github.com/ProteoWizard\n"
72 << "support@proteowizard.org\n";
73
74 }
75 catch (exception& e)
76 {
77 TEST_FAILED(e.what())
78 }
79 catch (...)
80 {
81 TEST_FAILED("Caught unknown exception.")
82 }
83
85}
int main(int argc, char *argv[])
const char * filenames[]
void testFile()
IdentData object plus file I/O.
static void write(const IdentData &mzid, const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
static write function for any IdentData object;
#define TEST_EPILOG
Definition unit.hpp:183
#define TEST_FAILED(x)
Definition unit.hpp:177
#define TEST_PROLOG(argc, argv)
Definition unit.hpp:175