diff --git a/restoration/restoration.cpp b/restoration/restoration.cpp index 0f9098b..1d3cdbf 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 1 for ToF, 3 for Orbitrap" << endl; + cout << " guidelines: between 0 to 1 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 7964218..a54fdb0 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 b73ba7b..ea5eec0 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,