From d46c95ed7285743bfc27e5b08560e7852173ad18 Mon Sep 17 00:00:00 2001 From: Andrew Dowsey Date: Fri, 12 Jun 2015 18:45:50 +0100 Subject: [PATCH] went back to opening existing smo file as needed to write multiple preset scan configs --- restoration/restoration.cpp | 2 +- seamass/SMOWriter.cpp | 21 +++++++++++++-------- seamass/core.cpp | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/restoration/restoration.cpp b/restoration/restoration.cpp index 40d35df..d078da9 100755 --- a/restoration/restoration.cpp +++ b/restoration/restoration.cpp @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) cout << ": Raw input file in seaMass Input format (smi)" << endl; cout << " guidelines: Use pwiz-seamass to convert from mzML or vendor format" << endl; cout << ": MS resolution given as: \"b-splines per Th = 2^mz_res * 60 / 1.0033548378\"" << endl; - cout << " guidelines: between 0 to 2 for ToF, 3 for Orbitrap" << endl; + cout << " guidelines: between 0 to 2 for ToF (e.g. 1 is suitable for 30,000 resolution), 3 for Orbitrap" << endl; cout << ": LC resolution given as: \"b-splines per minute = 2^rt_res\"" << endl; cout << " guidelines: around 4" << endl; cout << ": Amount of denoising given as: \"L1 shrinkage = 2^shrinkage\"" << endl; diff --git a/seamass/SMOWriter.cpp b/seamass/SMOWriter.cpp index 31ad0c0..6d09369 100755 --- a/seamass/SMOWriter.cpp +++ b/seamass/SMOWriter.cpp @@ -28,13 +28,17 @@ SMOWriter:: SMOWriter(const string& filename) { - file = H5Fcreate(filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (file < 0) - { - // throw exception - cerr << "problem opening smo" << endl; - throw "problem opening smo"; - } + file = H5Fcreate(filename.c_str(), H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); + if (file < 0) + { + file = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT); + if (file < 0) + { + // throw exception + cerr << "problem opening smo" << endl; + throw "problem opening smo"; + } + } } @@ -46,7 +50,8 @@ SMOWriter:: { // throw exception cerr << "problem closing smo" << endl; - } + throw "problem closing smo"; + } } diff --git a/seamass/core.cpp b/seamass/core.cpp index fa7a7c4..637d09c 100644 --- a/seamass/core.cpp +++ b/seamass/core.cpp @@ -92,6 +92,23 @@ print(ostream& out) const //////////////////////////////////////////////////////////////////////////////// +double CatmullRomInterpolate( + double y0, double y1, + double y2, double y3, + double mu) +{ + double a0, a1, a2, a3, mu2; + + mu2 = mu*mu; + a0 = -0.5*y0 + 1.5*y1 - 1.5*y2 + 0.5*y3; + a1 = y0 - 2.5*y1 + 2 * y2 - 0.5*y3; + a2 = -0.5*y0 + 0.5*y2; + a3 = y1; + + return a0*mu*mu2 + a1*mu2 + a2*mu + a3; +} + + void bin_mzs_intensities(vector< vector >& mzs, vector< vector >& intensities, ii instrument_type,