mgfp-devel Mailing List for MGFp
Brought to you by:
mkirchner
You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(6) |
Oct
(8) |
Nov
|
Dec
|
---|
From: <mki...@us...> - 2010-10-10 14:22:27
|
Revision: 47 http://mgfp.svn.sourceforge.net/mgfp/?rev=47&view=rev Author: mkirchner Date: 2010-10-10 14:22:20 +0000 (Sun, 10 Oct 2010) Log Message: ----------- - updated documentation Modified Paths: -------------- trunk/mgfp/doc/Mainpage.h trunk/mgfp/doc/mgf_grammar.txt Modified: trunk/mgfp/doc/Mainpage.h =================================================================== --- trunk/mgfp/doc/Mainpage.h 2010-10-10 13:52:29 UTC (rev 46) +++ trunk/mgfp/doc/Mainpage.h 2010-10-10 14:22:20 UTC (rev 47) @@ -8,6 +8,8 @@ MGF processing tools: \li mgfvalidate -- validates a given MGF file +\li rix -- reporter ion extractor for iTRAQ4 and TMT +\li ms2preproc -- MGF preprocessing tool (see below) The <a href="http://steenlab.org">Steen \& Steen Lab</a> provides the library under the terms of a BSD license for use in academic and @@ -18,14 +20,14 @@ If you make use of \c mgfp in your own projects, please cite the following article:<br> -Kirchner M, Steen JAJ, Hamprecht FA, Steen H (2010). +\li Kirchner M, Steen JAJ, Hamprecht FA, Steen H (2010). MGFp: An open Mascot Generic Format parser library implementation. <i>Journal of Proteome Research, 9(5):2762-2763 (2010)</i>. [<a href="http://www.ncbi.nlm.nih.gov/pubmed/20334363">PubMed entry</a>] -If you use ms2preproc in your data analysis pipeline, please cite<br> +If you use \c ms2preproc in your data analysis pipeline, please cite<br> -Renard BY, Kirchner M, Monigatti F, Invanov AR, Rappsilber J, +\li Renard BY, Kirchner M, Monigatti F, Invanov AR, Rappsilber J, Winter D, Steen JAJ, Hamprecht FA, Steen H, When Less Can Yield More - Computational Preprocessing of MS/MS Spectra for Peptide Identification, <i>Proteomics 9(21):4978-4984 (2009)</i>. @@ -39,11 +41,6 @@ \li the MGFp project page at sourceforge: http://mgfp.sf.net . -Additional information is available on - -\li the Steen Lab page at http://steenlab.org/ -\li the Steen Lab software page at http://software.steenlab.org/ - \subsection sec_install_src Building from Source Building \c mgfp from source is straightforward. However, it requires a working CMake build system (available from http://cmake.org/) and CMake >= 2.6. Modified: trunk/mgfp/doc/mgf_grammar.txt =================================================================== --- trunk/mgfp/doc/mgf_grammar.txt 2010-10-10 13:52:29 UTC (rev 46) +++ trunk/mgfp/doc/mgf_grammar.txt 2010-10-10 14:22:20 UTC (rev 47) @@ -23,65 +23,76 @@ 16 | blocks block 17 block: "begin_ions keyword" "end of line" localparams ions "end_ions keyword" "end of line" + 18 | "begin_ions keyword" "end of line" localparams "end_ions keyword" "end of line" - 18 globalparams: /* empty */ - 19 | globalparams globalparam + 19 globalparams: /* empty */ + 20 | globalparams globalparam - 20 globalparam: "enzyme keyword" '=' "string" "end of line" - 21 | "search title keyword" '=' "string" "end of line" - 22 | "database keyword" '=' "string" "end of line" - 23 | "MS/MS datafile format keyword" '=' "string" "end of line" - 24 | "MS/MS ion series keyword" '=' "string" "end of line" - 25 | "variable modifications keyword" '=' "string" "end of line" - 26 | "units for ITOL keyword" '=' "string" "end of line" - 27 | "mass type (mono or avg) keyword" '=' "string" "end of line" - 28 | "fixed modifications keyword" '=' "string" "end of line" - 29 | "quantitation method keyword" '=' "string" "end of line" - 30 | "maximum hits keyword" '=' "string" "end of line" - 31 | "type of report keyword" '=' "string" "end of line" - 32 | "type of search keyword" '=' "string" "end of line" - 33 | "taxonomy keyword" '=' "string" "end of line" - 34 | "tolerance units keyword" '=' "string" "end of line" - 35 | "user keyword" '=' "string" "end of line" - 36 | "user email keyword" '=' "string" "end of line" - 37 | "username keyword" '=' "string" "end of line" - 38 | "perform decoy search keyword" '=' "integer" "end of line" - 39 | "error tolerance keyword" '=' "integer" "end of line" - 40 | "partials keyword" '=' "integer" "end of line" - 41 | "fragment ion tolerance keyword" '=' "double" "end of line" - 42 | "fragment ion tolerance keyword" '=' "integer" "end of line" - 43 | "misassigned 13C keyword" '=' "double" "end of line" - 44 | "precursor m/z keyword" '=' "double" "end of line" - 45 | "protein mass (kDa) keyword" '=' "double" "end of line" - 46 | "peptide mass tolerance keyword" '=' "double" "end of line" - 47 | "peptide mass tolerance keyword" '=' "integer" "end of line" - 48 | "charge set keyword" '=' charges "end of line" - 49 | "NA translation keyword" '=' csintegerlist "end of line" - 50 | "comment" "end of line" + 21 globalparam: "enzyme keyword" '=' "string" "end of line" + 22 | "search title keyword" '=' "string" "end of line" + 23 | "database keyword" '=' "string" "end of line" + 24 | "MS/MS datafile format keyword" '=' "string" "end of line" + 25 | "MS/MS ion series keyword" '=' "string" "end of line" + 26 | "variable modifications keyword" '=' "string" "end of line" + 27 | "units for ITOL keyword" '=' "string" "end of line" + 28 | "mass type (mono or avg) keyword" '=' "string" "end of line" + 29 | "fixed modifications keyword" '=' "string" "end of line" + 30 | "quantitation method keyword" '=' "string" "end of line" + 31 | "maximum hits keyword" '=' "string" "end of line" + 32 | "type of report keyword" '=' "string" "end of line" + 33 | "type of search keyword" '=' "string" "end of line" + 34 | "taxonomy keyword" '=' "string" "end of line" + 35 | "tolerance units keyword" '=' "string" "end of line" + 36 | "user keyword" '=' "string" "end of line" + 37 | "user email keyword" '=' "string" "end of line" + 38 | "username keyword" '=' "string" "end of line" + 39 | "perform decoy search keyword" '=' "integer" "end of line" + 40 | "error tolerance keyword" '=' "integer" "end of line" + 41 | "partials keyword" '=' "integer" "end of line" + 42 | "fragment ion tolerance keyword" '=' "double" "end of line" + 43 | "fragment ion tolerance keyword" '=' "integer" "end of line" + 44 | "misassigned 13C keyword" '=' "double" "end of line" + 45 | "precursor m/z keyword" '=' "double" "end of line" + 46 | "precursor m/z keyword" '=' "integer" "end of line" + 47 | "protein mass (kDa) keyword" '=' "double" "end of line" + 48 | "protein mass (kDa) keyword" '=' "integer" "end of line" + 49 | "peptide mass tolerance keyword" '=' "double" "end of line" + 50 | "peptide mass tolerance keyword" '=' "integer" "end of line" + 51 | "charge set keyword" '=' charges "end of line" + 52 | "NA translation keyword" '=' csintegerlist "end of line" + 53 | "comment" "end of line" - 51 localparams: /* empty */ - 52 | localparams localparam + 54 localparams: /* empty */ + 55 | localparams localparam - 53 localparam: "title keyword and full title string" "end of line" - 54 | "amino acid composition keyword" '=' "string" "end of line" - 55 | "MS/MS ion series keyword" '=' "string" "end of line" - 56 | "variable modifications keyword" '=' "string" "end of line" - 57 | "retention time or range keyword" '=' "double" "end of line" - 58 | "scan number of range keyword" '=' "string" "end of line" - 59 | "tolerance units keyword" '=' "string" "end of line" - 60 | "amino acid sequence keyword" '=' "string" "end of line" - 61 | "sequence tag keyword" '=' "string" "end of line" - 62 | "error tolerant sequence keyword" '=' "string" "end of line" - 63 | "peptide mass tolerance keyword" '=' "double" "end of line" - 64 | "peptide mass tolerance keyword" '=' "integer" "end of line" - 65 | "charge set keyword" '=' charges "end of line" - 66 | "precursor mass keyword" '=' "double" "end of line" - 67 | "precursor mass keyword" '=' "double" "double" "end of line" - 68 | "precursor mass keyword" '=' "integer" "end of line" - 69 | "precursor mass keyword" '=' "integer" "integer" "end of line" - 70 | "comment" "end of line" + 56 localparam: "title keyword and full title string" "end of line" + 57 | "amino acid composition keyword" '=' "string" "end of line" + 58 | "MS/MS ion series keyword" '=' "string" "end of line" + 59 | "variable modifications keyword" '=' "string" "end of line" + 60 | "retention time or range keyword" '=' "double" "end of line" + 61 | "retention time or range keyword" '=' "integer" "end of line" + 62 | "retention time or range keyword" '=' "double" '-' "double" "end of line" + 63 | "retention time or range keyword" '=' "double" '-' "integer" "end of line" + 64 | "retention time or range keyword" '=' "integer" '-' "double" "end of line" + 65 | "retention time or range keyword" '=' "integer" '-' "integer" "end of line" + 66 | "scan number of range keyword" '=' "integer" "end of line" + 67 | "scan number of range keyword" '=' "integer" '-' "integer" "end of line" + 68 | "tolerance units keyword" '=' "string" "end of line" + 69 | "amino acid sequence keyword" '=' "string" "end of line" + 70 | "sequence tag keyword" '=' "string" "end of line" + 71 | "error tolerant sequence keyword" '=' "string" "end of line" + 72 | "peptide mass tolerance keyword" '=' "double" "end of line" + 73 | "peptide mass tolerance keyword" '=' "integer" "end of line" + 74 | "charge set keyword" '=' charges "end of line" + 75 | "precursor mass keyword" '=' "double" "end of line" + 76 | "precursor mass keyword" '=' "double" "double" "end of line" + 77 | "precursor mass keyword" '=' "double" "integer" "end of line" + 78 | "precursor mass keyword" '=' "integer" "end of line" + 79 | "precursor mass keyword" '=' "integer" "double" "end of line" + 80 | "precursor mass keyword" '=' "integer" "integer" "end of line" + 81 | "comment" "end of line" - 71 contents: globalparams blocks "end of file" + 82 contents: globalparams blocks "end of file" - 72 start: contents + 83 start: contents This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-10-10 13:52:35
|
Revision: 46 http://mgfp.svn.sourceforge.net/mgfp/?rev=46&view=rev Author: mkirchner Date: 2010-10-10 13:52:29 +0000 (Sun, 10 Oct 2010) Log Message: ----------- removing windows.h and fixing linux build Modified Paths: -------------- trunk/mgfp/test/include/mgfpunittest.h.in Removed Paths: ------------- trunk/mgfp/test/include/vigra/windows.h Modified: trunk/mgfp/test/include/mgfpunittest.h.in =================================================================== --- trunk/mgfp/test/include/mgfpunittest.h.in 2010-10-10 13:37:54 UTC (rev 45) +++ trunk/mgfp/test/include/mgfpunittest.h.in 2010-10-10 13:52:29 UTC (rev 46) @@ -1,7 +1,6 @@ #ifndef __MGFPUNITTEST_H__ #define __MGFPUNITTEST_H__ -#include "windows.h" // from VIGRA #include "unittest.hxx" // from VIGRA #include <string> Deleted: trunk/mgfp/test/include/vigra/windows.h =================================================================== --- trunk/mgfp/test/include/vigra/windows.h 2010-10-10 13:37:54 UTC (rev 45) +++ trunk/mgfp/test/include/vigra/windows.h 2010-10-10 13:52:29 UTC (rev 46) @@ -1,59 +0,0 @@ -/************************************************************************/ -/* */ -/* Copyright 2002-2003 by Ullrich Koethe */ -/* Cognitive Systems Group, University of Hamburg, Germany */ -/* */ -/* This file is part of the VIGRA computer vision library. */ -/* The VIGRA Website is */ -/* http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/ */ -/* Please direct questions, bug reports, and contributions to */ -/* ull...@iw... or */ -/* vi...@in... */ -/* */ -/* Permission is hereby granted, free of charge, to any person */ -/* obtaining a copy of this software and associated documentation */ -/* files (the "Software"), to deal in the Software without */ -/* restriction, including without limitation the rights to use, */ -/* copy, modify, merge, publish, distribute, sublicense, and/or */ -/* sell copies of the Software, and to permit persons to whom the */ -/* Software is furnished to do so, subject to the following */ -/* conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the */ -/* Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */ -/* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */ -/* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */ -/* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */ -/* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */ -/* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */ -/* OTHER DEALINGS IN THE SOFTWARE. */ -/* */ -/************************************************************************/ - -#ifndef VIGRA_WINDOWS_H -#define VIGRA_WINDOWS_H - -// prevent the global namespace to become polluted with -// badly named Windows macros - -#if defined(_WIN32) -# define VC_EXTRALEAN -# ifndef NOMINMAX -# define NOMINMAX -# define _VIGRA_UNDEFINE_NOMINMAX -# endif -# include <windows.h> -# ifdef _VIGRA_UNDEFINE_NOMINMAX -# undef NOMINMAX -# undef _VIGRA_UNDEFINE_NOMINMAX -# endif -# ifdef DIFFERENCE -# undef DIFFERENCE -# endif -#endif - -#endif /* VIGRA_WINDOWS_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-10-10 13:38:01
|
Revision: 45 http://mgfp.svn.sourceforge.net/mgfp/?rev=45&view=rev Author: mkirchner Date: 2010-10-10 13:37:54 +0000 (Sun, 10 Oct 2010) Log Message: ----------- - fixed windows compilations - windows packages now correctly package binaries Modified Paths: -------------- trunk/mgfp/applications/ms2preproc/CMakeLists.txt trunk/mgfp/applications/rix/CMakeLists.txt trunk/mgfp/applications/rix/rix.cpp trunk/mgfp/include/mgfp/config.h.cmake trunk/mgfp/test/include/mgfpunittest.h.in Modified: trunk/mgfp/applications/ms2preproc/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/ms2preproc/CMakeLists.txt 2010-10-10 12:40:29 UTC (rev 44) +++ trunk/mgfp/applications/ms2preproc/CMakeLists.txt 2010-10-10 13:37:54 UTC (rev 45) @@ -20,7 +20,9 @@ SET(SRCS_MS2PREPROC ms2preproc.cpp) ADD_EXECUTABLE(ms2preproc ${SRCS_MS2PREPROC}) TARGET_LINK_LIBRARIES(ms2preproc mgfp ${Boost_PROGRAM_OPTIONS_LIBRARY}) - INSTALL(TARGETS ms2preproc RUNTIME DESTINATION bin) + INSTALL(TARGETS ms2preproc RUNTIME + DESTINATION bin + COMPONENT applications) ELSE(Boost_PROGRAM_OPTIONS_FOUND) MESSAGE(STATUS "Could not find BOOST program_options. Skipping ${CMAKE_CURRENT_SOURCE_DIR}.") ENDIF(Boost_PROGRAM_OPTIONS_FOUND) Modified: trunk/mgfp/applications/rix/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/rix/CMakeLists.txt 2010-10-10 12:40:29 UTC (rev 44) +++ trunk/mgfp/applications/rix/CMakeLists.txt 2010-10-10 13:37:54 UTC (rev 45) @@ -16,7 +16,9 @@ SET(SRCS_RIX rix.cpp) ADD_EXECUTABLE(rix ${SRCS_RIX}) TARGET_LINK_LIBRARIES(rix mgfp ${Boost_PROGRAM_OPTIONS_LIBRARY}) - INSTALL(TARGETS rix RUNTIME DESTINATION bin) + INSTALL(TARGETS rix RUNTIME + DESTINATION bin + COMPONENT applications) ELSE(Boost_PROGRAM_OPTIONS_FOUND) MESSAGE(STATUS "Could not find BOOST program_options. Skipping ${CMAKE_CURRENT_SOURCE_DIR}.") ENDIF(Boost_PROGRAM_OPTIONS_FOUND) Modified: trunk/mgfp/applications/rix/rix.cpp =================================================================== --- trunk/mgfp/applications/rix/rix.cpp 2010-10-10 12:40:29 UTC (rev 44) +++ trunk/mgfp/applications/rix/rix.cpp 2010-10-10 13:37:54 UTC (rev 45) @@ -1,6 +1,6 @@ /*$Id$*/ /* - * tmtx.cpp + * rix.cpp * * Copyright (c) 2010 Marc Kirchner <mar...@ch...> * @@ -26,7 +26,11 @@ #include <iomanip> #include <iostream> #include <iterator> +#ifdef _MSC_VER +#include <array> +#else #include <tr1/array> +#endif #include <boost/program_options.hpp> #include <mgfp/mgfp.h> @@ -62,11 +66,12 @@ } return pos1; } + return end; } -enum LabelType { TMT, ITRAQ4, SIZE }; -static const size_t sizes[SIZE] = { 10, 8 }; -static const double masses[SIZE][10] = +enum LabelType { TMT, ITRAQ4, LabelTypeSIZE }; +static const size_t sizes[LabelTypeSIZE] = { 10, 8 }; +static const double masses[LabelTypeSIZE][10] = { { 124.0, 125.0, 126.0, 127.0, 128.0, 129.0, 130.0, 131.0, 132.0, 133.0 }, Modified: trunk/mgfp/include/mgfp/config.h.cmake =================================================================== --- trunk/mgfp/include/mgfp/config.h.cmake 2010-10-10 12:40:29 UTC (rev 44) +++ trunk/mgfp/include/mgfp/config.h.cmake 2010-10-10 13:37:54 UTC (rev 45) @@ -1,9 +1,9 @@ #ifndef __MGFP_INCLUDE_CONFIG_H__ #define __MGFP_INCLUDE_CONFIG_H__ -//#ifdef _MSC_VER -// #include "winsock2.h" -//#endif +#ifdef _MSC_VER +#define NOMINMAX +#endif #ifdef min #undef min Modified: trunk/mgfp/test/include/mgfpunittest.h.in =================================================================== --- trunk/mgfp/test/include/mgfpunittest.h.in 2010-10-10 12:40:29 UTC (rev 44) +++ trunk/mgfp/test/include/mgfpunittest.h.in 2010-10-10 13:37:54 UTC (rev 45) @@ -1,6 +1,7 @@ #ifndef __MGFPUNITTEST_H__ #define __MGFPUNITTEST_H__ +#include "windows.h" // from VIGRA #include "unittest.hxx" // from VIGRA #include <string> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-10-10 12:40:35
|
Revision: 44 http://mgfp.svn.sourceforge.net/mgfp/?rev=44&view=rev Author: mkirchner Date: 2010-10-10 12:40:29 +0000 (Sun, 10 Oct 2010) Log Message: ----------- added install component descriptions Modified Paths: -------------- trunk/mgfp/applications/mgfvalidate/CMakeLists.txt trunk/mgfp/src/CMakeLists.txt Modified: trunk/mgfp/applications/mgfvalidate/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/mgfvalidate/CMakeLists.txt 2010-10-10 12:20:22 UTC (rev 43) +++ trunk/mgfp/applications/mgfvalidate/CMakeLists.txt 2010-10-10 12:40:29 UTC (rev 44) @@ -20,7 +20,9 @@ SET(SRCS_MGFVALIDATE mgfvalidate.cpp) ADD_EXECUTABLE(mgfvalidate ${SRCS_MGFVALIDATE}) TARGET_LINK_LIBRARIES(mgfvalidate mgfp ${Boost_PROGRAM_OPTIONS_LIBRARY}) - INSTALL(TARGETS mgfvalidate RUNTIME DESTINATION bin) + INSTALL(TARGETS mgfvalidate RUNTIME + DESTINATION bin + COMPONENT applications) ELSE(Boost_PROGRAM_OPTIONS_FOUND) MESSAGE(STATUS "Could not find BOOST program_options. Skipping ${CMAKE_CURRENT_SOURCE_DIR}.") ENDIF(Boost_PROGRAM_OPTIONS_FOUND) Modified: trunk/mgfp/src/CMakeLists.txt =================================================================== --- trunk/mgfp/src/CMakeLists.txt 2010-10-10 12:20:22 UTC (rev 43) +++ trunk/mgfp/src/CMakeLists.txt 2010-10-10 12:40:29 UTC (rev 44) @@ -18,5 +18,6 @@ INSTALL(TARGETS mgfp RUNTIME DESTINATION bin LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + ARCHIVE DESTINATION lib + COMPONENT libraries) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-10-10 12:20:28
|
Revision: 43 http://mgfp.svn.sourceforge.net/mgfp/?rev=43&view=rev Author: mkirchner Date: 2010-10-10 12:20:22 +0000 (Sun, 10 Oct 2010) Log Message: ----------- added windows.h (VIGRA) Added Paths: ----------- trunk/mgfp/test/include/vigra/windows.h Added: trunk/mgfp/test/include/vigra/windows.h =================================================================== --- trunk/mgfp/test/include/vigra/windows.h (rev 0) +++ trunk/mgfp/test/include/vigra/windows.h 2010-10-10 12:20:22 UTC (rev 43) @@ -0,0 +1,59 @@ +/************************************************************************/ +/* */ +/* Copyright 2002-2003 by Ullrich Koethe */ +/* Cognitive Systems Group, University of Hamburg, Germany */ +/* */ +/* This file is part of the VIGRA computer vision library. */ +/* The VIGRA Website is */ +/* http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/ */ +/* Please direct questions, bug reports, and contributions to */ +/* ull...@iw... or */ +/* vi...@in... */ +/* */ +/* Permission is hereby granted, free of charge, to any person */ +/* obtaining a copy of this software and associated documentation */ +/* files (the "Software"), to deal in the Software without */ +/* restriction, including without limitation the rights to use, */ +/* copy, modify, merge, publish, distribute, sublicense, and/or */ +/* sell copies of the Software, and to permit persons to whom the */ +/* Software is furnished to do so, subject to the following */ +/* conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the */ +/* Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */ +/* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */ +/* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */ +/* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */ +/* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */ +/* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */ +/* OTHER DEALINGS IN THE SOFTWARE. */ +/* */ +/************************************************************************/ + +#ifndef VIGRA_WINDOWS_H +#define VIGRA_WINDOWS_H + +// prevent the global namespace to become polluted with +// badly named Windows macros + +#if defined(_WIN32) +# define VC_EXTRALEAN +# ifndef NOMINMAX +# define NOMINMAX +# define _VIGRA_UNDEFINE_NOMINMAX +# endif +# include <windows.h> +# ifdef _VIGRA_UNDEFINE_NOMINMAX +# undef NOMINMAX +# undef _VIGRA_UNDEFINE_NOMINMAX +# endif +# ifdef DIFFERENCE +# undef DIFFERENCE +# endif +#endif + +#endif /* VIGRA_WINDOWS_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-10-10 11:09:34
|
Revision: 42 http://mgfp.svn.sourceforge.net/mgfp/?rev=42&view=rev Author: mkirchner Date: 2010-10-10 11:09:27 +0000 (Sun, 10 Oct 2010) Log Message: ----------- updated package description in cpack. Modified Paths: -------------- trunk/mgfp/CMakeLists.txt Modified: trunk/mgfp/CMakeLists.txt =================================================================== --- trunk/mgfp/CMakeLists.txt 2010-10-10 11:08:53 UTC (rev 41) +++ trunk/mgfp/CMakeLists.txt 2010-10-10 11:09:27 UTC (rev 42) @@ -10,7 +10,7 @@ # versioning ############################################################################# set(VERSION_MAJOR 2) -set(VERSION_MINOR 0) +set(VERSION_MINOR 1) # get SVN revision EXECUTE_PROCESS( @@ -106,7 +106,7 @@ # generated prior to packaging! set(CPACK_PACKAGE_NAME "mgfp") -set(CPACK_PACKAGE_VENDOR "steenlab.org") +set(CPACK_PACKAGE_VENDOR "mgfp.sf.net.org") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MGF Parser") @@ -125,7 +125,7 @@ set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "C++ Interface Documentation") set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION - "A simple MGF validator.") + "A simple MGF validator, TMT/iTRAQ reporter ion extraction and MGF preprocessing tools.") set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Static libraries necessary used to build programs with MGFp.") set(CPACK_COMPONENT_HEADERS_DESCRIPTION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-10-10 11:08:59
|
Revision: 41 http://mgfp.svn.sourceforge.net/mgfp/?rev=41&view=rev Author: mkirchner Date: 2010-10-10 11:08:53 +0000 (Sun, 10 Oct 2010) Log Message: ----------- moved tmtx to rix: the reporter ion extraction now supports iTRAQ as well and the name is misleading Modified Paths: -------------- trunk/mgfp/applications/CMakeLists.txt trunk/mgfp/applications/rix/CMakeLists.txt Added Paths: ----------- trunk/mgfp/applications/rix/ trunk/mgfp/applications/rix/rix.cpp Removed Paths: ------------- trunk/mgfp/applications/rix/tmtx.cpp trunk/mgfp/applications/tmtx/ Modified: trunk/mgfp/applications/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/CMakeLists.txt 2010-10-10 10:58:58 UTC (rev 40) +++ trunk/mgfp/applications/CMakeLists.txt 2010-10-10 11:08:53 UTC (rev 41) @@ -1,4 +1,4 @@ ADD_SUBDIRECTORY(mgfvalidate) ADD_SUBDIRECTORY(ms2preproc) -ADD_SUBDIRECTORY(tmtx) +ADD_SUBDIRECTORY(rix) Modified: trunk/mgfp/applications/rix/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/tmtx/CMakeLists.txt 2010-09-10 15:35:49 UTC (rev 39) +++ trunk/mgfp/applications/rix/CMakeLists.txt 2010-10-10 11:08:53 UTC (rev 41) @@ -4,7 +4,7 @@ ${MGFP_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR} ) -# this requres BOOST +# this requires BOOST IF(MSVC) SET(Boost_USE_STATIC_LIBS ON) SET(Boost_USE_MULTITHREAD OFF) @@ -13,10 +13,10 @@ IF(Boost_PROGRAM_OPTIONS_FOUND) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) - SET(SRCS_TMTX tmtx.cpp) - ADD_EXECUTABLE(tmtx ${SRCS_TMTX}) - TARGET_LINK_LIBRARIES(tmtx mgfp ${Boost_PROGRAM_OPTIONS_LIBRARY}) - INSTALL(TARGETS tmtx RUNTIME DESTINATION bin) + SET(SRCS_RIX rix.cpp) + ADD_EXECUTABLE(rix ${SRCS_RIX}) + TARGET_LINK_LIBRARIES(rix mgfp ${Boost_PROGRAM_OPTIONS_LIBRARY}) + INSTALL(TARGETS rix RUNTIME DESTINATION bin) ELSE(Boost_PROGRAM_OPTIONS_FOUND) MESSAGE(STATUS "Could not find BOOST program_options. Skipping ${CMAKE_CURRENT_SOURCE_DIR}.") ENDIF(Boost_PROGRAM_OPTIONS_FOUND) Copied: trunk/mgfp/applications/rix/rix.cpp (from rev 39, trunk/mgfp/applications/tmtx/tmtx.cpp) =================================================================== --- trunk/mgfp/applications/rix/rix.cpp (rev 0) +++ trunk/mgfp/applications/rix/rix.cpp 2010-10-10 11:08:53 UTC (rev 41) @@ -0,0 +1,173 @@ +/*$Id$*/ +/* + * tmtx.cpp + * + * Copyright (c) 2010 Marc Kirchner <mar...@ch...> + * + * This file is part of mgfp. + * + * mgfp is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ms++ is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ms++. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <cmath> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <iterator> +#include <tr1/array> +#include <boost/program_options.hpp> +#include <mgfp/mgfp.h> + +mgf::MgfSpectrum::iterator findClosestMz(mgf::MgfSpectrum::iterator begin, + mgf::MgfSpectrum::iterator end, double referenceMz) +{ + // at least one entry? + if (begin == end) + return end; + // find first entry that is equal or greater than the reference mz + typedef mgf::MgfSpectrum::iterator MSI; + MSI pos1 = std::lower_bound(begin, end, referenceMz, mgf::LessThanMz()); + double dist1 = 0.0; + if (pos1 != end) { + // found equal or greater + dist1 = pos1->first - referenceMz; + if (pos1 == begin || dist1 == 0.0) { + return pos1; + } + } else { + // return the last entry in the sequence + pos1 = begin; + std::advance(pos1, std::distance(begin, end) - 1); + return pos1; + } + // check if the distance to the previous iterator position + if (pos1 != begin) { + MSI pos2 = begin; + std::advance(pos2, std::distance(begin, pos1) - 1); + double dist2 = referenceMz - pos2->first; + if (dist2 < dist1) { + return pos2; + } + return pos1; + } +} + +enum LabelType { TMT, ITRAQ4, SIZE }; +static const size_t sizes[SIZE] = { 10, 8 }; +static const double masses[SIZE][10] = + { + { 124.0, 125.0, 126.0, 127.0, 128.0, + 129.0, 130.0, 131.0, 132.0, 133.0 }, + { 112.1, 113.1, 114.1112, 115.1083, 116.1116, + 117.115, 118.1, 119.1, 0.0, 0.0 }}; + +int main(int argc, char *argv[]) +{ + namespace po = boost::program_options; + po::options_description desc("Allowed options"); + bool verbose = false; + std::string inputfile; + size_t precision; + desc.add_options() + ("help,h", "produce help message") + ("verbose,v", po::value(&verbose)->zero_tokens(), + "verbose output (good to pinpoint parsing errors)") + ("type,t", po::value<std::string>(), "label type: one of TMT, ITRAQ4") + ("input,i", po::value<std::string>(&inputfile)->default_value("-"), + "input filename, defaults to stdin") + /* + ("tee,e", po::value<std::string>(), "run in tee mode: extract label " + "abundances to specified file and simply pipe MGF data from stdin " + "to stdout.") + */ + ("precision,p", po::value<size_t>(&precision)->default_value(6), + "number of significant digits in output") + ; + po::variables_map vm; + po::store(po::parse_command_line(argc, argv, desc), vm); + po::notify(vm); + // check if the user asked for help + if (vm.count("help") || !vm.count("type")) { + std::cerr << desc; + return 1; + } + // figure put which labeling technique we use + LabelType labelType; + if (vm["type"].as<std::string>() == "TMT") { + labelType = TMT; + } else if (vm["type"].as<std::string>() == "ITRAQ4") { + labelType = ITRAQ4; + } else { + std::cerr << vm["type"].as<std::string>() << std::endl; + std::cerr << desc; + return 1; + } + // initialize the masses + std::vector<double> labelMasses(sizes[labelType]); + for (size_t n = 0; n < sizes[labelType]; ++n) { + labelMasses[n] = masses[labelType][n]; + } + // prepare the parser + mgf::MgfFile m; + mgf::Driver driver(m); + driver.trace_parsing = verbose; + driver.trace_scanning = verbose; + // parse input + bool result; + if (inputfile == "-") { + result = driver.parse_stream(std::cin); + } else { + std::ifstream ifs(inputfile.c_str()); + result = driver.parse_stream(ifs); + ifs.close(); + } + if (!result) { + std::cerr << std::endl + << "Error parsing data stream (use -v for details)." << std::endl; + return -1; + } + typedef mgf::MgfFile::iterator MFI; + // iterate over all spectra + std::vector<double> obsAbundances(sizes[labelType]); + for (MFI i = m.begin(); i != m.end(); ++i) { + // sort + std::sort(i->begin(), i->end(), mgf::LessThanMz()); + typedef mgf::MgfSpectrum::iterator MSI; + // extract TMT reproter ion intensities + bool atLeastOneEntry = false; + for (size_t n = 0; n < sizes[labelType]; ++n) { + MSI closestIt = findClosestMz(i->begin(), i->end(), labelMasses[n]); + if (closestIt != i->end()) { + // check if there is an MS2 centroid + if (std::abs(closestIt->first - labelMasses[n]) < 0.4) { + obsAbundances[n] = closestIt->second; + if (!atLeastOneEntry) atLeastOneEntry = true; + } else { + obsAbundances[n] = 0.0; + } + } + } + // extract into file + if (atLeastOneEntry) { + std::cout << i->getTITLE(); + for (size_t n = 0; n < sizes[labelType]; ++n) { + std::cout << '\t' << std::setprecision(precision) << obsAbundances[n]; + } + std::cout << '\n'; // don't use std::endl, save the std::flush. + } + } + return 0; +} + Deleted: trunk/mgfp/applications/rix/tmtx.cpp =================================================================== --- trunk/mgfp/applications/tmtx/tmtx.cpp 2010-09-10 15:35:49 UTC (rev 39) +++ trunk/mgfp/applications/rix/tmtx.cpp 2010-10-10 11:08:53 UTC (rev 41) @@ -1,171 +0,0 @@ -/*$Id$*/ -/* - * tmtx.cpp - * - * Copyright (c) 2010 Marc Kirchner <mar...@ch...> - * - * This file is part of mgfp. - * - * mgfp is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * ms++ is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with ms++. If not, see <http://www.gnu.org/licenses/>. - * - */ - -#include <cmath> -#include <fstream> -#include <iomanip> -#include <iostream> -#include <iterator> -#include <tr1/array> -#include <boost/program_options.hpp> -#include <mgfp/mgfp.h> - -mgf::MgfSpectrum::iterator findClosestMz(mgf::MgfSpectrum::iterator begin, - mgf::MgfSpectrum::iterator end, double referenceMz) -{ - // at least one entry? - if (begin == end) - return end; - // find first entry that is equal or greater than the reference mz - typedef mgf::MgfSpectrum::iterator MSI; - MSI pos1 = std::lower_bound(begin, end, referenceMz, mgf::LessThanMz()); - double dist1 = 0.0; - if (pos1 != end) { - // found equal or greater - dist1 = pos1->first - referenceMz; - if (pos1 == begin || dist1 == 0.0) { - return pos1; - } - } else { - // return the last entry in the sequence - pos1 = begin; - std::advance(pos1, std::distance(begin, end) - 1); - return pos1; - } - // check if the distance to the previous iterator position - if (pos1 != begin) { - MSI pos2 = begin; - std::advance(pos2, std::distance(begin, pos1) - 1); - double dist2 = referenceMz - pos2->first; - if (dist2 < dist1) { - return pos2; - } - return pos1; - } -} - -enum LabelType { TMT, ITRAQ4, SIZE }; -static const size_t sizes[SIZE] = { 10, 8 }; -static const double masses[SIZE][10] = - { - { 124.0, 125.0, 126.0, 127.0, 128.0, - 129.0, 130.0, 131.0, 132.0, 133.0 }, - { 112.1, 113.1, 114.1112, 115.1083, 116.1116, - 117.115, 118.1, 119.1, 0.0, 0.0 }}; - -int main(int argc, char *argv[]) -{ - namespace po = boost::program_options; - po::options_description desc("Allowed options"); - bool verbose = false; - std::string inputfile; - size_t precision; - desc.add_options() - ("help,h", "produce help message") - ("verbose,v", po::value(&verbose)->zero_tokens(), - "verbose output (good to pinpoint parsing errors)") - ("type,t", po::value<std::string>(), "label type: one of TMT, ITRAQ4") - ("input,i", po::value<std::string>(&inputfile)->default_value("-"), - "input filename, defaults to stdin") - ("tee,e", po::value<std::string>(), "run in tee mode: extract label " - "abundances to specified file and simply pipe MGF data from stdin " - "to stdout.") - ("precision,p", po::value<size_t>(&precision)->default_value(6), - "number of significant digits in output") - ; - po::variables_map vm; - po::store(po::parse_command_line(argc, argv, desc), vm); - po::notify(vm); - // check if the user asked for help - if (vm.count("help") || !vm.count("type")) { - std::cerr << desc; - return 1; - } - // figure put which labeling technique we use - LabelType labelType; - if (vm["type"].as<std::string>() == "TMT") { - labelType = TMT; - } else if (vm["type"].as<std::string>() == "ITRAQ4") { - labelType = ITRAQ4; - } else { - std::cerr << vm["type"].as<std::string>() << std::endl; - std::cerr << desc; - return 1; - } - // initialize the masses - std::vector<double> labelMasses(sizes[labelType]); - for (size_t n = 0; n < sizes[labelType]; ++n) { - labelMasses[n] = masses[labelType][n]; - } - // prepare the parser - mgf::MgfFile m; - mgf::Driver driver(m); - driver.trace_parsing = verbose; - driver.trace_scanning = verbose; - // parse input - bool result; - if (inputfile == "-") { - result = driver.parse_stream(std::cin); - } else { - std::ifstream ifs(inputfile.c_str()); - result = driver.parse_stream(ifs); - ifs.close(); - } - if (!result) { - std::cerr << std::endl - << "Error parsing data stream (use -v for details)." << std::endl; - return -1; - } - typedef mgf::MgfFile::iterator MFI; - // iterate over all spectra - std::vector<double> obsAbundances(sizes[labelType]); - for (MFI i = m.begin(); i != m.end(); ++i) { - // sort - std::sort(i->begin(), i->end(), mgf::LessThanMz()); - typedef mgf::MgfSpectrum::iterator MSI; - // extract TMT reproter ion intensities - bool atLeastOneEntry = false; - for (size_t n = 0; n < sizes[labelType]; ++n) { - MSI closestIt = findClosestMz(i->begin(), i->end(), labelMasses[n]); - if (closestIt != i->end()) { - // check if there is an MS2 centroid - if (std::abs(closestIt->first - labelMasses[n]) < 0.4) { - obsAbundances[n] = closestIt->second; - if (!atLeastOneEntry) atLeastOneEntry = true; - } else { - obsAbundances[n] = 0.0; - } - } - } - // extract into file - if (atLeastOneEntry) { - std::cout << i->getTITLE(); - for (size_t n = 0; n < sizes[labelType]; ++n) { - std::cout << '\t' << std::setprecision(precision) << obsAbundances[n]; - } - std::cout << '\n'; // don't use std::endl, save the std::flush. - } - } - return 0; -} - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-10-10 10:59:05
|
Revision: 40 http://mgfp.svn.sourceforge.net/mgfp/?rev=40&view=rev Author: mkirchner Date: 2010-10-10 10:58:58 +0000 (Sun, 10 Oct 2010) Log Message: ----------- adding reference to Renard et al. Modified Paths: -------------- trunk/mgfp/doc/Mainpage.h Modified: trunk/mgfp/doc/Mainpage.h =================================================================== --- trunk/mgfp/doc/Mainpage.h 2010-09-10 15:35:49 UTC (rev 39) +++ trunk/mgfp/doc/Mainpage.h 2010-10-10 10:58:58 UTC (rev 40) @@ -4,7 +4,11 @@ \section sec_intro Introduction \c mgfp is a flex/bison-based C++ MGF parser library.<br> +It includes the library code as well as the following set of +MGF processing tools: +\li mgfvalidate -- validates a given MGF file + The <a href="http://steenlab.org">Steen \& Steen Lab</a> provides the library under the terms of a BSD license for use in academic and non-academic environments. @@ -16,9 +20,17 @@ Kirchner M, Steen JAJ, Hamprecht FA, Steen H (2010). MGFp: An open Mascot Generic Format parser library implementation. -<i>Journal of Proteome Research, in press.</i> -[<a href="http://www.ncbi.nlm.nih.gov/pubmed/20334363">PubMed</a>] +<i>Journal of Proteome Research, 9(5):2762-2763 (2010)</i>. +[<a href="http://www.ncbi.nlm.nih.gov/pubmed/20334363">PubMed entry</a>] +If you use ms2preproc in your data analysis pipeline, please cite<br> + +Renard BY, Kirchner M, Monigatti F, Invanov AR, Rappsilber J, +Winter D, Steen JAJ, Hamprecht FA, Steen H, When Less +Can Yield More - Computational Preprocessing of MS/MS Spectra for +Peptide Identification, <i>Proteomics 9(21):4978-4984 (2009)</i>. +[<a href="http://www.ncbi.nlm.nih.gov/pubmed/19743429">PubMed entry</a>] + \section sec_install Installation \subsection sec_install_bin Obtaining the Software This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-09-10 15:35:55
|
Revision: 39 http://mgfp.svn.sourceforge.net/mgfp/?rev=39&view=rev Author: mkirchner Date: 2010-09-10 15:35:49 +0000 (Fri, 10 Sep 2010) Log Message: ----------- reflect the interface change in the version number (upgrading to 2.0) Modified Paths: -------------- trunk/mgfp/CMakeLists.txt Modified: trunk/mgfp/CMakeLists.txt =================================================================== --- trunk/mgfp/CMakeLists.txt 2010-09-10 15:33:39 UTC (rev 38) +++ trunk/mgfp/CMakeLists.txt 2010-09-10 15:35:49 UTC (rev 39) @@ -9,8 +9,8 @@ ############################################################################# # versioning ############################################################################# -set(VERSION_MAJOR 1) -set(VERSION_MINOR 3) +set(VERSION_MAJOR 2) +set(VERSION_MINOR 0) # get SVN revision EXECUTE_PROCESS( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-09-10 15:33:47
|
Revision: 38 http://mgfp.svn.sourceforge.net/mgfp/?rev=38&view=rev Author: mkirchner Date: 2010-09-10 15:33:39 +0000 (Fri, 10 Sep 2010) Log Message: ----------- * parser extensions: now accepting ranges for SCANS and RTINSECONDS. * this caused an interface change. :-( Modified Paths: -------------- trunk/mgfp/include/mgfp/MgfSpectrum.h trunk/mgfp/src/MgfFile.cpp trunk/mgfp/src/MgfHeader.cpp trunk/mgfp/src/MgfSpectrum.cpp trunk/mgfp/src/Parser.cpp trunk/mgfp/src/Parser.h trunk/mgfp/src/Parser.ypp trunk/mgfp/src/Scanner.cpp trunk/mgfp/src/Scanner.l Modified: trunk/mgfp/include/mgfp/MgfSpectrum.h =================================================================== --- trunk/mgfp/include/mgfp/MgfSpectrum.h 2010-09-10 15:30:49 UTC (rev 37) +++ trunk/mgfp/include/mgfp/MgfSpectrum.h 2010-09-10 15:33:39 UTC (rev 38) @@ -123,31 +123,48 @@ */ void setPEPMASS(const std::pair<double, double> pepmass); - /** Get the retention time of the precursor. - * @return The retention time of the precursor, in seconds. + /** Get the retention time range of the precursor scans. + * @return The retention time range of the precursor scans, in seconds. + * If the precursors stem from a single scan, the .second entry + * of the returned std::pair equals -1.0. */ - double getRTINSECONDS(void) const; + std::pair<double,double> getRTINSECONDS(void) const; - /** Set the retention time of the precursor. - * @param[in] rtinseconds The retention time of the precursor, in seconds. + /** Set the retention time range of the precursor scans. + * @param[in] rtinseconds The retention time of the precursor scan(s), + * in seconds. For single scans, use -1.0 as .second value + * or the alternate setRTINSECONDS function that takes a + * single double. */ + void setRTINSECONDS(const std::pair<double,double>& rtinseconds); + + /** Set the retention time range of a single precursor scan. + * @param[in] rtinseconds The retention time of the precursor scan, + * in seconds. + */ void setRTINSECONDS(const double rtinseconds); - /** Get - * @see - * @return + /** Get the scan number or scan number range from which this fragmentation + * spectrum was generated. + * @see http://www.matrixscience.com/help/data_file_help.html + * @return A pair of scan numbers. For fragmentation spectra of single + * scans, the .second value of the return value equals -1. */ - std::string getSCANS(void) const; + std::pair<int, int> getSCANS(void) const; - /** Set - * @see - * @param[in] + /** Set the scan number or scan number range from which this fragmentation + * spectrum was generated. + * @see http://www.matrixscience.com/help/data_file_help.html + * @param[in] A pair [start, end] of scan numbers. For single scans + * use [scanNumber, -1]. */ - void setSCANS(const std::string& scans); + void setSCANS(const std::pair<int, int>& scans); - /** Set - * @see - * @param[in] + /** Set the scan number from which this fragmentation + * spectrum was generated. This is just a convenience function wrapper + * for single scans. + * @see http://www.matrixscience.com/help/data_file_help.html + * @param[in] A scan number. */ void setSCANS(const int scans); @@ -228,8 +245,9 @@ std::vector<int> charges_; std::string comp_, etag_, instrument_, it_mods_; std::pair<double, double> pepmass_; - double rtinseconds_; - std::string scans_, seq_, tag_, title_; // FIXME: scans_ should be a vector of ranges + std::pair<double, double> rtinseconds_; + std::pair<int, int> scans_; + std::string seq_, tag_, title_; double tol_; std::string tolu_; }; Modified: trunk/mgfp/src/MgfFile.cpp =================================================================== --- trunk/mgfp/src/MgfFile.cpp 2010-09-10 15:30:49 UTC (rev 37) +++ trunk/mgfp/src/MgfFile.cpp 2010-09-10 15:33:39 UTC (rev 38) @@ -22,7 +22,7 @@ std::ostream& operator<<(std::ostream& os, const MgfFile& mgf) { os << mgf.header_; for (MgfFile::const_iterator i = mgf.begin(); i != mgf.end(); ++i) { - os << std::endl << *i; + os << '\n' << *i; } return os; } Modified: trunk/mgfp/src/MgfHeader.cpp =================================================================== --- trunk/mgfp/src/MgfHeader.cpp 2010-09-10 15:30:49 UTC (rev 37) +++ trunk/mgfp/src/MgfHeader.cpp 2010-09-10 15:33:39 UTC (rev 38) @@ -203,15 +203,15 @@ std::ostream& operator<<(std::ostream& os, const MgfHeader& mgf) { typedef std::map<std::string, std::string>::const_iterator MSSCI; for (MSSCI i = mgf.strings.begin(); i != mgf.strings.end() ; ++i) { - os << i->first << '=' << i->second << std::endl; + os << i->first << '=' << i->second << '\n'; } typedef std::map<std::string, int>::const_iterator MSICI; for (MSICI i = mgf.ints.begin(); i != mgf.ints.end() ; ++i) { - os << i->first << '=' << i->second << std::endl; + os << i->first << '=' << i->second << '\n'; } typedef std::map<std::string, double>::const_iterator MSDCI; for (MSDCI i = mgf.doubles.begin(); i != mgf.doubles.end() ; ++i) { - os << i->first << '=' << i->second << std::endl; + os << i->first << '=' << i->second << '\n'; } typedef std::vector<int>::const_iterator VICI; if (!mgf.charges_.empty()) { @@ -227,7 +227,7 @@ os << '-'; } } - os << std::endl; + os << '\n'; } if (!mgf.frames_.empty()) { os << "FRAMES="; @@ -237,7 +237,7 @@ } os << *i; } - os << std::endl; + os << '\n'; } return os; } Modified: trunk/mgfp/src/MgfSpectrum.cpp =================================================================== --- trunk/mgfp/src/MgfSpectrum.cpp 2010-09-10 15:30:49 UTC (rev 37) +++ trunk/mgfp/src/MgfSpectrum.cpp 2010-09-10 15:33:39 UTC (rev 38) @@ -1,12 +1,16 @@ #include <mgfp/MgfSpectrum.h> #include <cstdlib> // for std::abs(int) +#include <iostream> #include <sstream> +#include <utility> namespace mgf { MgfSpectrum::MgfSpectrum() : Collection<MassAbundancePair>() { this->clear(); + scans_ = std::make_pair(-1, -1); + rtinseconds_ = std::make_pair(-1.0, -1.0); } std::vector<int> MgfSpectrum::getCHARGE(void) const { @@ -58,24 +62,24 @@ pepmass_ = pepmass; } -double MgfSpectrum::getRTINSECONDS(void) const { +std::pair<double, double> MgfSpectrum::getRTINSECONDS(void) const { return rtinseconds_; } -void MgfSpectrum::setRTINSECONDS(const double rtinseconds) { +void MgfSpectrum::setRTINSECONDS(const std::pair<double,double>& rtinseconds) { rtinseconds_ = rtinseconds; } +void MgfSpectrum::setRTINSECONDS(const double rtinseconds) { + setRTINSECONDS(std::make_pair(rtinseconds, -1.0)); +} -std::string MgfSpectrum::getSCANS(void) const { - return scans_; // FIXME +std::pair<int, int> MgfSpectrum::getSCANS(void) const { + return scans_; } -void MgfSpectrum::setSCANS(const std::string& scans) { - scans_ = scans; //FIXME +void MgfSpectrum::setSCANS(const std::pair<int, int>& scans) { + scans_ = scans; } - -void MgfSpectrum::setSCANS(const int scans) { - std::ostringstream oss; - oss << scans; - scans_ = oss.str(); //FIXME +void MgfSpectrum::setSCANS(const int scan) { + setSCANS(std::make_pair(scan, -1)); } std::string MgfSpectrum::getSEQ(void) const { @@ -115,19 +119,20 @@ void MgfSpectrum::clear() { charges_.clear(); - comp_ = etag_ = instrument_ = it_mods_ = scans_ = ""; + scans_ = std::make_pair(-1, -1); + comp_ = etag_ = instrument_ = it_mods_; seq_ = tag_ = title_ = tolu_ = ""; pepmass_ = std::make_pair(0.0, 0.0); - rtinseconds_ = 0; + rtinseconds_ = std::make_pair(-1.0, -1.0); tol_ = 0.0; Collection<MassAbundancePair>::clear(); } std::ostream& operator<<(std::ostream& os, const MgfSpectrum& mgf) { // start with title, then A-Z - os << "BEGIN IONS" << std::endl; + os << "BEGIN IONS" << '\n'; if (!mgf.title_.empty()) - os << "TITLE=" << mgf.title_ << std::endl; + os << "TITLE=" << mgf.title_ << '\n'; if (!mgf.charges_.empty()) { os << "CHARGE="; typedef std::vector<int>::const_iterator VICI; @@ -142,39 +147,49 @@ os << '-'; } } - os << std::endl; + os << '\n'; } if (!mgf.comp_.empty()) - os << "COMP=" << mgf.comp_ << std::endl; + os << "COMP=" << mgf.comp_ << '\n'; if (!mgf.etag_.empty()) - os << "ETAG=" << mgf.etag_ << std::endl; + os << "ETAG=" << mgf.etag_ << '\n'; if (!mgf.instrument_.empty()) - os << "INSTRUMENT=" << mgf.instrument_ << std::endl; + os << "INSTRUMENT=" << mgf.instrument_ << '\n'; if (!mgf.it_mods_.empty()) - os << "IT_MODS=" << mgf.it_mods_ << std::endl; + os << "IT_MODS=" << mgf.it_mods_ << '\n'; if (mgf.pepmass_.first > 0.0) { os << "PEPMASS=" << mgf.pepmass_.first; if (mgf.pepmass_.second > 0.0) { os << " " << mgf.pepmass_.second; } - os << std::endl; + os << '\n'; } - if (mgf.rtinseconds_ > 0) - os << "RTINSECONDS=" << mgf.rtinseconds_ << std::endl; - if (!mgf.scans_.empty()) - os << "SCANS=" << mgf.scans_ << std::endl; + if (mgf.rtinseconds_.first != -1.0) { + os << "RTINSECONDS=" << mgf.rtinseconds_.first; + if (mgf.rtinseconds_.second != -1.0) { + os << "-" << mgf.rtinseconds_.second; + } + os << '\n'; + } + if (mgf.scans_.first != -1) { + os << "SCANS=" << mgf.scans_.first; + if (mgf.scans_.second != -1) { + os << "-" << mgf.scans_.second; + } + os << '\n'; + } if (!mgf.seq_.empty()) - os << "SEQ=" << mgf.seq_ << std::endl; + os << "SEQ=" << mgf.seq_ << '\n'; if (!mgf.tag_.empty()) - os << "TAG=" << mgf.tag_ << std::endl; + os << "TAG=" << mgf.tag_ << '\n'; if (mgf.tol_ > 0.0) - os << "TOL=" << mgf.tol_ << std::endl; + os << "TOL=" << mgf.tol_ << '\n'; if (!mgf.tolu_.empty()) - os << "TOLU=" << mgf.tolu_ << std::endl; + os << "TOLU=" << mgf.tolu_ << '\n'; for (MgfSpectrum::const_iterator i = mgf.begin(); i != mgf.end(); ++i) { - os << i->first << " " << i->second << std::endl; + os << i->first << " " << i->second << '\n'; } - os << "END IONS" << std::endl; + os << "END IONS" << '\n'; return os; } Modified: trunk/mgfp/src/Parser.cpp =================================================================== --- trunk/mgfp/src/Parser.cpp 2010-09-10 15:30:49 UTC (rev 37) +++ trunk/mgfp/src/Parser.cpp 2010-09-10 15:33:39 UTC (rev 38) @@ -47,7 +47,7 @@ /* User implementation prologue. */ /* Line 317 of lalr1.cc */ -#line 117 "Parser.ypp" +#line 118 "Parser.ypp" #include <mgfp/Driver.h> #include "Scanner.h" @@ -232,7 +232,7 @@ case 8: /* "\"string\"" */ /* Line 480 of lalr1.cc */ -#line 114 "Parser.ypp" +#line 115 "Parser.ypp" { delete (yyvaluep->stringVal); }; /* Line 480 of lalr1.cc */ @@ -241,7 +241,7 @@ case 54: /* "ion" */ /* Line 480 of lalr1.cc */ -#line 115 "Parser.ypp" +#line 116 "Parser.ypp" { delete (yyvaluep->doublepairnode); }; /* Line 480 of lalr1.cc */ @@ -250,7 +250,7 @@ case 55: /* "ions" */ /* Line 480 of lalr1.cc */ -#line 115 "Parser.ypp" +#line 116 "Parser.ypp" { delete (yyvaluep->doublepairlistnode); }; /* Line 480 of lalr1.cc */ @@ -259,7 +259,7 @@ case 56: /* "charge" */ /* Line 480 of lalr1.cc */ -#line 115 "Parser.ypp" +#line 116 "Parser.ypp" { delete (yyvaluep->integernode); }; /* Line 480 of lalr1.cc */ @@ -268,7 +268,7 @@ case 57: /* "charges" */ /* Line 480 of lalr1.cc */ -#line 115 "Parser.ypp" +#line 116 "Parser.ypp" { delete (yyvaluep->integerlistnode); }; /* Line 480 of lalr1.cc */ @@ -277,7 +277,7 @@ case 58: /* "csintegerlist" */ /* Line 480 of lalr1.cc */ -#line 115 "Parser.ypp" +#line 116 "Parser.ypp" { delete (yyvaluep->integerlistnode); }; /* Line 480 of lalr1.cc */ @@ -360,7 +360,7 @@ /* User initialization code. */ /* Line 553 of lalr1.cc */ -#line 39 "Parser.ypp" +#line 40 "Parser.ypp" { // initialize the initial location object yylloc.begin.filename = yylloc.end.filename = &driver.streamname; @@ -486,105 +486,105 @@ case 2: /* Line 678 of lalr1.cc */ -#line 130 "Parser.ypp" +#line 131 "Parser.ypp" { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].doubleVal), (yysemantic_stack_[(3) - (2)].doubleVal)); } break; case 3: /* Line 678 of lalr1.cc */ -#line 131 "Parser.ypp" +#line 132 "Parser.ypp" { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].integerVal), (yysemantic_stack_[(3) - (2)].doubleVal)); } break; case 4: /* Line 678 of lalr1.cc */ -#line 132 "Parser.ypp" +#line 133 "Parser.ypp" { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].doubleVal), (yysemantic_stack_[(3) - (2)].integerVal)); } break; case 5: /* Line 678 of lalr1.cc */ -#line 133 "Parser.ypp" +#line 134 "Parser.ypp" { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].integerVal), (yysemantic_stack_[(3) - (2)].integerVal)); } break; case 6: /* Line 678 of lalr1.cc */ -#line 135 "Parser.ypp" +#line 136 "Parser.ypp" { (yyval.doublepairlistnode) = new DoublePairListNode((yysemantic_stack_[(2) - (1)].doublepairlistnode), (yysemantic_stack_[(2) - (2)].doublepairnode)); } break; case 7: /* Line 678 of lalr1.cc */ -#line 136 "Parser.ypp" +#line 137 "Parser.ypp" { (yyval.doublepairlistnode) = new DoublePairListNode((yysemantic_stack_[(1) - (1)].doublepairnode)); } break; case 8: /* Line 678 of lalr1.cc */ -#line 138 "Parser.ypp" +#line 139 "Parser.ypp" { (yyval.integernode) = new IntegerNode((yysemantic_stack_[(2) - (1)].integerVal)); } break; case 9: /* Line 678 of lalr1.cc */ -#line 139 "Parser.ypp" +#line 140 "Parser.ypp" { (yyval.integernode) = new IntegerNode(-(yysemantic_stack_[(2) - (1)].integerVal)); } break; case 10: /* Line 678 of lalr1.cc */ -#line 141 "Parser.ypp" +#line 142 "Parser.ypp" { (yyval.integerlistnode) = (yysemantic_stack_[(3) - (2)].integerlistnode); } break; case 11: /* Line 678 of lalr1.cc */ -#line 142 "Parser.ypp" +#line 143 "Parser.ypp" { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integernode)); } break; case 12: /* Line 678 of lalr1.cc */ -#line 143 "Parser.ypp" +#line 144 "Parser.ypp" { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integernode)); } break; case 13: /* Line 678 of lalr1.cc */ -#line 144 "Parser.ypp" +#line 145 "Parser.ypp" { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(1) - (1)].integernode)); } break; case 14: /* Line 678 of lalr1.cc */ -#line 146 "Parser.ypp" +#line 147 "Parser.ypp" { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integerVal)); } break; case 15: /* Line 678 of lalr1.cc */ -#line 147 "Parser.ypp" +#line 148 "Parser.ypp" { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(1) - (1)].integerVal)); } break; case 17: /* Line 678 of lalr1.cc */ -#line 151 "Parser.ypp" +#line 152 "Parser.ypp" { driver.context.mgfFile.push_back(driver.context.currentSpectrum); driver.context.currentSpectrum.clear(); @@ -594,353 +594,416 @@ case 18: /* Line 678 of lalr1.cc */ -#line 157 "Parser.ypp" +#line 158 "Parser.ypp" { driver.context.currentSpectrum.assign(((yysemantic_stack_[(6) - (4)].doublepairlistnode)->pairlist_)->begin(), ((yysemantic_stack_[(6) - (4)].doublepairlistnode)->pairlist_)->end()); delete (yysemantic_stack_[(6) - (4)].doublepairlistnode); } break; - case 21: + case 22: /* Line 678 of lalr1.cc */ -#line 165 "Parser.ypp" +#line 167 "Parser.ypp" { driver.context.header.setCLE(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 22: + case 23: /* Line 678 of lalr1.cc */ -#line 166 "Parser.ypp" +#line 168 "Parser.ypp" { driver.context.header.setCOM(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 23: + case 24: /* Line 678 of lalr1.cc */ -#line 167 "Parser.ypp" +#line 169 "Parser.ypp" { driver.context.header.setDB(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 24: + case 25: /* Line 678 of lalr1.cc */ -#line 168 "Parser.ypp" +#line 170 "Parser.ypp" { driver.context.header.setFORMAT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 25: + case 26: /* Line 678 of lalr1.cc */ -#line 169 "Parser.ypp" +#line 171 "Parser.ypp" { driver.context.header.setINSTRUMENT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 26: + case 27: /* Line 678 of lalr1.cc */ -#line 170 "Parser.ypp" +#line 172 "Parser.ypp" { driver.context.header.setIT_MODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 27: + case 28: /* Line 678 of lalr1.cc */ -#line 171 "Parser.ypp" +#line 173 "Parser.ypp" { driver.context.header.setITOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 28: + case 29: /* Line 678 of lalr1.cc */ -#line 172 "Parser.ypp" +#line 174 "Parser.ypp" { driver.context.header.setMASS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 29: + case 30: /* Line 678 of lalr1.cc */ -#line 173 "Parser.ypp" +#line 175 "Parser.ypp" { driver.context.header.setMODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 30: + case 31: /* Line 678 of lalr1.cc */ -#line 174 "Parser.ypp" +#line 176 "Parser.ypp" { driver.context.header.setQUANTITATION(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 31: + case 32: /* Line 678 of lalr1.cc */ -#line 175 "Parser.ypp" +#line 177 "Parser.ypp" { driver.context.header.setREPORT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 32: + case 33: /* Line 678 of lalr1.cc */ -#line 176 "Parser.ypp" +#line 178 "Parser.ypp" { driver.context.header.setREPTYPE(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 33: + case 34: /* Line 678 of lalr1.cc */ -#line 177 "Parser.ypp" +#line 179 "Parser.ypp" { driver.context.header.setSEARCH(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 34: + case 35: /* Line 678 of lalr1.cc */ -#line 178 "Parser.ypp" +#line 180 "Parser.ypp" { driver.context.header.setTAXONOMY(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 35: + case 36: /* Line 678 of lalr1.cc */ -#line 179 "Parser.ypp" +#line 181 "Parser.ypp" { driver.context.header.setTOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 36: + case 37: /* Line 678 of lalr1.cc */ -#line 180 "Parser.ypp" +#line 182 "Parser.ypp" { /*driver.context.header.setUSER(*$3);*/ delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 37: + case 38: /* Line 678 of lalr1.cc */ -#line 181 "Parser.ypp" +#line 183 "Parser.ypp" { driver.context.header.setUSEREMAIL(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 38: + case 39: /* Line 678 of lalr1.cc */ -#line 182 "Parser.ypp" +#line 184 "Parser.ypp" { driver.context.header.setUSERNAME(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 39: + case 40: /* Line 678 of lalr1.cc */ -#line 183 "Parser.ypp" +#line 185 "Parser.ypp" { driver.context.header.setDECOY(((yysemantic_stack_[(4) - (3)].integerVal))!=0); } break; - case 40: + case 41: /* Line 678 of lalr1.cc */ -#line 184 "Parser.ypp" +#line 186 "Parser.ypp" { driver.context.header.setERRORTOLERANT(((yysemantic_stack_[(4) - (3)].integerVal))!=0); } break; - case 41: + case 42: /* Line 678 of lalr1.cc */ -#line 185 "Parser.ypp" +#line 187 "Parser.ypp" { driver.context.header.setPFA((yysemantic_stack_[(4) - (3)].integerVal)); } break; - case 42: + case 43: /* Line 678 of lalr1.cc */ -#line 186 "Parser.ypp" +#line 188 "Parser.ypp" { driver.context.header.setITOL((yysemantic_stack_[(4) - (3)].doubleVal)); } break; - case 43: + case 44: /* Line 678 of lalr1.cc */ -#line 187 "Parser.ypp" +#line 189 "Parser.ypp" { driver.context.header.setITOL((yysemantic_stack_[(4) - (3)].integerVal)); } break; - case 44: + case 45: /* Line 678 of lalr1.cc */ -#line 188 "Parser.ypp" +#line 190 "Parser.ypp" { driver.context.header.setPEP_ISOTOPE_ERROR((yysemantic_stack_[(4) - (3)].doubleVal)); } break; - case 45: + case 46: /* Line 678 of lalr1.cc */ -#line 189 "Parser.ypp" +#line 191 "Parser.ypp" { driver.context.header.setPRECURSOR((yysemantic_stack_[(4) - (3)].doubleVal)); } break; - case 46: + case 47: /* Line 678 of lalr1.cc */ -#line 190 "Parser.ypp" +#line 192 "Parser.ypp" + { driver.context.header.setPRECURSOR((yysemantic_stack_[(4) - (3)].integerVal)); } + break; + + case 48: + +/* Line 678 of lalr1.cc */ +#line 193 "Parser.ypp" { driver.context.header.setSEG((yysemantic_stack_[(4) - (3)].doubleVal)); } break; - case 47: + case 49: /* Line 678 of lalr1.cc */ -#line 191 "Parser.ypp" +#line 194 "Parser.ypp" + { driver.context.header.setSEG((yysemantic_stack_[(4) - (3)].integerVal)); } + break; + + case 50: + +/* Line 678 of lalr1.cc */ +#line 195 "Parser.ypp" { driver.context.header.setTOL((yysemantic_stack_[(4) - (3)].doubleVal)); } break; - case 48: + case 51: /* Line 678 of lalr1.cc */ -#line 192 "Parser.ypp" +#line 196 "Parser.ypp" { driver.context.header.setTOL((yysemantic_stack_[(4) - (3)].integerVal)); } break; - case 49: + case 52: /* Line 678 of lalr1.cc */ -#line 193 "Parser.ypp" +#line 197 "Parser.ypp" { driver.context.header.setCHARGE(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); } break; - case 50: + case 53: /* Line 678 of lalr1.cc */ -#line 194 "Parser.ypp" +#line 198 "Parser.ypp" { driver.context.header.setFRAMES(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); } break; - case 54: + case 57: /* Line 678 of lalr1.cc */ -#line 200 "Parser.ypp" +#line 204 "Parser.ypp" { driver.context.currentSpectrum.setTITLE(*(yysemantic_stack_[(2) - (1)].stringVal)); delete (yysemantic_stack_[(2) - (1)].stringVal); } break; - case 55: + case 58: /* Line 678 of lalr1.cc */ -#line 201 "Parser.ypp" +#line 205 "Parser.ypp" { driver.context.currentSpectrum.setCOMP(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 56: + case 59: /* Line 678 of lalr1.cc */ -#line 202 "Parser.ypp" +#line 206 "Parser.ypp" { driver.context.currentSpectrum.setINSTRUMENT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 57: + case 60: /* Line 678 of lalr1.cc */ -#line 203 "Parser.ypp" +#line 207 "Parser.ypp" { driver.context.currentSpectrum.setIT_MODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 58: + case 61: /* Line 678 of lalr1.cc */ -#line 204 "Parser.ypp" +#line 208 "Parser.ypp" { driver.context.currentSpectrum.setRTINSECONDS((yysemantic_stack_[(4) - (3)].doubleVal)); } break; - case 59: + case 62: /* Line 678 of lalr1.cc */ -#line 205 "Parser.ypp" - { driver.context.currentSpectrum.setSCANS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } +#line 209 "Parser.ypp" + { driver.context.currentSpectrum.setRTINSECONDS((yysemantic_stack_[(4) - (3)].integerVal)); } break; - case 60: + case 63: /* Line 678 of lalr1.cc */ -#line 206 "Parser.ypp" - { driver.context.currentSpectrum.setSCANS((yysemantic_stack_[(4) - (3)].integerVal)); } +#line 210 "Parser.ypp" + { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair((yysemantic_stack_[(6) - (3)].doubleVal), (yysemantic_stack_[(6) - (5)].doubleVal))); } break; - case 61: + case 64: /* Line 678 of lalr1.cc */ -#line 207 "Parser.ypp" +#line 211 "Parser.ypp" + { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair((yysemantic_stack_[(6) - (3)].doubleVal), (yysemantic_stack_[(6) - (5)].integerVal))); } + break; + + case 65: + +/* Line 678 of lalr1.cc */ +#line 212 "Parser.ypp" + { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair((yysemantic_stack_[(6) - (3)].integerVal), (yysemantic_stack_[(6) - (5)].doubleVal))); } + break; + + case 66: + +/* Line 678 of lalr1.cc */ +#line 213 "Parser.ypp" + { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair((yysemantic_stack_[(6) - (3)].integerVal), (yysemantic_stack_[(6) - (5)].integerVal))); } + break; + + case 67: + +/* Line 678 of lalr1.cc */ +#line 214 "Parser.ypp" + { driver.context.currentSpectrum.setSCANS(std::make_pair((yysemantic_stack_[(4) - (3)].integerVal), -1)); } + break; + + case 68: + +/* Line 678 of lalr1.cc */ +#line 215 "Parser.ypp" + { driver.context.currentSpectrum.setSCANS(std::make_pair((yysemantic_stack_[(6) - (3)].integerVal), (yysemantic_stack_[(6) - (5)].integerVal))); } + break; + + case 69: + +/* Line 678 of lalr1.cc */ +#line 216 "Parser.ypp" { driver.context.currentSpectrum.setTOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 62: + case 70: /* Line 678 of lalr1.cc */ -#line 208 "Parser.ypp" +#line 217 "Parser.ypp" { driver.context.currentSpectrum.setSEQ(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 63: + case 71: /* Line 678 of lalr1.cc */ -#line 209 "Parser.ypp" +#line 218 "Parser.ypp" { driver.context.currentSpectrum.setTAG(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 64: + case 72: /* Line 678 of lalr1.cc */ -#line 210 "Parser.ypp" +#line 219 "Parser.ypp" { driver.context.currentSpectrum.setETAG(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; - case 65: + case 73: /* Line 678 of lalr1.cc */ -#line 211 "Parser.ypp" +#line 220 "Parser.ypp" { driver.context.currentSpectrum.setTOL((yysemantic_stack_[(4) - (3)].doubleVal)); } break; - case 66: + case 74: /* Line 678 of lalr1.cc */ -#line 212 "Parser.ypp" +#line 221 "Parser.ypp" { driver.context.currentSpectrum.setTOL((yysemantic_stack_[(4) - (3)].integerVal)); } break; - case 67: + case 75: /* Line 678 of lalr1.cc */ -#line 213 "Parser.ypp" +#line 222 "Parser.ypp" { driver.context.currentSpectrum.setCHARGE(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); } break; - case 68: + case 76: /* Line 678 of lalr1.cc */ -#line 214 "Parser.ypp" +#line 223 "Parser.ypp" { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(4) - (3)].doubleVal), 0.0)); } break; - case 69: + case 77: /* Line 678 of lalr1.cc */ -#line 215 "Parser.ypp" +#line 224 "Parser.ypp" { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].doubleVal), (yysemantic_stack_[(5) - (4)].doubleVal))); } break; - case 70: + case 78: /* Line 678 of lalr1.cc */ -#line 216 "Parser.ypp" +#line 225 "Parser.ypp" + { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].doubleVal), (yysemantic_stack_[(5) - (4)].integerVal))); } + break; + + case 79: + +/* Line 678 of lalr1.cc */ +#line 226 "Parser.ypp" { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(4) - (3)].integerVal), 0.0)); } break; - case 71: + case 80: /* Line 678 of lalr1.cc */ -#line 217 "Parser.ypp" +#line 227 "Parser.ypp" + { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].integerVal), (yysemantic_stack_[(5) - (4)].doubleVal))); } + break; + + case 81: + +/* Line 678 of lalr1.cc */ +#line 228 "Parser.ypp" { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].integerVal), (yysemantic_stack_[(5) - (4)].integerVal))); } break; - case 73: + case 83: /* Line 678 of lalr1.cc */ -#line 222 "Parser.ypp" +#line 233 "Parser.ypp" { driver.context.mgfFile.setHeader(driver.context.header); driver.context.header.clear(); @@ -950,7 +1013,7 @@ /* Line 678 of lalr1.cc */ -#line 954 "Parser.cpp" +#line 1017 "Parser.cpp" default: break; } @@ -1155,33 +1218,35 @@ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ - const signed char Parser::yypact_ninf_ = -70; + const signed char Parser::yypact_ninf_ = -98; const short int Parser::yypact_[] = { - -70, 33, -70, 8, 30, -10, -6, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 27, -70, -70, -70, 5, 109, 110, - 32, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 129, 130, 34, - 131, 133, 134, 135, 137, -70, 141, -70, -3, 5, - -70, -2, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - -70, 2, -70, -70, -70, 1, -70, 170, 170, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, 171, 3, - -70, -70, -70, -70, 172, 74, 76, 85, 88, 127, - 128, 132, 136, 138, 139, 140, 173, 175, 174, 176, - -70, 22, -70, -70, 178, 179, 180, 182, 5, 181, - 185, 186, 187, 78, 189, 24, 190, 191, -70, 80, - 192, 183, -70, -70, -70, -70, -70, -1, 184, 194, - 198, 199, 9, 28, 200, 201, 202, 203, 204, 205, - 206, 207, -70, -70, -70, -70, -70, -70, -70, 208, - -70, 209, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70 + -98, 53, -98, 59, 104, 14, 56, 57, 60, 61, + 62, 64, 66, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 34, -98, -98, -98, 9, 102, 103, + 12, 107, 109, 111, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 147, 148, 31, + 55, 149, 33, 54, 150, -98, 154, -98, -40, 9, + -98, -2, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, -98, 2, -98, -98, -98, 1, -98, 185, + 185, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, 186, 10, -98, -98, -98, -98, 187, 58, + 63, 145, 146, 190, 151, 152, 153, 188, 189, 191, + 192, 193, 196, 194, 195, -98, 29, -98, -98, 197, + 198, 199, 203, 9, 200, -98, 201, 202, 204, 65, + 67, 205, 206, 207, -98, 94, 208, 210, -98, -98, + -98, -98, -98, -1, 214, 215, 216, 217, 39, 41, + 6, 7, 8, 218, 219, 220, 221, 222, -98, -98, + -98, -98, -98, -98, -98, 223, 224, -98, 225, 226, + -98, 96, -98, 99, -98, 227, -98, -98, -98, -98, + -98, -98, -98, -98, -98, 228, 229, 231, 232, 233, + -98, -98, -98, -98, -98 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -1190,45 +1255,47 @@ const unsigned char Parser::yydefact_[] = { - 19, 16, 74, 0, 0, 0, 0, 0, 0, 0, + 20, 16, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 1, 51, 0, 0, 0, + 0, 0, 0, 0, 21, 1, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 73, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 83, 0, 17, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 52, 8, 9, 0, 49, 0, 0, 25, - 26, 48, 47, 35, 21, 22, 23, 24, 27, 28, - 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, - 40, 43, 42, 44, 41, 45, 46, 50, 0, 0, - 10, 12, 11, 14, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 55, 8, 9, 0, 52, 0, + 0, 26, 27, 51, 50, 36, 22, 23, 24, 25, + 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, + 39, 40, 41, 44, 43, 45, 42, 47, 46, 49, + 48, 53, 0, 0, 10, 12, 11, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 0, 53, 72, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, - 0, 0, 6, 5, 3, 4, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 18, 67, 55, 64, 56, 57, 70, 0, - 68, 0, 58, 60, 59, 62, 63, 66, 65, 61, - 71, 69 + 0, 0, 0, 0, 0, 7, 0, 56, 82, 0, + 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 57, 0, 0, 0, 6, 5, + 3, 4, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 18, 75, + 58, 72, 59, 60, 79, 0, 0, 76, 0, 0, + 62, 0, 61, 0, 67, 0, 70, 71, 74, 73, + 69, 81, 80, 78, 77, 0, 0, 0, 0, 0, + 66, 65, 64, 63, 68 }; /* YYPGOTO[NTERM-NUM]. */ const signed char Parser::yypgoto_[] = { - -70, 12, -70, -19, -69, -70, -70, -70, -70, -70, - -70, -70, -70, -70 + -98, 22, -98, -97, -69, -98, -98, -98, -98, -98, + -98, -98, -98, -98 }; /* YYDEFGOTO[NTERM-NUM]. */ const short int Parser::yydefgoto_[] = { - -1, 160, 161, 70, 71, 101, 33, 67, 1, 34, - 139, 162, 2, 3 + -1, 165, 166, 70, 71, 103, 33, 67, 1, 34, + 143, 167, 2, 3 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1238,58 +1305,62 @@ const unsigned char Parser::yytable_[] = { - 105, 106, 203, 107, 107, 137, 107, 144, 35, 145, - 146, 68, 208, 147, 148, 209, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 65, 145, 146, - 195, 210, 196, 36, 181, 211, 66, 4, 74, 75, - 94, 95, 37, 5, 103, 104, 38, 6, 7, 108, - 108, 140, 108, 138, 69, 8, 9, 10, 11, 12, + 107, 108, 209, 109, 109, 141, 109, 105, 106, 220, + 222, 224, 145, 146, 148, 68, 149, 150, 74, 75, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 65, 149, 150, 94, 95, 98, + 99, 187, 214, 66, 217, 215, 216, 218, 219, 110, + 110, 144, 110, 142, 221, 223, 225, 4, 69, 35, + 100, 101, 96, 5, 169, 170, 37, 6, 7, 171, + 172, 198, 199, 200, 201, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 164, 165, 166, 167, 192, 193, 199, 200, 141, 142, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 187, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 72, 73, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 168, 96, 97, - 169, 98, 99, 100, 102, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 182, 0, 163, 68, 143, 178, 170, - 171, 183, 184, 185, 172, 186, 202, 204, 173, 188, - 174, 175, 176, 189, 190, 191, 194, 205, 197, 198, - 201, 206, 207, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 177, 179, 0, 180 + 205, 206, 235, 236, 193, 237, 238, 36, 38, 39, + 72, 73, 40, 41, 42, 76, 43, 77, 44, 78, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 97, 102, 104, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 188, 0, + 168, 68, 147, 175, 0, 0, 0, 173, 174, 184, + 189, 190, 191, 176, 177, 178, 192, 0, 194, 195, + 196, 202, 197, 208, 203, 204, 207, 210, 211, 212, + 213, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 0, 240, 241, 239, 242, 243, 244, 0, 0, 0, + 179, 180, 0, 181, 182, 183, 185, 186 }; /* YYCHECK. */ const short int Parser::yycheck_[] = { - 69, 3, 3, 5, 5, 3, 5, 4, 0, 6, - 7, 6, 3, 10, 11, 6, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 0, 6, 7, - 6, 3, 8, 3, 12, 7, 9, 4, 6, 7, - 6, 7, 52, 10, 47, 48, 52, 14, 15, 51, - 51, 50, 51, 51, 49, 22, 23, 24, 25, 26, + 69, 3, 3, 5, 5, 3, 5, 47, 48, 3, + 3, 3, 109, 110, 4, 6, 6, 7, 6, 7, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 0, 6, 7, 6, 7, 6, + 7, 12, 3, 9, 3, 6, 7, 6, 7, 51, + 51, 50, 51, 51, 48, 48, 48, 4, 49, 0, + 6, 7, 7, 10, 6, 7, 52, 14, 15, 6, + 7, 6, 7, 6, 7, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 6, 7, 6, 7, 6, 7, 6, 7, 107, 108, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 168, + 6, 7, 6, 7, 173, 6, 7, 3, 52, 52, + 8, 8, 52, 52, 52, 8, 52, 8, 52, 8, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 8, 8, 8, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 6, 6, 52, 7, 6, - 52, 7, 7, 6, 3, 3, 3, 3, 3, 3, + 8, 8, 8, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 161, -1, 3, 6, 6, 3, 52, - 52, 3, 3, 3, 52, 3, 3, 3, 52, 8, - 52, 52, 52, 8, 8, 8, 7, 3, 8, 8, - 8, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, 52, -1, 52 + 3, 3, 3, 3, 3, 3, 3, 3, 166, -1, + 3, 6, 6, 3, -1, -1, -1, 52, 52, 3, + 3, 3, 3, 52, 52, 52, 3, -1, 8, 8, + 8, 6, 8, 3, 8, 8, 8, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + -1, 3, 3, 6, 3, 3, 3, -1, -1, -1, + 52, 52, -1, 52, 52, 52, 52, 52 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -1306,20 +1377,22 @@ 52, 52, 52, 52, 52, 0, 9, 60, 6, 49, 56, 57, 8, 8, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 6, 6, 6, 7, 7, 6, 7, 7, - 6, 58, 3, 47, 48, 57, 3, 5, 51, 3, + 8, 8, 6, 6, 6, 7, 7, 6, 6, 7, + 6, 7, 6, 58, 3, 47, 48, 57, 3, 5, + 51, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 51, 63, - 50, 56, 56, 6, 4, 6, 7, 10, 11, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 54, 55, 64, 3, 6, 7, 6, 7, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, 3, 52, - 52, 12, 54, 3, 3, 3, 3, 57, 8, 8, - 8, 8, 6, 7, 7, 6, 8, 8, 8, 6, - 7, 8, 3, 3, 3, 3, 3, 3, 3, 6, - 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3 + 3, 3, 51, 63, 50, 56, 56, 6, 4, 6, + 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 54, 55, 64, 3, 6, + 7, 6, 7, 52, 52, 3, 52, 52, 52, 52, + 52, 52, 52, 52, 3, 52, 52, 12, 54, 3, + 3, 3, 3, 57, 8, 8, 8, 8, 6, 7, + 6, 7, 6, 8, 8, 6, 7, 8, 3, 3, + 3, 3, 3, 3, 3, 6, 7, 3, 6, 7, + 3, 48, 3, 48, 3, 48, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 6, 7, 6, 7, 6, + 3, 3, 3, 3, 3 }; #if YYDEBUG @@ -1342,12 +1415,13 @@ Parser::yyr1_[] = { 0, 53, 54, 54, 54, 54, 55, 55, 56, 56, - 57, 57, 57, 57, 58, 58, 59, 59, 60, 61, - 61, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 57, 57, 57, 57, 58, 58, 59, 59, 60, 60, + 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 63, 63, 64, 64, 64, 64, 64, 64, + 62, 62, 62, 62, 62, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 66 }; @@ -1356,13 +1430,14 @@ Parser::yyr2_[] = { 0, 2, 3, 3, 3, 3, 2, 1, 2, 2, - 3, 3, 3, 1, 3, 1, 0, 2, 6, 0, - 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 1, 3, 1, 0, 2, 6, 5, + 0, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 2, 0, 2, 2, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, - 4, 5, 2, 3, 1 + 4, 4, 4, 4, 2, 0, 2, 2, 4, 4, + 4, 4, 4, 6, 6, 6, 6, 4, 6, 4, + 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, + 5, 5, 2, 3, 1 }; #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE @@ -1409,33 +1484,39 @@ 49, 57, 50, -1, 57, 51, 56, -1, 57, 5, 56, -1, 56, -1, 58, 51, 6, -1, 6, -1, -1, 59, 60, -1, 9, 3, 63, 55, 12, 3, - -1, -1, 61, 62, -1, 24, 52, 8, 3, -1, - 25, 52, 8, 3, -1, 26, 52, 8, 3, -1, - 27, 52, 8, 3, -1, 14, 52, 8, 3, -1, - 15, 52, 8, 3, -1, 28, 52, 8, 3, -1, - 29, 52, 8, 3, -1, 30, 52, 8, 3, -1, - 31, 52, 8, 3, -1, 32, 52, 8, 3, -1, - 33, 52, 8, 3, -1, 34, 52, 8, 3, -1, - 35, 52, 8, 3, -1, 23, 52, 8, 3, -1, - 36, 52, 8, 3, -1, 37, 52, 8, 3, -1, - 38, 52, 8, 3, -1, 39, 52, 6, 3, -1, - 40, 52, 6, 3, -1, 43, 52, 6, 3, -1, - 41, 52, 7, 3, -1, 41, 52, 6, 3, -1, - 42, 52, 7, 3, -1, 44, 52, 7, 3, -1, - 45, 52, 7, 3, -1, 22, 52, 7, 3, -1, - 22, 52, 6, 3, -1, 10, 52, 57, 3, -1, - 46, 52, 58, 3, -1, 4, 3, -1, -1, 63, - 64, -1, 21, 3, -1, 11, 52, 8, 3, -1, - 14, 52, 8, 3, -1, 15, 52, 8, 3, -1, - 17, 52, 7, 3, -1, 18, 52, 8, 3, -1, - 18, 52, 6, 3, -1, 23, 52, 8, 3, -1, - 19, 52, 8, 3, -1, 20, 52, 8, 3, -1, - 13, 52, 8, 3, -1, 22, 52, 7, 3, -1, - 22, 52, 6, 3, -1, 10, 52, 57, 3, -1, - 16, 52, 7, 3, -1, 16, 52, 7, 7, 3, - -1, 16, 52, 6, 3, -1, 16, 52, 6, 6, - 3, -1, 4, 3, -1, 61, 59, 0, -1, 65, - -1 + -1, 9, 3, 63, 12, 3, -1, -1, 61, 62, + -1, 24, 52, 8, 3, -1, 25, 52, 8, 3, + -1, 26, 52, 8, 3, -1, 27, 52, 8, 3, + -1, 14, 52, 8, 3, -1, 15, 52, 8, 3, + -1, 28, 52, 8, 3, -1, 29, 52, 8, 3, + -1, 30, 52, 8, 3, -1, 31, 52, 8, 3, + -1, 32, 52, 8, 3, -1, 33, 52, 8, 3, + -1, 34, 52, 8, 3, -1, 35, 52, 8, 3, + -1, 23, 52, 8, 3, -1, 36, 52, 8, 3, + -1, 37, 52, 8, 3, -1, 38, 52, 8, 3, + -1, 39, 52, 6, 3, -1, 40, 52, 6, 3, + -1, 43, 52, 6, 3, -1, 41, 52, 7, 3, + -1, 41, 52, 6, 3, -1, 42, 52, 7, 3, + -1, 44, 52, 7, 3, -1, 44, 52, 6, 3, + -1, 45, 52, 7, 3, -1, 45, 52, 6, 3, + -1, 22, 52, 7, 3, -1, 22, 52, 6, 3, + -1, 10, 52, 57, 3, -1, 46, 52, 58, 3, + -1, 4, 3, -1, -1, 63, 64, -1, 21, 3, + -1, 11, 52, 8, 3, -1, 14, 52, 8, 3, + -1, 15, 52, 8, 3, -1, 17, 52, 7, 3, + -1, 17, 52, 6, 3, -1, 17, 52, 7, 48, + 7, 3, -1, 17, 52, 7, 48, 6, 3, -1, + 17, 52, 6, 48, 7, 3, -1, 17, 52, 6, + 48, 6, 3, -1, 18, 52, 6, 3, -1, 18, + 52, 6, 48, 6, 3, -1, 23, 52, 8, 3, + -1, 19, 52, 8, 3, -1, 20, 52, 8, 3, + -1, 13, 52, 8, 3, -1, 22, 52, 7, 3, + -1, 22, 52, 6, 3, -1, 10, 52, 57, 3, + -1, 16, 52, 7, 3, -1, 16, 52, 7, 7, + 3, -1, 16, 52, 7, 6, 3, -1, 16, 52, + 6, 3, -1, 16, 52, 6, 7, 3, -1, 16, + 52, 6, 6, 3, -1, 4, 3, -1, 61, 59, + 0, -1, 65, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -1445,26 +1526,28 @@ { 0, 0, 3, 7, 11, 15, 19, 22, 24, 27, 30, 34, 38, 42, 44, 48, 50, 51, 54, 61, - 62, 65, 70, 75, 80, 85, 90, 95, 100, 105, - 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, - 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, - 210, 215, 218, 219, 222, 225, 230, 235, 240, 245, - 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, - 301, 306, 312, 315, 319 + 67, 68, 71, 76, 81, 86, 91, 96, 101, 106, + 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, + 161, 166, 171, 176, 181, 186, 191, 196, 201, 206, + 211, 216, 221, 226, 231, 234, 235, 238, 241, 246, + 251, 256, 261, 266, 273, 280, 287, 294, 299, 306, + 311, 316, 321, 326, 331, 336, 341, 346, 352, 358, + 363, 369, 375, 378, 382 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned char Parser::yyrline_[] = { - 0, 130, 130, 131, 132, 133, 135, 136, 138, 139, - 141, 142, 143, 144, 146, 147, 149, 150, 156, 162, - 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 197, 198, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 221, 227 + 0, 131, 131, 132, 133, 134, 136, 137, 139, 140, + 142, 143, 144, 145, 147, 148, 150, 151, 157, 162, + 164, 165, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 201, 202, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 232, 238 }; // Print the state stack on the debug stream. @@ -1543,7 +1626,7 @@ } const int Parser::yyeof_ = 0; - const int Parser::yylast_ = 228; + const int Parser::yylast_ = 247; const int Parser::yynnts_ = 14; const int Parser::yyempty_ = -2; const int Parser::yyfinal_ = 35; @@ -1561,11 +1644,11 @@ } // mgf /* Line 1054 of lalr1.cc */ -#line 1565 "Parser.cpp" +#line 1648 "Parser.cpp" /* Line 1056 of lalr1.cc */ -#line 229 "Parser.ypp" +#line 240 "Parser.ypp" /*** Additional Code ***/ void mgf::Parser::error(const Parser::location_type& l, const std::string& m) Modified: trunk/mgfp/src/Parser.h =================================================================== --- trunk/mgfp/src/Parser.h 2010-09-10 15:30:49 UTC (rev 37) +++ trunk/mgfp/src/Parser.h 2010-09-10 15:33:39 UTC (rev 38) @@ -47,6 +47,7 @@ #include <cstdio> #include <string> +#include <utility> #include <vector> using namespace mgf; @@ -55,7 +56,7 @@ /* Line 35 of lalr1.cc */ -#line 59 "Parser.h" +#line 60 "Parser.h" #include <string> @@ -69,7 +70,7 @@ namespace mgf { /* Line 35 of lalr1.cc */ -#line 73 "Parser.h" +#line 74 "Parser.h" class position; class location; @@ -79,7 +80,7 @@ } // mgf /* Line 35 of lalr1.cc */ -#line 83 "Parser.h" +#line 84 "Parser.h" #include "location.h" @@ -127,7 +128,7 @@ namespace mgf { /* Line 35 of lalr1.cc */ -#line 131 "Parser.h" +#line 132 "Parser.h" /// A Bison parser. class Parser @@ -139,7 +140,7 @@ { /* Line 35 of lalr1.cc */ -#line 52 "Parser.ypp" +#line 53 "Parser.ypp" int integerVal; double doubleVal; @@ -152,7 +153,7 @@ /* Line 35 of lalr1.cc */ -#line 156 "Parser.h" +#line 157 "Parser.h" }; #else typedef YYSTYPE semantic_type; @@ -385,7 +386,7 @@ } // mgf /* Line 35 of lalr1.cc */ -#line 389 "Parser.h" +#line 390 "Parser.h" Modified: trunk/mgfp/src/Parser.ypp =================================================================== --- trunk/mgfp/src/Parser.ypp 2010-09-10 15:30:49 UTC (rev 37) +++ trunk/mgfp/src/Parser.ypp 2010-09-10 15:33:39 UTC (rev 38) @@ -6,6 +6,7 @@ #include <cstdio> #include <string> +#include <utility> #include <vector> using namespace mgf; @@ -158,6 +159,7 @@ driver.context.currentSpectrum.assign(($4->pairlist_)->begin(), ($4->pairlist_)->end()); delete $4; } + | BEGIN_IONS EOL localparams END_IONS EOL globalparams : /*empty*/ | globalparams globalparam @@ -187,7 +189,9 @@ | ITOL '=' INTEGER EOL { driver.context.header.setITOL($3); } | PEP_ISOTOPE_ERROR '=' DOUBLE EOL { driver.context.header.setPEP_ISOTOPE_ERROR($3); } | PRECURSOR '=' DOUBLE EOL { driver.context.header.setPRECURSOR($3); } + | PRECURSOR '=' INTEGER EOL { driver.context.header.setPRECURSOR($3); } | SEG '=' DOUBLE EOL { driver.context.header.setSEG($3); } + | SEG '=' INTEGER EOL { driver.context.header.setSEG($3); } | TOL '=' DOUBLE EOL { driver.context.header.setTOL($3); } | TOL '=' INTEGER EOL { driver.context.header.setTOL($3); } | CHARGE '=' charges EOL { driver.context.header.setCHARGE(*($3->integers_)); delete $3; } @@ -202,8 +206,13 @@ | INSTRUMENT '=' STRING EOL { driver.context.currentSpectrum.setINSTRUMENT(*$3); delete $3; } | IT_MODS '=' STRING EOL { driver.context.currentSpectrum.setIT_MODS(*$3); delete $3; } | RTINSECONDS '=' DOUBLE EOL { driver.context.currentSpectrum.setRTINSECONDS($3); } - | SCANS '=' STRING EOL { driver.context.currentSpectrum.setSCANS(*$3); delete $3; } - | SCANS '=' INTEGER EOL { driver.context.currentSpectrum.setSCANS($3); } + | RTINSECONDS '=' INTEGER EOL { driver.context.currentSpectrum.setRTINSECONDS($3); } + | RTINSECONDS '=' DOUBLE '-' DOUBLE EOL { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair($3, $5)); } + | RTINSECONDS '=' DOUBLE '-' INTEGER EOL { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair($3, $5)); } + | RTINSECONDS '=' INTEGER '-' DOUBLE EOL { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair($3, $5)); } + | RTINSECONDS '=' INTEGER '-' INTEGER EOL { driver.context.currentSpectrum.setRTINSECONDS(std::make_pair($3, $5)); } + | SCANS '=' INTEGER EOL { driver.context.currentSpectrum.setSCANS(std::make_pair($3, -1)); } + | SCANS '=' INTEGER '-' INTEG... [truncated message content] |
From: <mki...@us...> - 2010-09-10 15:30:56
|
Revision: 37 http://mgfp.svn.sourceforge.net/mgfp/?rev=37&view=rev Author: mkirchner Date: 2010-09-10 15:30:49 +0000 (Fri, 10 Sep 2010) Log Message: ----------- - bugfix and generalization to TMT and iTRAQ-4 Modified Paths: -------------- trunk/mgfp/applications/tmtx/tmtx.cpp Modified: trunk/mgfp/applications/tmtx/tmtx.cpp =================================================================== --- trunk/mgfp/applications/tmtx/tmtx.cpp 2010-09-09 21:29:45 UTC (rev 36) +++ trunk/mgfp/applications/tmtx/tmtx.cpp 2010-09-10 15:30:49 UTC (rev 37) @@ -22,6 +22,8 @@ */ #include <cmath> +#include <fstream> +#include <iomanip> #include <iostream> #include <iterator> #include <tr1/array> @@ -62,35 +64,73 @@ } } -static const double tmtMasses[10] = - { 124.0, 125.0, 126.0, 127.0, 128.0, - 129.0, 130.0, 131.0, 132.0, 133.0 }; +enum LabelType { TMT, ITRAQ4, SIZE }; +static const size_t sizes[SIZE] = { 10, 8 }; +static const double masses[SIZE][10] = + { + { 124.0, 125.0, 126.0, 127.0, 128.0, + 129.0, 130.0, 131.0, 132.0, 133.0 }, + { 112.1, 113.1, 114.1112, 115.1083, 116.1116, + 117.115, 118.1, 119.1, 0.0, 0.0 }}; int main(int argc, char *argv[]) { namespace po = boost::program_options; po::options_description desc("Allowed options"); bool verbose = false; + std::string inputfile; + size_t precision; desc.add_options() ("help,h", "produce help message") ("verbose,v", po::value(&verbose)->zero_tokens(), "verbose output (good to pinpoint parsing errors)") + ("type,t", po::value<std::string>(), "label type: one of TMT, ITRAQ4") + ("input,i", po::value<std::string>(&inputfile)->default_value("-"), + "input filename, defaults to stdin") + ("tee,e", po::value<std::string>(), "run in tee mode: extract label " + "abundances to specified file and simply pipe MGF data from stdin " + "to stdout.") + ("precision,p", po::value<size_t>(&precision)->default_value(6), + "number of significant digits in output") ; po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); po::notify(vm); // check if the user asked for help - if (vm.count("help")) { + if (vm.count("help") || !vm.count("type")) { std::cerr << desc; return 1; } + // figure put which labeling technique we use + LabelType labelType; + if (vm["type"].as<std::string>() == "TMT") { + labelType = TMT; + } else if (vm["type"].as<std::string>() == "ITRAQ4") { + labelType = ITRAQ4; + } else { + std::cerr << vm["type"].as<std::string>() << std::endl; + std::cerr << desc; + return 1; + } + // initialize the masses + std::vector<double> labelMasses(sizes[labelType]); + for (size_t n = 0; n < sizes[labelType]; ++n) { + labelMasses[n] = masses[labelType][n]; + } // prepare the parser mgf::MgfFile m; mgf::Driver driver(m); driver.trace_parsing = verbose; driver.trace_scanning = verbose; - // parse input - bool result = driver.parse_stream(std::cin); + // parse input + bool result; + if (inputfile == "-") { + result = driver.parse_stream(std::cin); + } else { + std::ifstream ifs(inputfile.c_str()); + result = driver.parse_stream(ifs); + ifs.close(); + } if (!result) { std::cerr << std::endl << "Error parsing data stream (use -v for details)." << std::endl; @@ -98,27 +138,33 @@ } typedef mgf::MgfFile::iterator MFI; // iterate over all spectra + std::vector<double> obsAbundances(sizes[labelType]); for (MFI i = m.begin(); i != m.end(); ++i) { // sort std::sort(i->begin(), i->end(), mgf::LessThanMz()); typedef mgf::MgfSpectrum::iterator MSI; // extract TMT reproter ion intensities - double obsTmtAbundances[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; - for (size_t n = 0; n < 6; ++n) { - MSI closestIt = findClosestMz(i->begin(), i->end(), tmtMasses[n]); - // check if there is a MS2 centroid - if (std::abs(closestIt->first - tmtMasses[n]) < 0.4) { - obsTmtAbundances[n] = closestIt->second; - } else { - obsTmtAbundances[n] = 0.0; + bool atLeastOneEntry = false; + for (size_t n = 0; n < sizes[labelType]; ++n) { + MSI closestIt = findClosestMz(i->begin(), i->end(), labelMasses[n]); + if (closestIt != i->end()) { + // check if there is an MS2 centroid + if (std::abs(closestIt->first - labelMasses[n]) < 0.4) { + obsAbundances[n] = closestIt->second; + if (!atLeastOneEntry) atLeastOneEntry = true; + } else { + obsAbundances[n] = 0.0; + } } } // extract into file - std::cout << i->getTITLE(); - for (size_t n = 0; n < 6; ++n) { - std::cout << '\t' << obsTmtAbundances[n]; + if (atLeastOneEntry) { + std::cout << i->getTITLE(); + for (size_t n = 0; n < sizes[labelType]; ++n) { + std::cout << '\t' << std::setprecision(precision) << obsAbundances[n]; + } + std::cout << '\n'; // don't use std::endl, save the std::flush. } - std::cout << std::endl; } return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-09-09 21:29:53
|
Revision: 36 http://mgfp.svn.sourceforge.net/mgfp/?rev=36&view=rev Author: mkirchner Date: 2010-09-09 21:29:45 +0000 (Thu, 09 Sep 2010) Log Message: ----------- now allowing numbers for SCANS Modified Paths: -------------- trunk/mgfp/include/mgfp/MgfSpectrum.h trunk/mgfp/src/MgfSpectrum.cpp trunk/mgfp/src/Parser.cpp trunk/mgfp/src/Parser.h trunk/mgfp/src/Parser.ypp trunk/mgfp/src/Scanner.cpp trunk/mgfp/src/location.h trunk/mgfp/src/position.h trunk/mgfp/src/stack.h Modified: trunk/mgfp/include/mgfp/MgfSpectrum.h =================================================================== --- trunk/mgfp/include/mgfp/MgfSpectrum.h 2010-09-08 03:51:39 UTC (rev 35) +++ trunk/mgfp/include/mgfp/MgfSpectrum.h 2010-09-09 21:29:45 UTC (rev 36) @@ -145,6 +145,12 @@ */ void setSCANS(const std::string& scans); + /** Set + * @see + * @param[in] + */ + void setSCANS(const int scans); + /** Get the amino acid sequence. Please consult the detailed description in * the Mascot documentation (see link). * @see http://www.matrixscience.com/help/sq_help.html#SEQ Modified: trunk/mgfp/src/MgfSpectrum.cpp =================================================================== --- trunk/mgfp/src/MgfSpectrum.cpp 2010-09-08 03:51:39 UTC (rev 35) +++ trunk/mgfp/src/MgfSpectrum.cpp 2010-09-09 21:29:45 UTC (rev 36) @@ -1,6 +1,7 @@ #include <mgfp/MgfSpectrum.h> #include <cstdlib> // for std::abs(int) +#include <sstream> namespace mgf { @@ -71,6 +72,12 @@ scans_ = scans; //FIXME } +void MgfSpectrum::setSCANS(const int scans) { + std::ostringstream oss; + oss << scans; + scans_ = oss.str(); //FIXME +} + std::string MgfSpectrum::getSEQ(void) const { return seq_ ; } Modified: trunk/mgfp/src/Parser.cpp =================================================================== --- trunk/mgfp/src/Parser.cpp 2010-09-08 03:51:39 UTC (rev 35) +++ trunk/mgfp/src/Parser.cpp 2010-09-09 21:29:45 UTC (rev 36) @@ -1,23 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.4.1. */ + /* Skeleton implementation for Bison LALR(1) parsers in C++ - - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -28,18 +28,27 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ // Take the name prefix into account. #define yylex mgflex +/* First part of user declarations. */ + + +/* Line 311 of lalr1.cc */ +#line 43 "Parser.cpp" + + #include "Parser.h" /* User implementation prologue. */ -#line 127 "Parser.ypp" +/* Line 317 of lalr1.cc */ +#line 117 "Parser.ypp" + #include <mgfp/Driver.h> #include "Scanner.h" @@ -50,11 +59,11 @@ #define yylex driver.lexer->lex -/* Line 317 of lalr1.cc. */ -#line 55 "Parser.cpp" +/* Line 317 of lalr1.cc */ +#line 64 "Parser.cpp" #ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS +# if YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -68,14 +77,12 @@ /* Suppress unused-variable warnings by "using" E. */ #define YYUSE(e) ((void) (e)) -/* A pseudo ostream that takes yydebug_ into account. */ -# define YYCDEBUG \ - for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \ - (*yycdebug_) - /* Enable debugging if requested. */ #if YYDEBUG +/* A pseudo ostream that takes yydebug_ into account. */ +# define YYCDEBUG if (yydebug_) (*yycdebug_) + # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug_) \ @@ -100,18 +107,29 @@ #else /* !YYDEBUG */ +# define YYCDEBUG if (false) std::cerr # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_REDUCE_PRINT(Rule) # define YY_STACK_PRINT() #endif /* !YYDEBUG */ +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yychar = yyempty_) + #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) -namespace mgf -{ + +/* Line 380 of lalr1.cc */ +#line 1 "[Bison:b4_percent_define_default]" + +namespace mgf { + +/* Line 380 of lalr1.cc */ +#line 133 "Parser.cpp" #if YYERROR_VERBOSE /* Return YYSTR after stripping away unnecessary quotes and @@ -155,8 +173,11 @@ /// Build a parser object. Parser::Parser (Driver& driver_yyarg) - : yydebug_ (false), + : +#if YYDEBUG + yydebug_ (false), yycdebug_ (&std::cerr), +#endif driver (driver_yyarg) { } @@ -194,7 +215,7 @@ yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); *yycdebug_ << ')'; } -#endif /* ! YYDEBUG */ +#endif void Parser::yydestruct_ (const char* yymsg, @@ -209,34 +230,58 @@ switch (yytype) { case 8: /* "\"string\"" */ -#line 124 "Parser.ypp" + +/* Line 480 of lalr1.cc */ +#line 114 "Parser.ypp" { delete (yyvaluep->stringVal); }; -#line 215 "Parser.cpp" + +/* Line 480 of lalr1.cc */ +#line 240 "Parser.cpp" break; case 54: /* "ion" */ -#line 125 "Parser.ypp" + +/* Line 480 of lalr1.cc */ +#line 115 "Parser.ypp" { delete (yyvaluep->doublepairnode); }; -#line 220 "Parser.cpp" + +/* Line 480 of lalr1.cc */ +#line 249 "Parser.cpp" break; case 55: /* "ions" */ -#line 125 "Parser.ypp" + +/* Line 480 of lalr1.cc */ +#line 115 "Parser.ypp" { delete (yyvaluep->doublepairlistnode); }; -#line 225 "Parser.cpp" + +/* Line 480 of lalr1.cc */ +#line 258 "Parser.cpp" break; case 56: /* "charge" */ -#line 125 "Parser.ypp" + +/* Line 480 of lalr1.cc */ +#line 115 "Parser.ypp" { delete (yyvaluep->integernode); }; -#line 230 "Parser.cpp" + +/* Line 480 of lalr1.cc */ +#line 267 "Parser.cpp" break; case 57: /* "charges" */ -#line 125 "Parser.ypp" + +/* Line 480 of lalr1.cc */ +#line 115 "Parser.ypp" { delete (yyvaluep->integerlistnode); }; -#line 235 "Parser.cpp" + +/* Line 480 of lalr1.cc */ +#line 276 "Parser.cpp" break; case 58: /* "csintegerlist" */ -#line 125 "Parser.ypp" + +/* Line 480 of lalr1.cc */ +#line 115 "Parser.ypp" { delete (yyvaluep->integerlistnode); }; -#line 240 "Parser.cpp" + +/* Line 480 of lalr1.cc */ +#line 285 "Parser.cpp" break; default: @@ -252,6 +297,7 @@ yylocation_stack_.pop (n); } +#if YYDEBUG std::ostream& Parser::debug_stream () const { @@ -276,12 +322,12 @@ { yydebug_ = l; } +#endif - int Parser::parse () { - /// Look-ahead and look-ahead in internal form. + /// Lookahead and lookahead in internal form. int yychar = yyempty_; int yytoken = 0; @@ -294,12 +340,12 @@ int yynerrs_ = 0; int yyerrstatus_ = 0; - /// Semantic value of the look-ahead. + /// Semantic value of the lookahead. semantic_type yylval; - /// Location of the look-ahead. + /// Location of the lookahead. location_type yylloc; /// The locations where the error started and ended. - location yyerror_range[2]; + location_type yyerror_range[2]; /// $$. semantic_type yyval; @@ -312,13 +358,17 @@ /* User initialization code. */ - #line 49 "Parser.ypp" + +/* Line 553 of lalr1.cc */ +#line 39 "Parser.ypp" { // initialize the initial location object yylloc.begin.filename = yylloc.end.filename = &driver.streamname; } - /* Line 555 of yacc.c. */ -#line 322 "Parser.cpp" + +/* Line 553 of lalr1.cc */ +#line 371 "Parser.cpp" + /* Initialize the stacks. The initial state will be pushed in yynewstate, since the latter expects the semantical and the location values to have been already stored, initialize these @@ -333,17 +383,22 @@ yynewstate: yystate_stack_.push (yystate); YYCDEBUG << "Entering state " << yystate << std::endl; + + /* Accept? */ + if (yystate == yyfinal_) + goto yyacceptlab; + goto yybackup; /* Backup. */ yybackup: - /* Try to take a decision without look-ahead. */ + /* Try to take a decision without lookahead. */ yyn = yypact_[yystate]; if (yyn == yypact_ninf_) goto yydefault; - /* Read a look-ahead token. */ + /* Read a lookahead token. */ if (yychar == yyempty_) { YYCDEBUG << "Reading a token: "; @@ -379,16 +434,11 @@ goto yyreduce; } - /* Accept? */ - if (yyn == yyfinal_) - goto yyacceptlab; - - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the token being shifted unless it is eof. */ - if (yychar != yyeof_) - yychar = yyempty_; + /* Discard the token being shifted. */ + yychar = yyempty_; yysemantic_stack_.push (yylval); yylocation_stack_.push (yylloc); @@ -434,338 +484,475 @@ switch (yyn) { case 2: -#line 140 "Parser.ypp" - { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].doubleVal), (yysemantic_stack_[(3) - (2)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 130 "Parser.ypp" + { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].doubleVal), (yysemantic_stack_[(3) - (2)].doubleVal)); } break; case 3: -#line 141 "Parser.ypp" - { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].integerVal), (yysemantic_stack_[(3) - (2)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 131 "Parser.ypp" + { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].integerVal), (yysemantic_stack_[(3) - (2)].doubleVal)); } break; case 4: -#line 142 "Parser.ypp" - { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].doubleVal), (yysemantic_stack_[(3) - (2)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 132 "Parser.ypp" + { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].doubleVal), (yysemantic_stack_[(3) - (2)].integerVal)); } break; case 5: -#line 143 "Parser.ypp" - { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].integerVal), (yysemantic_stack_[(3) - (2)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 133 "Parser.ypp" + { (yyval.doublepairnode) = new DoublePairNode((yysemantic_stack_[(3) - (1)].integerVal), (yysemantic_stack_[(3) - (2)].integerVal)); } break; case 6: -#line 145 "Parser.ypp" - { (yyval.doublepairlistnode) = new DoublePairListNode((yysemantic_stack_[(2) - (1)].doublepairlistnode), (yysemantic_stack_[(2) - (2)].doublepairnode)); ;} + +/* Line 678 of lalr1.cc */ +#line 135 "Parser.ypp" + { (yyval.doublepairlistnode) = new DoublePairListNode((yysemantic_stack_[(2) - (1)].doublepairlistnode), (yysemantic_stack_[(2) - (2)].doublepairnode)); } break; case 7: -#line 146 "Parser.ypp" - { (yyval.doublepairlistnode) = new DoublePairListNode((yysemantic_stack_[(1) - (1)].doublepairnode)); ;} + +/* Line 678 of lalr1.cc */ +#line 136 "Parser.ypp" + { (yyval.doublepairlistnode) = new DoublePairListNode((yysemantic_stack_[(1) - (1)].doublepairnode)); } break; case 8: -#line 148 "Parser.ypp" - { (yyval.integernode) = new IntegerNode((yysemantic_stack_[(2) - (1)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 138 "Parser.ypp" + { (yyval.integernode) = new IntegerNode((yysemantic_stack_[(2) - (1)].integerVal)); } break; case 9: -#line 149 "Parser.ypp" - { (yyval.integernode) = new IntegerNode(-(yysemantic_stack_[(2) - (1)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 139 "Parser.ypp" + { (yyval.integernode) = new IntegerNode(-(yysemantic_stack_[(2) - (1)].integerVal)); } break; case 10: -#line 151 "Parser.ypp" - { (yyval.integerlistnode) = (yysemantic_stack_[(3) - (2)].integerlistnode); ;} + +/* Line 678 of lalr1.cc */ +#line 141 "Parser.ypp" + { (yyval.integerlistnode) = (yysemantic_stack_[(3) - (2)].integerlistnode); } break; case 11: -#line 152 "Parser.ypp" - { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integernode)); ;} + +/* Line 678 of lalr1.cc */ +#line 142 "Parser.ypp" + { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integernode)); } break; case 12: -#line 153 "Parser.ypp" - { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integernode)); ;} + +/* Line 678 of lalr1.cc */ +#line 143 "Parser.ypp" + { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integernode)); } break; case 13: -#line 154 "Parser.ypp" - { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(1) - (1)].integernode)); ;} + +/* Line 678 of lalr1.cc */ +#line 144 "Parser.ypp" + { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(1) - (1)].integernode)); } break; case 14: -#line 156 "Parser.ypp" - { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 146 "Parser.ypp" + { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(3) - (1)].integerlistnode), (yysemantic_stack_[(3) - (3)].integerVal)); } break; case 15: -#line 157 "Parser.ypp" - { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(1) - (1)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 147 "Parser.ypp" + { (yyval.integerlistnode) = new IntegerListNode((yysemantic_stack_[(1) - (1)].integerVal)); } break; case 17: -#line 161 "Parser.ypp" + +/* Line 678 of lalr1.cc */ +#line 151 "Parser.ypp" { driver.context.mgfFile.push_back(driver.context.currentSpectrum); driver.context.currentSpectrum.clear(); - ;} + } break; case 18: -#line 167 "Parser.ypp" + +/* Line 678 of lalr1.cc */ +#line 157 "Parser.ypp" { driver.context.currentSpectrum.assign(((yysemantic_stack_[(6) - (4)].doublepairlistnode)->pairlist_)->begin(), ((yysemantic_stack_[(6) - (4)].doublepairlistnode)->pairlist_)->end()); delete (yysemantic_stack_[(6) - (4)].doublepairlistnode); - ;} + } break; case 21: -#line 175 "Parser.ypp" - { driver.context.header.setCLE(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 165 "Parser.ypp" + { driver.context.header.setCLE(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 22: -#line 176 "Parser.ypp" - { driver.context.header.setCOM(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 166 "Parser.ypp" + { driver.context.header.setCOM(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 23: -#line 177 "Parser.ypp" - { driver.context.header.setDB(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 167 "Parser.ypp" + { driver.context.header.setDB(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 24: -#line 178 "Parser.ypp" - { driver.context.header.setFORMAT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 168 "Parser.ypp" + { driver.context.header.setFORMAT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 25: -#line 179 "Parser.ypp" - { driver.context.header.setINSTRUMENT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 169 "Parser.ypp" + { driver.context.header.setINSTRUMENT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 26: -#line 180 "Parser.ypp" - { driver.context.header.setIT_MODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 170 "Parser.ypp" + { driver.context.header.setIT_MODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 27: -#line 181 "Parser.ypp" - { driver.context.header.setITOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 171 "Parser.ypp" + { driver.context.header.setITOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 28: -#line 182 "Parser.ypp" - { driver.context.header.setMASS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 172 "Parser.ypp" + { driver.context.header.setMASS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 29: -#line 183 "Parser.ypp" - { driver.context.header.setMODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 173 "Parser.ypp" + { driver.context.header.setMODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 30: -#line 184 "Parser.ypp" - { driver.context.header.setQUANTITATION(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 174 "Parser.ypp" + { driver.context.header.setQUANTITATION(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 31: -#line 185 "Parser.ypp" - { driver.context.header.setREPORT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 175 "Parser.ypp" + { driver.context.header.setREPORT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 32: -#line 186 "Parser.ypp" - { driver.context.header.setREPTYPE(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 176 "Parser.ypp" + { driver.context.header.setREPTYPE(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 33: -#line 187 "Parser.ypp" - { driver.context.header.setSEARCH(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 177 "Parser.ypp" + { driver.context.header.setSEARCH(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 34: -#line 188 "Parser.ypp" - { driver.context.header.setTAXONOMY(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 178 "Parser.ypp" + { driver.context.header.setTAXONOMY(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 35: -#line 189 "Parser.ypp" - { driver.context.header.setTOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 179 "Parser.ypp" + { driver.context.header.setTOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 36: -#line 190 "Parser.ypp" - { /*driver.context.header.setUSER(*$3);*/ delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 180 "Parser.ypp" + { /*driver.context.header.setUSER(*$3);*/ delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 37: -#line 191 "Parser.ypp" - { driver.context.header.setUSEREMAIL(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 181 "Parser.ypp" + { driver.context.header.setUSEREMAIL(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 38: -#line 192 "Parser.ypp" - { driver.context.header.setUSERNAME(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 182 "Parser.ypp" + { driver.context.header.setUSERNAME(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 39: -#line 193 "Parser.ypp" - { driver.context.header.setDECOY(((yysemantic_stack_[(4) - (3)].integerVal))!=0); ;} + +/* Line 678 of lalr1.cc */ +#line 183 "Parser.ypp" + { driver.context.header.setDECOY(((yysemantic_stack_[(4) - (3)].integerVal))!=0); } break; case 40: -#line 194 "Parser.ypp" - { driver.context.header.setERRORTOLERANT(((yysemantic_stack_[(4) - (3)].integerVal))!=0); ;} + +/* Line 678 of lalr1.cc */ +#line 184 "Parser.ypp" + { driver.context.header.setERRORTOLERANT(((yysemantic_stack_[(4) - (3)].integerVal))!=0); } break; case 41: -#line 195 "Parser.ypp" - { driver.context.header.setPFA((yysemantic_stack_[(4) - (3)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 185 "Parser.ypp" + { driver.context.header.setPFA((yysemantic_stack_[(4) - (3)].integerVal)); } break; case 42: -#line 196 "Parser.ypp" - { driver.context.header.setITOL((yysemantic_stack_[(4) - (3)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 186 "Parser.ypp" + { driver.context.header.setITOL((yysemantic_stack_[(4) - (3)].doubleVal)); } break; case 43: -#line 197 "Parser.ypp" - { driver.context.header.setITOL((yysemantic_stack_[(4) - (3)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 187 "Parser.ypp" + { driver.context.header.setITOL((yysemantic_stack_[(4) - (3)].integerVal)); } break; case 44: -#line 198 "Parser.ypp" - { driver.context.header.setPEP_ISOTOPE_ERROR((yysemantic_stack_[(4) - (3)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 188 "Parser.ypp" + { driver.context.header.setPEP_ISOTOPE_ERROR((yysemantic_stack_[(4) - (3)].doubleVal)); } break; case 45: -#line 199 "Parser.ypp" - { driver.context.header.setPRECURSOR((yysemantic_stack_[(4) - (3)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 189 "Parser.ypp" + { driver.context.header.setPRECURSOR((yysemantic_stack_[(4) - (3)].doubleVal)); } break; case 46: -#line 200 "Parser.ypp" - { driver.context.header.setSEG((yysemantic_stack_[(4) - (3)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 190 "Parser.ypp" + { driver.context.header.setSEG((yysemantic_stack_[(4) - (3)].doubleVal)); } break; case 47: -#line 201 "Parser.ypp" - { driver.context.header.setTOL((yysemantic_stack_[(4) - (3)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 191 "Parser.ypp" + { driver.context.header.setTOL((yysemantic_stack_[(4) - (3)].doubleVal)); } break; case 48: -#line 202 "Parser.ypp" - { driver.context.header.setTOL((yysemantic_stack_[(4) - (3)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 192 "Parser.ypp" + { driver.context.header.setTOL((yysemantic_stack_[(4) - (3)].integerVal)); } break; case 49: -#line 203 "Parser.ypp" - { driver.context.header.setCHARGE(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); ;} + +/* Line 678 of lalr1.cc */ +#line 193 "Parser.ypp" + { driver.context.header.setCHARGE(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); } break; case 50: -#line 204 "Parser.ypp" - { driver.context.header.setFRAMES(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); ;} + +/* Line 678 of lalr1.cc */ +#line 194 "Parser.ypp" + { driver.context.header.setFRAMES(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); } break; case 54: -#line 210 "Parser.ypp" - { driver.context.currentSpectrum.setTITLE(*(yysemantic_stack_[(2) - (1)].stringVal)); delete (yysemantic_stack_[(2) - (1)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 200 "Parser.ypp" + { driver.context.currentSpectrum.setTITLE(*(yysemantic_stack_[(2) - (1)].stringVal)); delete (yysemantic_stack_[(2) - (1)].stringVal); } break; case 55: -#line 211 "Parser.ypp" - { driver.context.currentSpectrum.setCOMP(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 201 "Parser.ypp" + { driver.context.currentSpectrum.setCOMP(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 56: -#line 212 "Parser.ypp" - { driver.context.currentSpectrum.setINSTRUMENT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 202 "Parser.ypp" + { driver.context.currentSpectrum.setINSTRUMENT(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 57: -#line 213 "Parser.ypp" - { driver.context.currentSpectrum.setIT_MODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 203 "Parser.ypp" + { driver.context.currentSpectrum.setIT_MODS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 58: -#line 214 "Parser.ypp" - { driver.context.currentSpectrum.setRTINSECONDS((yysemantic_stack_[(4) - (3)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 204 "Parser.ypp" + { driver.context.currentSpectrum.setRTINSECONDS((yysemantic_stack_[(4) - (3)].doubleVal)); } break; case 59: -#line 215 "Parser.ypp" - { driver.context.currentSpectrum.setSCANS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 205 "Parser.ypp" + { driver.context.currentSpectrum.setSCANS(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 60: -#line 216 "Parser.ypp" - { driver.context.currentSpectrum.setTOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 206 "Parser.ypp" + { driver.context.currentSpectrum.setSCANS((yysemantic_stack_[(4) - (3)].integerVal)); } break; case 61: -#line 217 "Parser.ypp" - { driver.context.currentSpectrum.setSEQ(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 207 "Parser.ypp" + { driver.context.currentSpectrum.setTOLU(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 62: -#line 218 "Parser.ypp" - { driver.context.currentSpectrum.setTAG(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 208 "Parser.ypp" + { driver.context.currentSpectrum.setSEQ(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 63: -#line 219 "Parser.ypp" - { driver.context.currentSpectrum.setETAG(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); ;} + +/* Line 678 of lalr1.cc */ +#line 209 "Parser.ypp" + { driver.context.currentSpectrum.setTAG(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 64: -#line 220 "Parser.ypp" - { driver.context.currentSpectrum.setTOL((yysemantic_stack_[(4) - (3)].doubleVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 210 "Parser.ypp" + { driver.context.currentSpectrum.setETAG(*(yysemantic_stack_[(4) - (3)].stringVal)); delete (yysemantic_stack_[(4) - (3)].stringVal); } break; case 65: -#line 221 "Parser.ypp" - { driver.context.currentSpectrum.setTOL((yysemantic_stack_[(4) - (3)].integerVal)); ;} + +/* Line 678 of lalr1.cc */ +#line 211 "Parser.ypp" + { driver.context.currentSpectrum.setTOL((yysemantic_stack_[(4) - (3)].doubleVal)); } break; case 66: -#line 222 "Parser.ypp" - { driver.context.currentSpectrum.setCHARGE(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); ;} + +/* Line 678 of lalr1.cc */ +#line 212 "Parser.ypp" + { driver.context.currentSpectrum.setTOL((yysemantic_stack_[(4) - (3)].integerVal)); } break; case 67: -#line 223 "Parser.ypp" - { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(4) - (3)].doubleVal), 0.0)); ;} + +/* Line 678 of lalr1.cc */ +#line 213 "Parser.ypp" + { driver.context.currentSpectrum.setCHARGE(*((yysemantic_stack_[(4) - (3)].integerlistnode)->integers_)); delete (yysemantic_stack_[(4) - (3)].integerlistnode); } break; case 68: -#line 224 "Parser.ypp" - { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].doubleVal), (yysemantic_stack_[(5) - (4)].doubleVal))); ;} + +/* Line 678 of lalr1.cc */ +#line 214 "Parser.ypp" + { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(4) - (3)].doubleVal), 0.0)); } break; case 69: -#line 225 "Parser.ypp" - { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(4) - (3)].integerVal), 0.0)); ;} + +/* Line 678 of lalr1.cc */ +#line 215 "Parser.ypp" + { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].doubleVal), (yysemantic_stack_[(5) - (4)].doubleVal))); } break; case 70: -#line 226 "Parser.ypp" - { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].integerVal), (yysemantic_stack_[(5) - (4)].integerVal))); ;} + +/* Line 678 of lalr1.cc */ +#line 216 "Parser.ypp" + { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(4) - (3)].integerVal), 0.0)); } break; - case 72: -#line 231 "Parser.ypp" + case 71: + +/* Line 678 of lalr1.cc */ +#line 217 "Parser.ypp" + { driver.context.currentSpectrum.setPEPMASS(std::make_pair((yysemantic_stack_[(5) - (3)].integerVal), (yysemantic_stack_[(5) - (4)].integerVal))); } + break; + + case 73: + +/* Line 678 of lalr1.cc */ +#line 222 "Parser.ypp" { driver.context.mgfFile.setHeader(driver.context.header); driver.context.header.clear(); - ;} + } break; - /* Line 675 of lalr1.cc. */ -#line 768 "Parser.cpp" - default: break; + +/* Line 678 of lalr1.cc */ +#line 954 "Parser.cpp" + default: + break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); @@ -800,7 +987,7 @@ yyerror_range[0] = yylloc; if (yyerrstatus_ == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= yyeof_) @@ -816,7 +1003,7 @@ } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -873,19 +1060,16 @@ YY_STACK_PRINT (); } - if (yyn == yyfinal_) - goto yyacceptlab; - yyerror_range[1] = yylloc; // Using YYLLOC is tempting, but would change the location of - // the look-ahead. YYLOC is available though. + // the lookahead. YYLOC is available though. YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], - &yysemantic_stack_[0], &yylocation_stack_[0]); + &yysemantic_stack_[0], &yylocation_stack_[0]); yystate = yyn; goto yynewstate; @@ -901,7 +1085,7 @@ goto yyreturn; yyreturn: - if (yychar != yyeof_ && yychar != yyempty_) + if (yychar != yyempty_) yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); /* Do not reclaim the symbols of the rule which action triggered @@ -975,28 +1159,29 @@ const short int Parser::yypact_[] = { - -70, 33, -70, 8, 39, -22, -6, 36, 37, 40, + -70, 33, -70, 8, 30, -10, -6, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 27, -70, -70, -70, 5, 82, 83, - 26, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 127, 128, 32, - 129, 131, 132, 133, 135, -70, 139, -70, -7, 5, - -70, -2, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - -70, 2, -70, -70, -70, 1, -70, 168, 168, -70, + 62, 63, 64, 27, -70, -70, -70, 5, 109, 110, + 32, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 129, 130, 34, + 131, 133, 134, 135, 137, -70, 141, -70, -3, 5, + -70, -2, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + -70, 2, -70, -70, -70, 1, -70, 170, 170, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, 169, 3, - -70, -70, -70, -70, 170, 38, 74, 86, 125, 126, - 130, 134, 136, 137, 138, 171, 172, 173, 174, 175, - -70, 22, -70, -70, 176, 177, 178, 180, 5, 179, - 183, 184, 185, 76, 187, 188, 189, 190, -70, 78, - 191, 181, -70, -70, -70, -70, -70, -1, 182, 192, - 197, 198, 9, 28, 199, 200, 201, 202, 203, 204, - 205, -70, -70, -70, -70, -70, -70, -70, 206, -70, - 207, -70, -70, -70, -70, -70, -70, -70, -70, -70 + -70, -70, -70, -70, -70, -70, -70, -70, 171, 3, + -70, -70, -70, -70, 172, 74, 76, 85, 88, 127, + 128, 132, 136, 138, 139, 140, 173, 175, 174, 176, + -70, 22, -70, -70, 178, 179, 180, 182, 5, 181, + 185, 186, 187, 78, 189, 24, 190, 191, -70, 80, + 192, 183, -70, -70, -70, -70, -70, -1, 184, 194, + 198, 199, 9, 28, 200, 201, 202, 203, 204, 205, + 206, 207, -70, -70, -70, -70, -70, -70, -70, 208, + -70, 209, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -1005,13 +1190,13 @@ const unsigned char Parser::yydefact_[] = { - 19, 16, 73, 0, 0, 0, 0, 0, 0, 0, + 19, 16, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 1, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 72, 0, 17, 0, 0, + 0, 0, 0, 0, 0, 73, 0, 17, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1021,19 +1206,20 @@ 40, 43, 42, 44, 41, 45, 46, 50, 0, 0, 10, 12, 11, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 0, 53, 71, 0, 0, 0, 0, 0, 0, + 7, 0, 53, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 6, 5, 3, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 18, 66, 55, 63, 56, 57, 69, 0, 67, - 0, 58, 59, 61, 62, 65, 64, 60, 70, 68 + 0, 0, 18, 67, 55, 64, 56, 57, 70, 0, + 68, 0, 58, 60, 59, 62, 63, 66, 65, 61, + 71, 69 }; /* YYPGOTO[NTERM-NUM]. */ const signed char Parser::yypgoto_[] = { - -70, -26, -70, -21, -69, -70, -70, -70, -70, -70, + -70, 12, -70, -19, -69, -70, -70, -70, -70, -70, -70, -70, -70, -70 }; @@ -1052,29 +1238,29 @@ const unsigned char Parser::yytable_[] = { - 105, 106, 202, 107, 107, 137, 107, 144, 35, 145, - 146, 68, 207, 147, 148, 208, 149, 150, 151, 152, + 105, 106, 203, 107, 107, 137, 107, 144, 35, 145, + 146, 68, 208, 147, 148, 209, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 65, 145, 146, - 37, 209, 74, 75, 181, 210, 66, 4, 94, 95, - 103, 104, 36, 5, 164, 165, 38, 6, 7, 108, + 195, 210, 196, 36, 181, 211, 66, 4, 74, 75, + 94, 95, 37, 5, 103, 104, 38, 6, 7, 108, 108, 140, 108, 138, 69, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 166, 167, 192, 193, 198, 199, 141, 142, 39, 40, - 72, 73, 41, 42, 43, 44, 45, 46, 47, 187, + 164, 165, 166, 167, 192, 193, 199, 200, 141, 142, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 187, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 182, 96, 97, 168, 98, - 99, 100, 102, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 0, 0, 163, 68, 143, 178, 169, 170, 183, - 184, 185, 171, 186, 201, 203, 172, 188, 173, 174, - 175, 189, 190, 191, 194, 204, 195, 196, 197, 200, - 205, 206, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 176, 177, 0, 179, 180 + 58, 59, 60, 61, 62, 63, 64, 72, 73, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 168, 96, 97, + 169, 98, 99, 100, 102, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 182, 0, 163, 68, 143, 178, 170, + 171, 183, 184, 185, 172, 186, 202, 204, 173, 188, + 174, 175, 176, 189, 190, 191, 194, 205, 197, 198, + 201, 206, 207, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 177, 179, 0, 180 }; /* YYCHECK. */ @@ -1084,26 +1270,26 @@ 69, 3, 3, 5, 5, 3, 5, 4, 0, 6, 7, 6, 3, 10, 11, 6, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 6, 7, - 52, 3, 6, 7, 12, 7, 9, 4, 6, 7, - 47, 48, 3, 10, 6, 7, 52, 14, 15, 51, + 6, 3, 8, 3, 12, 7, 9, 4, 6, 7, + 6, 7, 52, 10, 47, 48, 52, 14, 15, 51, 51, 50, 51, 51, 49, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 6, 7, 6, 7, 6, 7, 107, 108, 52, 52, - 8, 8, 52, 52, 52, 52, 52, 52, 52, 168, + 6, 7, 6, 7, 6, 7, 6, 7, 107, 108, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 168, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 6, 6, 161, 7, 6, 52, 7, - 7, 6, 3, 3, 3, 3, 3, 3, 3, 3, + 8, 8, 8, 8, 8, 6, 6, 52, 7, 6, + 52, 7, 7, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, -1, -1, 3, 6, 6, 3, 52, 52, 3, - 3, 3, 52, 3, 3, 3, 52, 8, 52, 52, - 52, 8, 8, 8, 7, 3, 8, 8, 8, 8, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 52, 52, -1, 52, 52 + 3, 3, 3, 161, -1, 3, 6, 6, 3, 52, + 52, 3, 3, 3, 52, 3, 3, 3, 52, 8, + 52, 52, 52, 8, 8, 8, 7, 3, 8, 8, + 8, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 52, 52, -1, 52 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -1130,9 +1316,10 @@ 54, 55, 64, 3, 6, 7, 6, 7, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 3, 52, 52, 12, 54, 3, 3, 3, 3, 57, 8, 8, - 8, 8, 6, 7, 7, 8, 8, 8, 6, 7, - 8, 3, 3, 3, 3, 3, 3, 3, 6, 3, - 7, 3, 3, 3, 3, 3, 3, 3, 3, 3 + 8, 8, 6, 7, 7, 6, 8, 8, 8, 6, + 7, 8, 3, 3, 3, 3, 3, 3, 3, 6, + 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3 }; #if YYDEBUG @@ -1161,7 +1348,7 @@ 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 65, 66 + 64, 64, 64, 65, 66 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1174,8 +1361,8 @@ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 0, 2, 2, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, - 5, 2, 3, 1 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, + 4, 5, 2, 3, 1 }; #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE @@ -1241,13 +1428,14 @@ 64, -1, 21, 3, -1, 11, 52, 8, 3, -1, 14, 52, 8, 3, -1, 15, 52, 8, 3, -1, 17, 52, 7, 3, -1, 18, 52, 8, 3, -1, - 23, 52, 8, 3, -1, 19, 52, 8, 3, -1, - 20, 52, 8, 3, -1, 13, 52, 8, 3, -1, - 22, 52, 7, 3, -1, 22, 52, 6, 3, -1, - 10, 52, 57, 3, -1, 16, 52, 7, 3, -1, - 16, 52, 7, 7, 3, -1, 16, 52, 6, 3, - -1, 16, 52, 6, 6, 3, -1, 4, 3, -1, - 61, 59, 0, -1, 65, -1 + 18, 52, 6, 3, -1, 23, 52, 8, 3, -1, + 19, 52, 8, 3, -1, 20, 52, 8, 3, -1, + 13, 52, 8, 3, -1, 22, 52, 7, 3, -1, + 22, 52, 6, 3, -1, 10, 52, 57, 3, -1, + 16, 52, 7, 3, -1, 16, 52, 7, 7, 3, + -1, 16, 52, 6, 3, -1, 16, 52, 6, 6, + 3, -1, 4, 3, -1, 61, 59, 0, -1, 65, + -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -1261,22 +1449,22 @@ 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 218, 219, 222, 225, 230, 235, 240, 245, - 250, 255, 260, 265, 270, 275, 280, 285, 290, 296, - 301, 307, 310, 314 + 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, + 301, 306, 312, 315, 319 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned char Parser::yyrline_[] = { - 0, 140, 140, 141, 142, 143, 145, 146, 148, 149, - 151, 152, 153, 154, 156, 157, 159, 160, 166, 172, - 173, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 0, 130, 130, 131, 132, 133, 135, 136, 138, 139, + 141, 142, 143, 144, 146, 147, 149, 150, 156, 162, + 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 207, 208, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 230, 236 + 194, 195, 197, 198, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 221, 227 }; // Print the state stack on the debug stream. @@ -1298,7 +1486,7 @@ int yynrhs = yyr2_[yyrule]; /* Print the symbols being reduced, and their result. */ *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "), "; + << " (line " << yylno << "):" << std::endl; /* The symbols being reduced. */ for (int yyi = 0; yyi < yynrhs; yyi++) YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", @@ -1355,7 +1543,7 @@ } const int Parser::yyeof_ = 0; - const int Parser::yylast_ = 227; + const int Parser::yylast_ = 228; const int Parser::yynnts_ = 14; const int Parser::yyempty_ = -2; const int Parser::yyfinal_ = 35; @@ -1366,9 +1554,18 @@ const unsigned int Parser::yyuser_token_number_max_ = 301; const Parser::token_number_type Parser::yyundef_token_ = 2; -} // namespace mgf -#line 238 "Parser.ypp" +/* Line 1054 of lalr1.cc */ +#line 1 "[Bison:b4_percent_define_default]" + +} // mgf + +/* Line 1054 of lalr1.cc */ +#line 1565 "Parser.cpp" + + +/* Line 1056 of lalr1.cc */ +#line 229 "Parser.ypp" /*** Additional Code ***/ void mgf::Parser::error(const Parser::location_type& l, const std::string& m) Modified: trunk/mgfp/src/Parser.h =================================================================== --- trunk/mgfp/src/Parser.h 2010-09-08 03:51:39 UTC (rev 35) +++ trunk/mgfp/src/Parser.h 2010-09-09 21:29:45 UTC (rev 36) @@ -1,23 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.4.1. */ + /* Skeleton interface for Bison LALR(1) parsers in C++ - - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software + Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -28,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -37,20 +37,11 @@ #ifndef PARSER_HEADER_H # define PARSER_HEADER_H -#include <string> -#include <iostream> -#include "stack.h" +/* "%code requires" blocks. */ -namespace mgf -{ - class position; - class location; -} - -/* First part of user declarations. */ -#line 6 "Parser.ypp" - - +/* Line 35 of lalr1.cc */ +#line 3 "Parser.ypp" + #include <mgfp/Driver.h> #include "Nodes.h" @@ -63,9 +54,33 @@ -/* Line 303 of lalr1.cc. */ -#line 68 "Parser.h" +/* Line 35 of lalr1.cc */ +#line 59 "Parser.h" + +#include <string> +#include <iostream> +#include "stack.h" + + +/* Line 35 of lalr1.cc */ +#line 1 "[Bison:b4_percent_define_default]" + +namespace mgf { + +/* Line 35 of lalr1.cc */ +#line 73 "Parser.h" + class position; + class location; + +/* Line 35 of lalr1.cc */ +#line 1 "[Bison:b4_percent_define_default]" + +} // mgf + +/* Line 35 of lalr1.cc */ +#line 83 "Parser.h" + #include "location.h" /* Enabling traces. */ @@ -105,9 +120,15 @@ } while (false) #endif -namespace mgf -{ +/* Line 35 of lalr1.cc */ +#line 1 "[Bison:b4_percent_define_default]" + +namespace mgf { + +/* Line 35 of lalr1.cc */ +#line 131 "Parser.h" + /// A Bison parser. class Parser { @@ -115,8 +136,11 @@ /// Symbol semantic values. #ifndef YYSTYPE union semantic_type -#line 62 "Parser.ypp" -{ + { + +/* Line 35 of lalr1.cc */ +#line 52 "Parser.ypp" + int integerVal; double doubleVal; std::string* stringVal; @@ -124,10 +148,12 @@ DoublePairListNode* doublepairlistnode; IntegerNode* integernode; IntegerListNode* integerlistnode; -} -/* Line 303 of lalr1.cc. */ -#line 130 "Parser.h" - ; + + + +/* Line 35 of lalr1.cc */ +#line 156 "Parser.h" + }; #else typedef YYSTYPE semantic_type; #endif @@ -197,6 +223,7 @@ /// \returns 0 iff parsing succeeded. virtual int parse (); +#if YYDEBUG /// The current debugging stream. std::ostream& debug_stream () const; /// Set the current debugging stream. @@ -208,6 +235,7 @@ debug_level_type debug_level () const; /// Set the current debugging level. void set_debug_level (debug_level_type l); +#endif private: /// Report a syntax error. @@ -217,7 +245,7 @@ /// Generate an error message. /// \param state the state where the error occurred. - /// \param tok the look-ahead token. + /// \param tok the lookahead token. virtual std::string yysyntax_error_ (int yystate, int tok); #if YYDEBUG @@ -235,7 +263,7 @@ virtual void yy_symbol_print_ (int yytype, const semantic_type* yyvaluep, const location_type* yylocationp); -#endif /* ! YYDEBUG */ +#endif /// State numbers. @@ -312,6 +340,10 @@ virtual void yy_reduce_print_ (int r); /// Print the state stack on the debug stream. virtual void yystack_print_ (); + + /* Debugging. */ + int yydebug_; + std::ostream* yycdebug_; #endif /// Convert a scanner token number \a t to a symbol number. @@ -343,15 +375,18 @@ static const unsigned int yyuser_token_number_max_; static const token_number_type yyundef_token_; - /* Debugging. */ - int yydebug_; - std::ostream* yycdebug_; - - /* User arguments. */ Driver& driver; }; -} +/* Line 35 of lalr1.cc */ +#line 1 "[Bison:b4_percent_define_default]" +} // mgf + +/* Line 35 of lalr1.cc */ +#line 389 "Parser.h" + + + #endif /* ! defined PARSER_HEADER_H */ Modified: trunk/mgfp/src/Parser.ypp =================================================================== --- trunk/mgfp/src/Parser.ypp 2010-09-08 03:51:39 UTC (rev 35) +++ trunk/mgfp/src/Parser.ypp 2010-09-09 21:29:45 UTC (rev 36) @@ -1,10 +1,6 @@ /* $Id$ */ -/* - * C/C++ Declarations - */ -%{ - +%code requires { #include <mgfp/Driver.h> #include "Nodes.h" @@ -14,26 +10,20 @@ using namespace mgf; using namespace mgf::detail; +} -%} - -/* - * yacc/bison Declarations - */ - /* Require bison 2.3 or later */ %require "2.3" -/* add debug output code to generated parser. disable this for release - * versions. */ -%debug - /* start symbol is named "start" */ %start start -/* write out a header file containing the token defines */ +/* write a header file containing macro definitions */ %defines +/* add debug output code to generated parser. */ +%debug + /* use newer C++ skeleton file */ %skeleton "lalr1.cc" @@ -213,6 +203,7 @@ | IT_MODS '=' STRING EOL { driver.context.currentSpectrum.setIT_MODS(*$3); delete $3; } | RTINSECONDS '=' DOUBLE EOL { driver.context.currentSpectrum.setRTINSECONDS($3); } | SCANS '=' STRING EOL { driver.context.currentSpectrum.setSCANS(*$3); delete $3; } + | SCANS '=' INTEGER EOL { driver.context.currentSpectrum.setSCANS($3); } | TOLU '=' STRING EOL { driver.context.currentSpectrum.setTOLU(*$3); delete $3; } | SEQ '=' STRING EOL { driver.context.currentSpectrum.setSEQ(*$3); delete $3; }/* FIXME: multiple */ | TAG '=' STRING EOL { driver.context.currentSpectrum.setTAG(*$3); delete $3; }/* FIXME: multiple */ Modified: trunk/mgfp/src/Scanner.cpp =================================================================== --- trunk/mgfp/src/Scanner.cpp 2010-09-08 03:51:39 UTC (rev 35) +++ trunk/mgfp/src/Scanner.cpp 2010-09-09 21:29:45 UTC (rev 36) @@ -58,7 +58,6 @@ typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -89,12 +88,15 @@ #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ #include <iostream> #include <errno.h> #include <cstdlib> +#include <cstdio> #include <cstring> /* end standard C++ headers. */ @@ -152,7 +154,15 @@ /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -164,13 +174,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif +extern int yyleng; -extern yy_size_t yyleng; - #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -193,6 +198,11 @@ #define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -211,7 +221,7 @@ /* Number of characters read into yy_ch_buf, not including EOB * characters. ... [truncated message content] |
From: <mki...@us...> - 2010-09-08 03:51:46
|
Revision: 35 http://mgfp.svn.sourceforge.net/mgfp/?rev=35&view=rev Author: mkirchner Date: 2010-09-08 03:51:39 +0000 (Wed, 08 Sep 2010) Log Message: ----------- adding a very simple TMT extraction application Added Paths: ----------- trunk/mgfp/applications/tmtx/ trunk/mgfp/applications/tmtx/CMakeLists.txt trunk/mgfp/applications/tmtx/tmtx.cpp Added: trunk/mgfp/applications/tmtx/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/tmtx/CMakeLists.txt (rev 0) +++ trunk/mgfp/applications/tmtx/CMakeLists.txt 2010-09-08 03:51:39 UTC (rev 35) @@ -0,0 +1,23 @@ +# make sure we find the headers +INCLUDE_DIRECTORIES( + ${MGFP_SOURCE_DIR}/include + ${MGFP_BINARY_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR} +) +# this requres BOOST +IF(MSVC) + SET(Boost_USE_STATIC_LIBS ON) + SET(Boost_USE_MULTITHREAD OFF) +ENDIF(MSVC) +FIND_PACKAGE(Boost COMPONENTS program_options) +IF(Boost_PROGRAM_OPTIONS_FOUND) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + SET(SRCS_TMTX tmtx.cpp) + ADD_EXECUTABLE(tmtx ${SRCS_TMTX}) + TARGET_LINK_LIBRARIES(tmtx mgfp ${Boost_PROGRAM_OPTIONS_LIBRARY}) + INSTALL(TARGETS tmtx RUNTIME DESTINATION bin) +ELSE(Boost_PROGRAM_OPTIONS_FOUND) + MESSAGE(STATUS "Could not find BOOST program_options. Skipping ${CMAKE_CURRENT_SOURCE_DIR}.") +ENDIF(Boost_PROGRAM_OPTIONS_FOUND) + Added: trunk/mgfp/applications/tmtx/tmtx.cpp =================================================================== --- trunk/mgfp/applications/tmtx/tmtx.cpp (rev 0) +++ trunk/mgfp/applications/tmtx/tmtx.cpp 2010-09-08 03:51:39 UTC (rev 35) @@ -0,0 +1,125 @@ +/*$Id$*/ +/* + * tmtx.cpp + * + * Copyright (c) 2010 Marc Kirchner <mar...@ch...> + * + * This file is part of mgfp. + * + * mgfp is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ms++ is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ms++. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <cmath> +#include <iostream> +#include <iterator> +#include <tr1/array> +#include <boost/program_options.hpp> +#include <mgfp/mgfp.h> + +mgf::MgfSpectrum::iterator findClosestMz(mgf::MgfSpectrum::iterator begin, + mgf::MgfSpectrum::iterator end, double referenceMz) +{ + // at least one entry? + if (begin == end) + return end; + // find first entry that is equal or greater than the reference mz + typedef mgf::MgfSpectrum::iterator MSI; + MSI pos1 = std::lower_bound(begin, end, referenceMz, mgf::LessThanMz()); + double dist1 = 0.0; + if (pos1 != end) { + // found equal or greater + dist1 = pos1->first - referenceMz; + if (pos1 == begin || dist1 == 0.0) { + return pos1; + } + } else { + // return the last entry in the sequence + pos1 = begin; + std::advance(pos1, std::distance(begin, end) - 1); + return pos1; + } + // check if the distance to the previous iterator position + if (pos1 != begin) { + MSI pos2 = begin; + std::advance(pos2, std::distance(begin, pos1) - 1); + double dist2 = referenceMz - pos2->first; + if (dist2 < dist1) { + return pos2; + } + return pos1; + } +} + +static const double tmtMasses[10] = + { 124.0, 125.0, 126.0, 127.0, 128.0, + 129.0, 130.0, 131.0, 132.0, 133.0 }; + +int main(int argc, char *argv[]) +{ + namespace po = boost::program_options; + po::options_description desc("Allowed options"); + bool verbose = false; + desc.add_options() + ("help,h", "produce help message") + ("verbose,v", po::value(&verbose)->zero_tokens(), + "verbose output (good to pinpoint parsing errors)") + ; + po::variables_map vm; + po::store(po::parse_command_line(argc, argv, desc), vm); + po::notify(vm); + // check if the user asked for help + if (vm.count("help")) { + std::cerr << desc; + return 1; + } + // prepare the parser + mgf::MgfFile m; + mgf::Driver driver(m); + driver.trace_parsing = verbose; + driver.trace_scanning = verbose; + // parse input + bool result = driver.parse_stream(std::cin); + if (!result) { + std::cerr << std::endl + << "Error parsing data stream (use -v for details)." << std::endl; + return -1; + } + typedef mgf::MgfFile::iterator MFI; + // iterate over all spectra + for (MFI i = m.begin(); i != m.end(); ++i) { + // sort + std::sort(i->begin(), i->end(), mgf::LessThanMz()); + typedef mgf::MgfSpectrum::iterator MSI; + // extract TMT reproter ion intensities + double obsTmtAbundances[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + for (size_t n = 0; n < 6; ++n) { + MSI closestIt = findClosestMz(i->begin(), i->end(), tmtMasses[n]); + // check if there is a MS2 centroid + if (std::abs(closestIt->first - tmtMasses[n]) < 0.4) { + obsTmtAbundances[n] = closestIt->second; + } else { + obsTmtAbundances[n] = 0.0; + } + } + // extract into file + std::cout << i->getTITLE(); + for (size_t n = 0; n < 6; ++n) { + std::cout << '\t' << obsTmtAbundances[n]; + } + std::cout << std::endl; + } + return 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-09-08 03:36:59
|
Revision: 34 http://mgfp.svn.sourceforge.net/mgfp/?rev=34&view=rev Author: mkirchner Date: 2010-09-08 03:36:53 +0000 (Wed, 08 Sep 2010) Log Message: ----------- renaming tools Added Paths: ----------- trunk/mgfp/applications/tmtadducts/ trunk/mgfp/applications/tmtadducts/tmtadducts.cpp Removed Paths: ------------- trunk/mgfp/applications/tmtadducts/tmtx.cpp trunk/mgfp/applications/tmtx/ Copied: trunk/mgfp/applications/tmtadducts/tmtadducts.cpp (from rev 31, trunk/mgfp/applications/tmtx/tmtx.cpp) =================================================================== --- trunk/mgfp/applications/tmtadducts/tmtadducts.cpp (rev 0) +++ trunk/mgfp/applications/tmtadducts/tmtadducts.cpp 2010-09-08 03:36:53 UTC (rev 34) @@ -0,0 +1,166 @@ +/*$Id$*/ +/* + * tmtx.cpp + * + * Copyright (c) 2010 Marc Kirchner <mar...@ch...> + * + * This file is part of mgfp. + * + * mgfp is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ms++ is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ms++. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <cmath> +#include <iostream> +#include <iterator> +#include <tr1/array> +#include <boost/program_options.hpp> +#include <mgfp/mgfp.h> + +mgf::MgfSpectrum::iterator findClosestMz(mgf::MgfSpectrum::iterator begin, + mgf::MgfSpectrum::iterator end, double referenceMz) +{ + // at least one entry? + if (begin == end) + return end; + // find first entry that is equal or greater than the reference mz + typedef mgf::MgfSpectrum::iterator MSI; + MSI pos1 = std::lower_bound(begin, end, referenceMz, mgf::LessThanMz()); + double dist1 = 0.0; + if (pos1 != end) { + // found equal or greater + dist1 = pos1->first - referenceMz; + if (pos1 == begin || dist1 == 0.0) { + return pos1; + } + } else { + // return the last entry in the sequence + pos1 = begin; + std::advance(pos1, std::distance(begin, end) - 1); + return pos1; + } + // check if the distance to the previous iterator position + if (pos1 != begin) { + MSI pos2 = begin; + std::advance(pos2, std::distance(begin, pos1) - 1); + double dist2 = referenceMz - pos2->first; + if (dist2 < dist1) { + return pos2; + } + return pos1; + } +} + +static const double adductMasses[6] = + { 155.0, 156.0, 157.0, 158.0, 159.0, 160.0 }; +static const double tmtMasses[6] = + { 126.0, 127.0, 128.0, 129.0, 130.0, 131.0 }; + +int main(int argc, char *argv[]) +{ + namespace po = boost::program_options; + po::options_description desc("Allowed options"); + bool replace = false; + bool verbose = false; + desc.add_options() + ("help,h", "produce help message") + ("verbose,v", po::value(&verbose)->zero_tokens(), + "verbose output (good to pinpoint parsing errors)") + ("replace,r", po::value(&replace)->zero_tokens(), + "replace TMT intensities in original MGF, output new MGF to stdout.") + ; + po::variables_map vm; + po::store(po::parse_command_line(argc, argv, desc), vm); + po::notify(vm); + // check if the user asked for help + if (vm.count("help")) { + std::cerr << desc; + return 1; + } + // prepare the parser + mgf::MgfFile m; + mgf::Driver driver(m); + driver.trace_parsing = verbose; + driver.trace_scanning = verbose; + // parse input + bool result = driver.parse_stream(std::cin); + if (!result) { + std::cerr << std::endl + << "Error parsing data stream (use -v for details)." << std::endl; + return -1; + } + typedef mgf::MgfFile::iterator MFI; + // iterate over all spectra + for (MFI i = m.begin(); i != m.end(); ++i) { + // sort + std::sort(i->begin(), i->end(), mgf::LessThanMz()); + // extract adduct intensities + double obsAdductAbundances[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + typedef mgf::MgfSpectrum::iterator MSI; + for (size_t n = 0; n < 6; ++n) { + MSI closestIt = findClosestMz(i->begin(), i->end(), adductMasses[n]); + // check if there is a MS2 centroid + if (std::abs(closestIt->first - adductMasses[n]) < 0.5) { + obsAdductAbundances[n] = closestIt->second; + if (replace) { + // if the replace option is on, remove the observed value + // from the spectrum + i->erase(closestIt); + } + } else { + obsAdductAbundances[n] = 0.0; + } + } + // extract TMT reproter ion intensities + double obsTmtAbundances[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + for (size_t n = 0; n < 6; ++n) { + MSI closestIt = findClosestMz(i->begin(), i->end(), tmtMasses[n]); + // check if there is a MS2 centroid + if (std::abs(closestIt->first - tmtMasses[n]) < 0.5) { + obsTmtAbundances[n] = closestIt->second; + if (replace) { + // if the replace option is on, remove the observed value + // from the spectrum + i->erase(closestIt); + } + } else { + obsTmtAbundances[n] = 0.0; + } + } + // add on TMTs + if (replace) { + // re-insert + for (size_t n = 0; n < 6; ++n) { + i->push_back(std::make_pair(tmtMasses[n], obsTmtAbundances[n] + + obsAdductAbundances[n])); + } + } else { + // extract into file + std::cout << i->getTITLE(); + for (size_t n = 0; n < 6; ++n) { + std::cout << '\t' << obsTmtAbundances[n]; + } + for (size_t n = 0; n < 6; ++n) { + std::cout << '\t' << obsAdductAbundances[n]; + } + std::cout << std::endl; + } + } + // if replacement is in effect, output the whole modified file at once. + if (replace) { + std::cout << m; + } + return 0; +} + Deleted: trunk/mgfp/applications/tmtadducts/tmtx.cpp =================================================================== --- trunk/mgfp/applications/tmtx/tmtx.cpp 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/applications/tmtadducts/tmtx.cpp 2010-09-08 03:36:53 UTC (rev 34) @@ -1,166 +0,0 @@ -/*$Id$*/ -/* - * tmtx.cpp - * - * Copyright (c) 2010 Marc Kirchner <mar...@ch...> - * - * This file is part of mgfp. - * - * mgfp is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * ms++ is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with ms++. If not, see <http://www.gnu.org/licenses/>. - * - */ - -#include <cmath> -#include <iostream> -#include <iterator> -#include <tr1/array> -#include <boost/program_options.hpp> -#include <mgfp/mgfp.h> - -mgf::MgfSpectrum::iterator findClosestMz(mgf::MgfSpectrum::iterator begin, - mgf::MgfSpectrum::iterator end, double referenceMz) -{ - // at least one entry? - if (begin == end) - return end; - // find first entry that is equal or greater than the reference mz - typedef mgf::MgfSpectrum::iterator MSI; - MSI pos1 = std::lower_bound(begin, end, referenceMz, mgf::LessThanMz()); - double dist1 = 0.0; - if (pos1 != end) { - // found equal or greater - dist1 = pos1->first - referenceMz; - if (pos1 == begin || dist1 == 0.0) { - return pos1; - } - } else { - // return the last entry in the sequence - pos1 = begin; - std::advance(pos1, std::distance(begin, end) - 1); - return pos1; - } - // check if the distance to the previous iterator position - if (pos1 != begin) { - MSI pos2 = begin; - std::advance(pos2, std::distance(begin, pos1) - 1); - double dist2 = referenceMz - pos2->first; - if (dist2 < dist1) { - return pos2; - } - return pos1; - } -} - -static const double adductMasses[6] = - { 155.0, 156.0, 157.0, 158.0, 159.0, 160.0 }; -static const double tmtMasses[6] = - { 126.0, 127.0, 128.0, 129.0, 130.0, 131.0 }; - -int main(int argc, char *argv[]) -{ - namespace po = boost::program_options; - po::options_description desc("Allowed options"); - bool replace = false; - bool verbose = false; - desc.add_options() - ("help,h", "produce help message") - ("verbose,v", po::value(&verbose)->zero_tokens(), - "verbose output (good to pinpoint parsing errors)") - ("replace,r", po::value(&replace)->zero_tokens(), - "replace TMT intensities in original MGF, output new MGF to stdout.") - ; - po::variables_map vm; - po::store(po::parse_command_line(argc, argv, desc), vm); - po::notify(vm); - // check if the user asked for help - if (vm.count("help")) { - std::cerr << desc; - return 1; - } - // prepare the parser - mgf::MgfFile m; - mgf::Driver driver(m); - driver.trace_parsing = verbose; - driver.trace_scanning = verbose; - // parse input - bool result = driver.parse_stream(std::cin); - if (!result) { - std::cerr << std::endl - << "Error parsing data stream (use -v for details)." << std::endl; - return -1; - } - typedef mgf::MgfFile::iterator MFI; - // iterate over all spectra - for (MFI i = m.begin(); i != m.end(); ++i) { - // sort - std::sort(i->begin(), i->end(), mgf::LessThanMz()); - // extract adduct intensities - double obsAdductAbundances[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; - typedef mgf::MgfSpectrum::iterator MSI; - for (size_t n = 0; n < 6; ++n) { - MSI closestIt = findClosestMz(i->begin(), i->end(), adductMasses[n]); - // check if there is a MS2 centroid - if (std::abs(closestIt->first - adductMasses[n]) < 0.5) { - obsAdductAbundances[n] = closestIt->second; - if (replace) { - // if the replace option is on, remove the observed value - // from the spectrum - i->erase(closestIt); - } - } else { - obsAdductAbundances[n] = 0.0; - } - } - // extract TMT reproter ion intensities - double obsTmtAbundances[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; - for (size_t n = 0; n < 6; ++n) { - MSI closestIt = findClosestMz(i->begin(), i->end(), tmtMasses[n]); - // check if there is a MS2 centroid - if (std::abs(closestIt->first - tmtMasses[n]) < 0.5) { - obsTmtAbundances[n] = closestIt->second; - if (replace) { - // if the replace option is on, remove the observed value - // from the spectrum - i->erase(closestIt); - } - } else { - obsTmtAbundances[n] = 0.0; - } - } - // add on TMTs - if (replace) { - // re-insert - for (size_t n = 0; n < 6; ++n) { - i->push_back(std::make_pair(tmtMasses[n], obsTmtAbundances[n] + - obsAdductAbundances[n])); - } - } else { - // extract into file - std::cout << i->getTITLE(); - for (size_t n = 0; n < 6; ++n) { - std::cout << '\t' << obsTmtAbundances[n]; - } - for (size_t n = 0; n < 6; ++n) { - std::cout << '\t' << obsAdductAbundances[n]; - } - std::cout << std::endl; - } - } - // if replacement is in effect, output the whole modified file at once. - if (replace) { - std::cout << m; - } - return 0; -} - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-08-12 22:18:25
|
Revision: 33 http://mgfp.svn.sourceforge.net/mgfp/?rev=33&view=rev Author: mkirchner Date: 2010-08-12 22:18:18 +0000 (Thu, 12 Aug 2010) Log Message: ----------- * initial import of the ms2preproc code into the mgfp package. * ms2preproc itself is still a bit of a hack but at least it now resides where it belongs. Modified Paths: -------------- trunk/mgfp/applications/CMakeLists.txt trunk/mgfp/applications/mgfvalidate/CMakeLists.txt Added Paths: ----------- trunk/mgfp/applications/ms2preproc/ trunk/mgfp/applications/ms2preproc/CMakeLists.txt trunk/mgfp/applications/ms2preproc/ms2preproc.cpp Modified: trunk/mgfp/applications/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/CMakeLists.txt 2010-08-05 22:12:58 UTC (rev 32) +++ trunk/mgfp/applications/CMakeLists.txt 2010-08-12 22:18:18 UTC (rev 33) @@ -1,3 +1,4 @@ ADD_SUBDIRECTORY(mgfvalidate) +ADD_SUBDIRECTORY(ms2preproc) ADD_SUBDIRECTORY(tmtx) Modified: trunk/mgfp/applications/mgfvalidate/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/mgfvalidate/CMakeLists.txt 2010-08-05 22:12:58 UTC (rev 32) +++ trunk/mgfp/applications/mgfvalidate/CMakeLists.txt 2010-08-12 22:18:18 UTC (rev 33) @@ -1,10 +1,14 @@ +############################################################################# # make sure we find the headers +############################################################################# INCLUDE_DIRECTORIES( ${MGFP_SOURCE_DIR}/include ${MGFP_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR} ) +############################################################################# # this requres BOOST +############################################################################# IF(MSVC) SET(Boost_USE_STATIC_LIBS ON) SET(Boost_USE_MULTITHREAD OFF) Added: trunk/mgfp/applications/ms2preproc/CMakeLists.txt =================================================================== --- trunk/mgfp/applications/ms2preproc/CMakeLists.txt (rev 0) +++ trunk/mgfp/applications/ms2preproc/CMakeLists.txt 2010-08-12 22:18:18 UTC (rev 33) @@ -0,0 +1,27 @@ +############################################################################# +# make sure we find the headers +############################################################################# +INCLUDE_DIRECTORIES( + ${MGFP_SOURCE_DIR}/include + ${MGFP_BINARY_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR} +) +############################################################################# +# require boost +############################################################################# +IF(MSVC) + SET(Boost_USE_STATIC_LIBS ON) + SET(Boost_USE_MULTITHREAD OFF) +ENDIF(MSVC) +FIND_PACKAGE(Boost COMPONENTS program_options) +IF(Boost_PROGRAM_OPTIONS_FOUND) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + SET(SRCS_MS2PREPROC ms2preproc.cpp) + ADD_EXECUTABLE(ms2preproc ${SRCS_MS2PREPROC}) + TARGET_LINK_LIBRARIES(ms2preproc mgfp ${Boost_PROGRAM_OPTIONS_LIBRARY}) + INSTALL(TARGETS ms2preproc RUNTIME DESTINATION bin) +ELSE(Boost_PROGRAM_OPTIONS_FOUND) + MESSAGE(STATUS "Could not find BOOST program_options. Skipping ${CMAKE_CURRENT_SOURCE_DIR}.") +ENDIF(Boost_PROGRAM_OPTIONS_FOUND) + Added: trunk/mgfp/applications/ms2preproc/ms2preproc.cpp =================================================================== --- trunk/mgfp/applications/ms2preproc/ms2preproc.cpp (rev 0) +++ trunk/mgfp/applications/ms2preproc/ms2preproc.cpp 2010-08-12 22:18:18 UTC (rev 33) @@ -0,0 +1,479 @@ +/*$Id: ms2preproc.cpp 2725 2009-11-30 22:27:57Z mar...@ch... $*/ + +/* + * ms2preproc.cpp + * + * Copyright (c) 2010 Marc Kirchner <mar...@ch...> + * Copyright (c) 2009 Marc Kirchner <mar...@ch...> + * + * This file is part of mgfp. + * + * ms++ is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ms++ is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with ms++. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <iostream> +#include <iterator> +#include <iomanip> +#include <fstream> +#include <sstream> +#include <exception> +#include <stdexcept> +#include <algorithm> + +#include <boost/program_options.hpp> + +#include <mgfp/Driver.h> +#include <mgfp/Context.h> +#include <mgfp/MgfFile.h> + +// #define DEBUG + +struct LessThanMass +{ + bool operator()(const mgf::MassAbundancePair& lhs, const mgf::MassAbundancePair& rhs) { + return lhs.first < rhs.first; + } + bool operator()(const double lhs, const mgf::MassAbundancePair& rhs) { + return lhs < rhs.first; + } + bool operator()(const mgf::MassAbundancePair& lhs, const double rhs) { + return lhs.first < rhs; + } +}; + +struct LessThanAbundance +{ + bool operator()(const mgf::MassAbundancePair& lhs, const mgf::MassAbundancePair& rhs) { + return lhs.second < rhs.second; + } + bool operator()(const double lhs, const mgf::MassAbundancePair& rhs) { + return lhs < rhs.second; + } + bool operator()(const mgf::MassAbundancePair& lhs, const double rhs) { + return lhs.second < rhs; + } +}; + +namespace Ms2Preproc { + + +/** Functor to determine the top X peaks in a given set of peaks. + */ +class TopX +{ + public: + TopX(unsigned int x) : x_(x) + {} + + template<class In, class Out, class Comp> + Out operator()(In begin, In end, Out out, Comp comp) { + typename In::difference_type size = std::distance(begin, end); +#ifdef DEBUG +if (size > 0) { + std::cerr << "range " << begin->first << " - " << (end-1)->first << std::endl; +} +#endif + + // FIXME: Make the static_cast in the next step safe. + if (static_cast<unsigned int>(size) > x_) { + // sort a copy + std::vector<typename In::value_type> v(begin, end); + std::sort(v.begin(), v.end(), comp); + std::copy(v.rbegin(), v.rbegin()+x_, out); +#ifdef DEBUG +if (size > 0) { + for (typename std::vector<typename In::value_type>::iterator i = v.end()-x_; i != v.end() ; ++i) { + std::cerr << '\t' << i->first << " " << i->second << std::endl; + } +} +#endif + std::advance(out, x_); + } else { +#ifdef DEBUG +if (size > 0) { + for (In i = begin; i != end ; ++i) { + std::cerr << '\t' << i->first << " " << i->second << std::endl; + } +} +#endif + // accept all peaks + std::copy(begin, end, out); + std::advance(out, size); + } + return out; + } + protected: + unsigned int x_; +}; + +/** Functor to determine the top X peaks in Y regions for a given set of peaks. + */ +class TopXInYRegions +{ + public: + TopXInYRegions(unsigned int x, unsigned int y) : x_(x), y_(y) + {} + + template<class In, class Out, class MassComp, class AbundanceComp> + Out operator()(In begin, In end, Out out, MassComp massComp, AbundanceComp abundanceComp) { + // sort a copy + std::vector<typename In::value_type> v(begin, end); + std::sort(v.begin(), v.end(), massComp); + // split the m/z domain in y_ equisized regions + double maxMz = (v.end()-1)->first; + double minMz = (v.begin())->first; + double increment = (maxMz - minMz) / static_cast<double>(y_); + TopX topX(x_); + if (increment > 2.5) { + for (unsigned int k = 0; k < y_; ++k) { +#ifdef DEBUG +std::cerr << '#' << minMz + k*increment - 2.5 << " - " << minMz + (k+1)*increment + 2.5 << std::endl; +#endif + // iterate over all regions and apply TopX + double regionBegin = minMz + k*increment - 2.5; + regionBegin = regionBegin > minMz ? regionBegin : minMz; + double regionEnd = minMz + (k+1)*increment + 2.5; + In regionBeginIt = lower_bound(v.begin(), v.end(), regionBegin, massComp); + In regionEndIt = upper_bound(v.begin(), v.end(), regionEnd, massComp); + // run TopX on region + Out nout = topX(regionBeginIt, regionEndIt, out, abundanceComp); +#ifdef DEBUG +std::cerr << "step " << k << " of " << y_ << ": topX returned " << nout-out << " peaks." << std::endl; +#endif + out = nout; + + } + } else { + Out nout = topX(v.begin(), v.end(), out, abundanceComp); +#ifdef DEBUG +std::cerr << "increment too small: topX returned " << nout-out << " peaks." << std::endl; +#endif + out = nout; + } + return out; + } + private: + unsigned int x_, y_; +}; + +/** Functor to determine the top X peaks in windows of size Z. + */ +class TopXInWindowsOfSizeZ +{ + public: + TopXInWindowsOfSizeZ(unsigned int x, double z) : x_(x), z_(z) + { +#ifdef DEBUG +std::cerr << "got: " << z_ << std::endl; +#endif + } + + template <class In, class Out, class MassComp, class AbundanceComp> + Out operator()(In begin, In end, Out out, MassComp massComp, AbundanceComp abundanceComp) { + // get a copy + std::vector<typename In::value_type> v(begin, end); + TopX topX(x_); + + while (!v.empty()) { + // sort by abundance + std::sort(v.begin(), v.end(), abundanceComp); + double maxAbundanceMass = v[v.size()-1].first; + // sort by mass + std::sort(v.begin(), v.end(), massComp); + // define window +#ifdef DEBUG +std::cerr << '#' << maxAbundanceMass - z_ << '-' << maxAbundanceMass + z_ << std::endl; +#endif + In regionBegin = lower_bound(v.begin(), v.end(), maxAbundanceMass - z_, massComp); + In regionEnd = upper_bound(regionBegin, v.end(), maxAbundanceMass + z_, massComp); + // get TopX + out = topX(regionBegin, regionEnd, out, abundanceComp); + // erase entries in window + v.erase(regionBegin, regionEnd); + } + return out; + } + + private: + unsigned int x_; + double z_; +}; + +} + +namespace dta { + +/** A DTA spectrum. Quick hack for the ms2preproc executable until we have a better concept for annotated spectra. + */ +class DtaSpectrum : public mgf::Collection<mgf::MassAbundancePair> { + public: + void setPrecursorMass(const double m) { precursorMass_ = m; } + double getPrecursorMass() const { return precursorMass_; } + void setCharge(const int c) { charge_ = c; } + int getCharge() const { return charge_; } + void setScans(const std::pair<unsigned int, unsigned int>& scans) { scans_ = scans; } + std::pair<unsigned int, unsigned int> getScans() const { return scans_; } + void clear() { + precursorMass_ = 0.0; + charge_ = 0; + scans_ = std::make_pair(0,0); + mgf::Collection<mgf::MassAbundancePair>::clear(); + } + private: + MGFP_EXPORT friend std::ostream& operator<<(std::ostream& os, DtaSpectrum& s); + double precursorMass_; + int charge_; + std::pair<unsigned int, unsigned int> scans_; +}; + +/** A DTA parser that fills a DTA spectrum. Should also be integrated with ms++. Implementation trivial. + */ +class DtaParser { + public: + void parse(const std::string& filename, DtaSpectrum& s) { + // TODO: add some filename parsing here to obtain the + // scan numbers (DTA is *such* a horrible format). + + // open file and parse contents + std::ifstream ifs(filename.c_str()); + if (ifs) { + s.clear(); + // first line is precursor mass and charge + double precursorMass; + int charge; + ifs >> precursorMass >> charge; + s.setPrecursorMass(precursorMass); + s.setCharge(charge); + // afterwards there are mass/abundance pairs + double m, ab; + ifs >> m >> ab; + while(!ifs.eof()) { + s.push_back(std::make_pair(m, ab)); + ifs >> m >> ab; + } + } else { + throw std::invalid_argument("file not found."); + } + } +}; + +std::ostream& operator<<(std::ostream& os, DtaSpectrum& s) { + os << s.precursorMass_ << " " << s.charge_ << std::endl; + for (DtaSpectrum::const_iterator i = s.begin(); i != s.end(); ++i) { + os << i-> first << " " << i->second << std::endl; + } + return os; +} + +} + +namespace po = boost::program_options; + +int main(int argc, char* argv[]) { + try { + + // Declare the supported options. + // FIXME: add version info. + po::options_description desc("MS/MS preprocessor executable, Copyright 2009-10 Marc Kirchner.\n" + "Please cite as:\n" + " Renard BY, Kirchner M, Monigatti F, Invanov AR, Rappsilber J,\n" + " Winter D, Steen JAJ, Hamprecht FA, Steen H, When Less Can Yield\n" + " More - Computational Preprocessing of MS/MS Spectra for\n" + " Peptide Identification, Proteomics (2009).\n\nValid arguments are" + ); + unsigned int precision(0); + std::string format; + desc.add_options() + ("help,h", "produce this help message") + ("infile,i", po::value<std::string>(), "name of the MGF/DTA input file") + ("outfile,o", po::value<std::string>(), "name of the MGF output file") + ("format,f", po::value<std::string>(&format)->default_value(std::string("mgf")), "input format: (dta|mgf)") + ("top,X", po::value<int>(), "number of highest intensity ions to keep") + ("nregions,Y", po::value<int>(), "number of equal-sized regions the MS/MS spectrum is split into") + ("winsize,Z", po::value<double>(), "m/z window (+/-Z) around high-intensity peaks in which the top X are selected") + ("verbose,v", "toggle verbose output") + ("precision,p", po::value<unsigned int>(&precision)->default_value(4), "precision of output") + ; + + po::variables_map vm; + po::store(po::parse_command_line(argc, argv, desc), vm); + po::notify(vm); + + if (vm.count("help")) { + std::cerr << desc << std::endl; + return 1; + } + + // input sanity checking + if (!(vm.count("infile") && vm.count("outfile"))) { + std::cerr << desc << std::endl << "ERROR: " + "Need 'infile' and 'outfile' arguments." << std::endl; + return 1; + } + if (!(vm.count("top"))) { + std::cerr << desc << std::endl << "ERROR: " + "Need 'top,X' argument." << std::endl; + return 1; + } + if (vm.count("nregions") > 0 && vm.count("winsize") > 0) { + std::cerr << desc << std::endl << "ERROR: " + "Parameters 'nregions' and 'winsize' cannot be specified together." << std::endl; + return 1; + } + if (!(format == "mgf" || format == "dta")) { + std::cerr << desc << std::endl << "ERROR: " + "Format must be one of 'mgf' or 'dta'." << std::endl; + return 1; + } + // logging/debug output + bool trace = vm.count("verbose") > 0 ? true : false; + // I/O + std::string infilename(vm["infile"].as<std::string>()); + std::string outfilename(vm["outfile"].as<std::string>()); + std::ofstream out(outfilename.c_str()); + if (!out.good()) { + return -1; + } + // check format + // common variables + int x = vm["top"].as<int>(); + // check which format we are dealing with: in the case of MGF + // we need to invoke the parser, read a whole collection of + // spectra and apply the operators to each spectrum. In the + // case of DTA, we deal with a single spectrum only. + // + // This is some ugly code duplication between the two cases; oh, well... + // + if (format == "mgf") { + // set up context + mgf::MgfFile s; + mgf::Driver driver(s); + driver.trace_parsing = trace; + driver.trace_scanning = trace; + + // I/O: input + std::ifstream in(infilename.c_str()); + if (!in.good()) { + return -1; + } + + // parse input into memory + bool result = driver.parse_stream(in); + if (!result) { + return -1; + } + + // set info + out << "# MGF created using ms2preproc, (c) 2009 Marc Kirchner.\n" + << "# This program accompanies Renard BY, Kirchner M, Monigatti F, Invanov AR,\n" + << "# Rappsilber J, Winter D, Steen JAJ, Hamprecht FA, Steen H, When Less\n" + << "# Can Yield More - Computational Preprocessing of MS/MS Spectra for\n" + << "# Peptide Identification, Proteomics (2009).\n" + << "# Command: " << argv[0]; + for (int i = 1; i < argc; ++i) { + out << " " << argv[i]; + } + out << "." << std::endl; + + // get a handle to the data + typedef mgf::MgfFile::iterator Iterator; + + if (vm.count("nregions")) { + // Top X in Y regions + int y = vm["nregions"].as<int>(); + Ms2Preproc::TopXInYRegions topXInYRegions(static_cast<unsigned int>(x), static_cast<unsigned int>(y)); + for (Iterator i = s.begin(); i != s.end(); ++i) { + // get a temporary object and make sure it is big enough + mgf::MgfSpectrum m; + m.resize(2*i->size()); + // get the top X in Y regions, including duplicated from overlaps + mgf::MgfSpectrum::iterator sEnd = topXInYRegions(i->begin(), i->end(), m.begin(), LessThanMass(), LessThanAbundance()); + // make sure we have enough space in the original object + i->resize(std::distance(m.begin(), sEnd)); + // unique copy expectes a sorted range + std::sort(m.begin(), sEnd, LessThanMass()); + // copy all unique peaks back into the original MgfSpectrum + mgf::MgfSpectrum::iterator iEnd = std::unique_copy(m.begin(), sEnd, i->begin()); + // crop to fit + i->resize(std::distance(i->begin(), iEnd)); + } + } else if (vm.count("winsize")) { + // Top X in windows of size Z + double z = vm["winsize"].as<int>(); + Ms2Preproc::TopXInWindowsOfSizeZ topXInWindowsOfSizeZ(static_cast<unsigned int>(x), z); + for (Iterator i = s.begin(); i != s.end(); ++i) { + mgf::MgfSpectrum::iterator trash = topXInWindowsOfSizeZ(i->begin(), i->end(), i->begin(), LessThanMass(), LessThanAbundance()); + i->erase(trash, i->end()); + std::sort(i->begin(), i->end(), LessThanMass()); // not necessary + } + } else { + // Top X + Ms2Preproc::TopX topX(static_cast<unsigned int>(x)); + for (Iterator i = s.begin(); i != s.end(); ++i) { + mgf::MgfSpectrum::iterator trash = topX(i->begin(), i->end(), i->begin(), LessThanAbundance()); + i->erase(trash, i->end()); + std::sort(i->begin(), i->end(), LessThanMass()); + } + } + out.setf(std::ios_base::fixed, std::ios_base::floatfield); + out.precision(precision); + out << s << std::endl; + } else if (format == "dta") { + dta::DtaParser parser; + dta::DtaSpectrum s; + // read DTA spectrum + parser.parse(infilename, s); + if (vm.count("nregions")) { + // Top X in Y regions + int y = vm["nregions"].as<int>(); + Ms2Preproc::TopXInYRegions topXInYRegions(static_cast<unsigned int>(x), static_cast<unsigned int>(y)); + // get a temporary object and make sure it is big enough + mgf::MgfSpectrum tmp; + tmp.resize(2*s.size()); + // get the top X in Y regions, including duplicated from overlaps + mgf::MgfSpectrum::iterator tmpEnd = topXInYRegions(s.begin(), s.end(), tmp.begin(), LessThanMass(), LessThanAbundance()); + // make sure we have enough space in the original object + s.resize(std::distance(tmp.begin(), tmpEnd)); + // unique copy expectes a sorted range + std::sort(tmp.begin(), tmpEnd, LessThanMass()); + // copy all unique peaks back into the original MgfSpectrum + mgf::MgfSpectrum::iterator sEnd = std::unique_copy(tmp.begin(), tmpEnd, s.begin()); + // crop to fit + s.resize(std::distance(s.begin(), sEnd)); + } else if (vm.count("winsize")) { + // Top X in windows of size Z + double z = vm["winsize"].as<int>(); + Ms2Preproc::TopXInWindowsOfSizeZ topXInWindowsOfSizeZ(static_cast<unsigned int>(x), z); + mgf::MgfSpectrum::iterator trash = topXInWindowsOfSizeZ(s.begin(), s.end(), s.begin(), LessThanMass(), LessThanAbundance()); + s.erase(trash, s.end()); + std::sort(s.begin(), s.end(), LessThanMass()); // not necessary + } else { + // Top X + Ms2Preproc::TopX topX(static_cast<unsigned int>(x)); + mgf::MgfSpectrum::iterator trash = topX(s.begin(), s.end(), s.begin(), LessThanAbundance()); + s.erase(trash, s.end()); + std::sort(s.begin(), s.end(), LessThanMass()); + } + out.setf(std::ios_base::fixed, std::ios_base::floatfield); + out.precision(precision); + out << s << std::endl; + } + return 0; + } catch (std::exception& e) { + std::cerr << e.what() << std::endl; + } + return (-1); +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-08-05 22:13:04
|
Revision: 32 http://mgfp.svn.sourceforge.net/mgfp/?rev=32&view=rev Author: mkirchner Date: 2010-08-05 22:12:58 +0000 (Thu, 05 Aug 2010) Log Message: ----------- * changed include guard names to less collision-prone names * we now define Collection<T> inside the mgf namespace Modified Paths: -------------- trunk/mgfp/include/mgfp/Collection.h trunk/mgfp/include/mgfp/Context.h trunk/mgfp/include/mgfp/Driver.h trunk/mgfp/include/mgfp/MassAbundancePair.h trunk/mgfp/include/mgfp/MgfFile.h trunk/mgfp/include/mgfp/MgfHeader.h trunk/mgfp/include/mgfp/MgfSpectrum.h trunk/mgfp/include/mgfp/config.h.cmake trunk/mgfp/include/mgfp/mgfp.h trunk/mgfp/include/mgfp/utils.h trunk/mgfp/test/Collection-test.cpp Modified: trunk/mgfp/include/mgfp/Collection.h =================================================================== --- trunk/mgfp/include/mgfp/Collection.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/Collection.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,15 +1,18 @@ /*$Id$*/ -#ifndef __COLLECTION_H__ -#define __COLLECTION_H__ +#ifndef __MGFP_INCLUDE_COLLECTION_H__ +#define __MGFP_INCLUDE_COLLECTION_H__ #include <vector> #include <mgfp/config.h> + #ifdef REGRESSION_TEST_BUILD - struct CollectionTestSuite; +struct CollectionTestSuite; #endif +namespace mgf { + /** A std::vector<T> composite. * The STL std::vector<T> does not have a virtual destructor, hence it is not * possible for vector-like classes to derive in order to inherit the @@ -187,4 +190,6 @@ lhs.c_.swap(rhs.c_); } +} // namespace mgf + #endif Modified: trunk/mgfp/include/mgfp/Context.h =================================================================== --- trunk/mgfp/include/mgfp/Context.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/Context.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,6 +1,6 @@ // $Id$ -#ifndef __CONTEXT_H__ -#define __CONTEXT_H__ +#ifndef __MGFP_INCLUDE_CONTEXT_H__ +#define __MGFP_INCLUDE_CONTEXT_H__ #include <mgfp/MgfFile.h> #include <mgfp/MgfHeader.h> @@ -23,4 +23,4 @@ } -#endif // __CONTEXT_H__ +#endif // __MGFP_INCLUDE_CONTEXT_H__ Modified: trunk/mgfp/include/mgfp/Driver.h =================================================================== --- trunk/mgfp/include/mgfp/Driver.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/Driver.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,7 +1,7 @@ /* $Id$ */ -#ifndef __DRIVER_H__ -#define __DRIVER_H__ +#ifndef __MGFP_INCLUDE_DRIVER_H__ +#define __MGFP_INCLUDE_DRIVER_H__ #include <string> #include <vector> @@ -81,4 +81,4 @@ } // namespace mgf -#endif // __DRIVER_H__ +#endif // __MGFP_INCLUDE_DRIVER_H__ Modified: trunk/mgfp/include/mgfp/MassAbundancePair.h =================================================================== --- trunk/mgfp/include/mgfp/MassAbundancePair.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/MassAbundancePair.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,5 +1,5 @@ -#ifndef __MASSABUNDANCEPAIR_H__ -#define __MASSABUNDANCEPAIR_H__ +#ifndef __MGFP_INCLUDE_MASSABUNDANCEPAIR_H__ +#define __MGFP_INCLUDE_MASSABUNDANCEPAIR_H__ #include <mgfp/config.h> Modified: trunk/mgfp/include/mgfp/MgfFile.h =================================================================== --- trunk/mgfp/include/mgfp/MgfFile.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/MgfFile.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,7 +1,7 @@ /* $Id$ */ -#ifndef __MGFFILE_H__ -#define __MGFFILE_H__ +#ifndef __MGFP_INCLUDE_MGFFILE_H__ +#define __MGFP_INCLUDE_MGFFILE_H__ #include <mgfp/config.h> Modified: trunk/mgfp/include/mgfp/MgfHeader.h =================================================================== --- trunk/mgfp/include/mgfp/MgfHeader.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/MgfHeader.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,5 +1,5 @@ -#ifndef __MGFHEADER_H__ -#define __MGFHEADER_H__ +#ifndef __MGFP_INCLUDE_MGFHEADER_H__ +#define __MGFP_INCLUDE_MGFHEADER_H__ #include <mgfp/config.h> Modified: trunk/mgfp/include/mgfp/MgfSpectrum.h =================================================================== --- trunk/mgfp/include/mgfp/MgfSpectrum.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/MgfSpectrum.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,5 +1,5 @@ -#ifndef __MGFSPECTRUM_H__ -#define __MGFSPECTRUM_H__ +#ifndef __MGFP_INCLUDE_MGFSPECTRUM_H__ +#define __MGFP_INCLUDE_MGFSPECTRUM_H__ #include <mgfp/config.h> Modified: trunk/mgfp/include/mgfp/config.h.cmake =================================================================== --- trunk/mgfp/include/mgfp/config.h.cmake 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/config.h.cmake 2010-08-05 22:12:58 UTC (rev 32) @@ -1,5 +1,5 @@ -#ifndef __CONFIG_H__ -#define __CONFIG_H__ +#ifndef __MGFP_INCLUDE_CONFIG_H__ +#define __MGFP_INCLUDE_CONFIG_H__ //#ifdef _MSC_VER // #include "winsock2.h" @@ -26,5 +26,5 @@ #define MGFP_EXPORT #endif -#endif // __CONFIG_H__ +#endif // __MGFP_INCLUDE_CONFIG_H__ Modified: trunk/mgfp/include/mgfp/mgfp.h =================================================================== --- trunk/mgfp/include/mgfp/mgfp.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/mgfp.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,5 +1,5 @@ -#ifndef __MGFPARSER_H__ -#define __MGFPARSER_H__ +#ifndef __MGFP_INCLUDE_MGFP_H__ +#define __MGFP_INCLUDE_MGFP_H__ #include <mgfp/Context.h> #include <mgfp/Driver.h> Modified: trunk/mgfp/include/mgfp/utils.h =================================================================== --- trunk/mgfp/include/mgfp/utils.h 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/include/mgfp/utils.h 2010-08-05 22:12:58 UTC (rev 32) @@ -1,5 +1,5 @@ -#ifndef __UTILS_H__ -#define __UTILS_H__ +#ifndef __MGFP_INCLUDE_UTILS_H__ +#define __MGFP_INCLUDE_UTILS_H__ #include <mgfp/config.h> Modified: trunk/mgfp/test/Collection-test.cpp =================================================================== --- trunk/mgfp/test/Collection-test.cpp 2010-03-31 03:03:44 UTC (rev 31) +++ trunk/mgfp/test/Collection-test.cpp 2010-08-05 22:12:58 UTC (rev 32) @@ -29,6 +29,7 @@ #include "unittest.hxx" +using namespace mgf; struct CollectionTestSuite : vigra::test_suite { CollectionTestSuite() : vigra::test_suite("Collection") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-03-31 03:03:50
|
Revision: 31 http://mgfp.svn.sourceforge.net/mgfp/?rev=31&view=rev Author: mkirchner Date: 2010-03-31 03:03:44 +0000 (Wed, 31 Mar 2010) Log Message: ----------- adapted docs to publication and sf.net launch Modified Paths: -------------- trunk/mgfp/doc/Mainpage.h Modified: trunk/mgfp/doc/Mainpage.h =================================================================== --- trunk/mgfp/doc/Mainpage.h 2010-03-31 01:36:40 UTC (rev 30) +++ trunk/mgfp/doc/Mainpage.h 2010-03-31 03:03:44 UTC (rev 31) @@ -1,30 +1,36 @@ /*! -\image html mgfp_small.png - \mainpage mgfp: Mascot Generic Format (MGF) Parser -\author Marc Kirchner <fir...@ch...> - \section sec_intro Introduction \c mgfp is a flex/bison-based C++ MGF parser library.<br> -The library is provided -under the terms of a BSD license and can thus be used in academic and +The <a href="http://steenlab.org">Steen \& Steen Lab</a> provides +the library under the terms of a BSD license for use in academic and non-academic environments. +\section sec_citation Citation + +If you make use of \c mgfp in your own projects, please cite the +following article:<br> + +Kirchner M, Steen JAJ, Hamprecht FA, Steen H (2010). +MGFp: An open Mascot Generic Format parser library implementation. +<i>Journal of Proteome Research, in press.</i> +[<a href="http://www.ncbi.nlm.nih.gov/pubmed/20334363">PubMed</a>] + \section sec_install Installation -\subsection sec_install_bin Obtaining a Binary Package +\subsection sec_install_bin Obtaining the Software Binary packages for Microsoft Windows, Linux (64 bit, built on Ubuntu 10.4) and MacOS X (Snow Leopard) are available for download from -\li the Steen Lab software page at http://software.steenlab.org/mgfp . +\li the MGFp project page at sourceforge: http://mgfp.sf.net . -Additionally, we are in the process of migrating MGFp to sourceforge. -This will allow SVN access for anyone who wants to contribute. +Additional information is available on -\li (Future) MGFp project page at sourceforge: http://mgfp.sf.net . +\li the Steen Lab page at http://steenlab.org/ +\li the Steen Lab software page at http://software.steenlab.org/ \subsection sec_install_src Building from Source Building \c mgfp from source is straightforward. However, it requires a working This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-03-31 01:36:47
|
Revision: 30 http://mgfp.svn.sourceforge.net/mgfp/?rev=30&view=rev Author: mkirchner Date: 2010-03-31 01:36:40 +0000 (Wed, 31 Mar 2010) Log Message: ----------- -sync scripts to upload htdocs to sf.net -final touches on the webpage Modified Paths: -------------- trunk/mgfp/CMakeLists.txt trunk/mgfp/doc/Mainpage.h trunk/mgfp/htdocs/index.html trunk/mgfp/htdocs/style.css Modified: trunk/mgfp/CMakeLists.txt =================================================================== --- trunk/mgfp/CMakeLists.txt 2010-03-30 06:00:39 UTC (rev 29) +++ trunk/mgfp/CMakeLists.txt 2010-03-31 01:36:40 UTC (rev 30) @@ -60,7 +60,14 @@ @ONLY IMMEDIATE ) FIND_PACKAGE(Doxygen) + +# target for doxygen ADD_CUSTOM_TARGET(doc COMMAND ${DOXYGEN} ${MGFP_BINARY_DIR}/doc/Doxyfile) + +# convenience targets for synchronisation: htdocs and docs +ADD_CUSTOM_TARGET(synchtdocs COMMAND rsync -Cavz ${MGFP_SOURCE_DIR}/htdocs mkirchner,mg...@we...:/home/groups/m/mg/mgfp/) +ADD_CUSTOM_TARGET(syncdocs COMMAND rsync -Cavz ${MGFP_BINARY_DIR}/doc/html mkirchner,mg...@we...:/home/groups/m/mg/mgfp/htdocs/doc) + # FIXME: add target for pdf generation ############################################################################# Modified: trunk/mgfp/doc/Mainpage.h =================================================================== --- trunk/mgfp/doc/Mainpage.h 2010-03-30 06:00:39 UTC (rev 29) +++ trunk/mgfp/doc/Mainpage.h 2010-03-31 01:36:40 UTC (rev 30) @@ -4,7 +4,7 @@ \mainpage mgfp: Mascot Generic Format (MGF) Parser -\author Marc Kirchner <mar...@ch...> +\author Marc Kirchner <fir...@ch...> \section sec_intro Introduction \c mgfp is a flex/bison-based C++ MGF parser library.<br> Modified: trunk/mgfp/htdocs/index.html =================================================================== --- trunk/mgfp/htdocs/index.html 2010-03-30 06:00:39 UTC (rev 29) +++ trunk/mgfp/htdocs/index.html 2010-03-31 01:36:40 UTC (rev 30) @@ -16,8 +16,9 @@ <td class="links"> <a href="http://sourceforge.net/projects/mgfp/">mgfp project page</a><br> <a href="http://sourceforge.net/projects/mgfp/files/">download</a><br> -<a href="doc/">documentation</a><br> -<a href="http://sourceforge.net/apps/trac/mgfp/wiki">development (trac)</a> +<a href="doc/html/">documentation</a><br> +<a href="http://sourceforge.net/apps/trac/mgfp/wiki">development (trac)</a><br> +<a href="http://steenlab.org">steen & steen lab</a><br> </td> </tr> </table> Modified: trunk/mgfp/htdocs/style.css =================================================================== --- trunk/mgfp/htdocs/style.css 2010-03-30 06:00:39 UTC (rev 29) +++ trunk/mgfp/htdocs/style.css 2010-03-31 01:36:40 UTC (rev 30) @@ -1,33 +1,33 @@ body { - font-size: 10pt; font-family: sans-serif; - background-color: #7b8276; - color: #333333; + background-color: #ffffff; + color: #64747c; } table.canopy { - background-color: #7b8276; + background-color: #ffffff; width=50%; margin-top:15%; margin-left:auto; margin-right:auto; - border: 1px solid #aaaaaa; + /* border: 1px solid #eef0e3;*/ padding: 25px; + vertical-align: middle; } a { text-decoration:none; - color:#333333; + color:#64747c; } td.links { - color: #333333; - font-size: 1.6em; + color: #64747c; + font-size: 1.1em; font-weight: bold; } td.content { - background-color: #7b8276; + background-color: #ffffff; text-align: left; margin: 15px; border: 10px solid #ffffff; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mki...@us...> - 2010-03-30 06:00:45
|
Revision: 29 http://mgfp.svn.sourceforge.net/mgfp/?rev=29&view=rev Author: mkirchner Date: 2010-03-30 06:00:39 +0000 (Tue, 30 Mar 2010) Log Message: ----------- added simplistic homepage Added Paths: ----------- trunk/mgfp/htdocs/ trunk/mgfp/htdocs/index.html trunk/mgfp/htdocs/mgfp_small.png trunk/mgfp/htdocs/style.css Removed Paths: ------------- trunk/mgfp/doc/images/mgfp_small.png Deleted: trunk/mgfp/doc/images/mgfp_small.png =================================================================== (Binary files differ) Added: trunk/mgfp/htdocs/index.html =================================================================== --- trunk/mgfp/htdocs/index.html (rev 0) +++ trunk/mgfp/htdocs/index.html 2010-03-30 06:00:39 UTC (rev 29) @@ -0,0 +1,33 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > +<title>Mascot Generic Format (MGF) parser</title> +<link rel="stylesheet" type="text/css" href="style.css"> +<link rel="icon" type="image/png" href="favicon.ico"> +</head> +</head> +<body> +<table class="canopy"> +<tr> +<td class="logo"> +<img src="mgfp_small.png"> +</td> +<td class="links"> +<a href="http://sourceforge.net/projects/mgfp/">mgfp project page</a><br> +<a href="http://sourceforge.net/projects/mgfp/files/">download</a><br> +<a href="doc/">documentation</a><br> +<a href="http://sourceforge.net/apps/trac/mgfp/wiki">development (trac)</a> +</td> +</tr> +</table> +<table align="center"> +<tr> +<td colspan=2 align="center"> +<br><br> +<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=312035&type=2"> +</td> +</tr> +</table> +</body> +</html> Copied: trunk/mgfp/htdocs/mgfp_small.png (from rev 28, trunk/mgfp/doc/images/mgfp_small.png) =================================================================== (Binary files differ) Added: trunk/mgfp/htdocs/style.css =================================================================== --- trunk/mgfp/htdocs/style.css (rev 0) +++ trunk/mgfp/htdocs/style.css 2010-03-30 06:00:39 UTC (rev 29) @@ -0,0 +1,35 @@ +body { + font-size: 10pt; + font-family: sans-serif; + background-color: #7b8276; + color: #333333; +} + +table.canopy { + background-color: #7b8276; + width=50%; + margin-top:15%; + margin-left:auto; + margin-right:auto; + border: 1px solid #aaaaaa; + padding: 25px; +} + +a { + text-decoration:none; + color:#333333; +} + +td.links { + color: #333333; + font-size: 1.6em; + font-weight: bold; +} + +td.content { + background-color: #7b8276; + text-align: left; + margin: 15px; + border: 10px solid #ffffff; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |