Commit 76d41ad5 authored by Filippo Rusconi's avatar Filippo Rusconi

New upstream version 72~svn

parent 2b92bdeb
#include <iostream>
#include <iomanip>
#include <cmath>
#include "MSToolkitTypes.h"
#include "MSReader.h"
#include "MSObject.h"
#include "Spectrum.h"
using namespace std;
using namespace MSToolkit;
int main(int argc, char *argv[]){
//Here are all the variable we are going to need
MSReader r;
Spectrum s;
int j;
if(argc==1){
printf("DESCRIPTION: Reads an MS/MS spectrum from any MSToolkit supported file type and outputs to screen in MS2 format.\n\n");
printf("USAGE: MSSingleScan [scan number] [file]\n");
exit(0);
}
r.setFilter(MS1);
r.addFilter(MS2);
r.addFilter(MSX);
r.addFilter(SRM);
char nativeID[256];
r.readFile(argv[2],s,atoi(argv[1]));
if(s.getScanNumber()==0) exit(-1);
char szNativeID[128];
if (s.getNativeID(szNativeID, 128))
printf("success: scan %d nativeID: %s\n", s.getScanNumber(), szNativeID);
else
printf("failure: scan %d\n", s.getScanNumber());
s.getNativeID(nativeID, 256);
printf("%s\n",nativeID);
printf("S\t%d\t%d",s.getScanNumber(),s.getScanNumber());
for(j=0;j<s.sizeMZ();j++){
printf("\t%.*lf",4,s.getMZ(j));
}
printf("\n");
if(s.getRTime()>0) printf("I\tRTime\t%.*f\n",4,s.getRTime());
//printf("I\tConvA\t%.6lf\n",s.getConversionA());
//printf("I\tConvB\t%.6lf\n",s.getConversionB());
//printf("I\tConvC\t%.6lf\n",s.getConversionC());
//printf("I\tConvD\t%.6lf\n",s.getConversionD());
//printf("I\tConvE\t%.6lf\n",s.getConversionE());
//printf("I\tConvI\t%.6lf\n",s.getConversionI());
for(j=0;j<s.sizeZ();j++){
printf("Z\t%d\t%.*f\n",s.atZ(j).z,6,s.atZ(j).mz);
}
for(j=0;j<s.size();j++){
printf("%.4f %.4f\n",s.at(j).mz,s.at(j).intensity);
}
return 0;
}
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="MSSingleScan"
ProjectGUID="{24C852FB-C978-4957-BC4D-92F27FD031AE}"
RootNamespace="MSSingleScan"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="&quot;C:\Users\mhoopman\Documents\Software Development\MSToolkit-Google\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="MSToolkitLite.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;C:\Users\mhoopman\Documents\Software Development\MSToolkit-Google\Release&quot;"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\MSSingleScan.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSToolkit", "MSToolkit.vcproj", "{D2646DE9-A31A-4C6E-99C6-B81885C17A93}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSToolkitCLR", "MSToolkitCLR.vcproj", "{48702313-7D61-4679-BF85-FBF1A1C34C52}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSToolkitLite", "MSToolkitLite.vcproj", "{8093FAFA-4AA1-4E88-A83E-1B433A96AAE5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSToolkitLiteCLR", "MSToolkitLiteCLR.vcproj", "{0B0E7480-5938-4388-B57D-66A262E601C8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSSingleScan", "MSSingleScan\MSSingleScan.vcproj", "{24C852FB-C978-4957-BC4D-92F27FD031AE}"
ProjectSection(ProjectDependencies) = postProject
{8093FAFA-4AA1-4E88-A83E-1B433A96AAE5} = {8093FAFA-4AA1-4E88-A83E-1B433A96AAE5}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D2646DE9-A31A-4C6E-99C6-B81885C17A93}.Debug|Win32.ActiveCfg = Debug|Win32
{D2646DE9-A31A-4C6E-99C6-B81885C17A93}.Debug|Win32.Build.0 = Debug|Win32
{D2646DE9-A31A-4C6E-99C6-B81885C17A93}.Release|Win32.ActiveCfg = Release|Win32
{D2646DE9-A31A-4C6E-99C6-B81885C17A93}.Release|Win32.Build.0 = Release|Win32
{48702313-7D61-4679-BF85-FBF1A1C34C52}.Debug|Win32.ActiveCfg = Debug|Win32
{48702313-7D61-4679-BF85-FBF1A1C34C52}.Debug|Win32.Build.0 = Debug|Win32
{48702313-7D61-4679-BF85-FBF1A1C34C52}.Release|Win32.ActiveCfg = Release|Win32
{48702313-7D61-4679-BF85-FBF1A1C34C52}.Release|Win32.Build.0 = Release|Win32
{8093FAFA-4AA1-4E88-A83E-1B433A96AAE5}.Debug|Win32.ActiveCfg = Debug|Win32
{8093FAFA-4AA1-4E88-A83E-1B433A96AAE5}.Debug|Win32.Build.0 = Debug|Win32
{8093FAFA-4AA1-4E88-A83E-1B433A96AAE5}.Release|Win32.ActiveCfg = Release|Win32
{8093FAFA-4AA1-4E88-A83E-1B433A96AAE5}.Release|Win32.Build.0 = Release|Win32
{0B0E7480-5938-4388-B57D-66A262E601C8}.Debug|Win32.ActiveCfg = Debug|Win32
{0B0E7480-5938-4388-B57D-66A262E601C8}.Debug|Win32.Build.0 = Debug|Win32
{0B0E7480-5938-4388-B57D-66A262E601C8}.Release|Win32.ActiveCfg = Release|Win32
{0B0E7480-5938-4388-B57D-66A262E601C8}.Release|Win32.Build.0 = Release|Win32
{24C852FB-C978-4957-BC4D-92F27FD031AE}.Debug|Win32.ActiveCfg = Debug|Win32
{24C852FB-C978-4957-BC4D-92F27FD031AE}.Debug|Win32.Build.0 = Debug|Win32
{24C852FB-C978-4957-BC4D-92F27FD031AE}.Release|Win32.ActiveCfg = Release|Win32
{24C852FB-C978-4957-BC4D-92F27FD031AE}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="MSToolkit"
ProjectGUID="{D2646DE9-A31A-4C6E-99C6-B81885C17A93}"
RootNamespace="MSToolkit"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="./include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="./include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;COMPILED_FROM_DSP;XML_STATIC;MST_MZ5"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
ObjectFile="$(IntDir)\MSToolkit\"
ProgramDataBaseFileName="$(IntDir)\MSToolkit\vc90.pdb"
XMLDocumentationFileName="$(IntDir)\MSToolkit\"
WarningLevel="3"
DebugInformationFormat="3"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<Filter
Name="MSToolkit"
>
<File
RelativePath=".\src\MSToolkit\MSObject.cpp"
>
</File>
<File
RelativePath=".\src\MSToolkit\MSReader.cpp"
>
</File>
<File
RelativePath=".\src\MSToolkit\RAWReader.cpp"
>
</File>
<File
RelativePath=".\src\MSToolkit\Spectrum.cpp"
>
</File>
</Filter>
<Filter
Name="zLib"
>
<File
RelativePath=".\src\zLib-1.2.5\adler32.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\compress.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\crc32.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\deflate.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\gzclose.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\gzlib.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\gzread.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\gzwrite.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\infback.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\inffast.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\inflate.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\inftrees.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\trees.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\uncompr.c"
>
</File>
<File
RelativePath=".\src\zLib-1.2.5\zutil.c"
>
</File>
</Filter>
<Filter
Name="expat"
>
<File
RelativePath=".\src\expat-2.0.1\xmlparse.c"
>
</File>
<File
RelativePath=".\src\expat-2.0.1\xmlrole.c"
>
</File>
<File
RelativePath=".\src\expat-2.0.1\xmltok.c"
>
</File>
</Filter>
<Filter
Name="mzParser"
>
<File
RelativePath=".\src\mzParser\BasicChromatogram.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\BasicSpectrum.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\Czran.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\mz5handler.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\mzp_base64.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\mzParser.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\mzpMz5Config.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\mzpMz5Structs.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\PWIZface.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\RAMPface.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\saxhandler.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\saxmzmlhandler.cpp"
>
</File>
<File
RelativePath=".\src\mzParser\saxmzxmlhandler.cpp"
>
</File>
</Filter>
<Filter
Name="sqlite"
>
<File
RelativePath=".\src\sqlite-3.7.7.1\sqlite3.c"
>
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="MSToolkitCLR"
ProjectGUID="{48702313-7D61-4679-BF85-FBF1A1C34C52}"
RootNamespace="MSToolkitCLR"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="./include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"