Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Dowsey committed Jun 19, 2015
2 parents 4fa8458 + d46c95e commit 423b979
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion restoration/restoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main(int argc, char *argv[])
cout << "<in_file>: Raw input file in seaMass Input format (smi)" << endl;
cout << " guidelines: Use pwiz-seamass to convert from mzML or vendor format" << endl;
cout << "<mz_res>: 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 << "<rt_res>: LC resolution given as: \"b-splines per minute = 2^rt_res\"" << endl;
cout << " guidelines: around 4" << endl;
cout << "<shrink>: Amount of denoising given as: \"L1 shrinkage = 2^shrinkage\"" << endl;
Expand Down
21 changes: 13 additions & 8 deletions seamass/SMOWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}


Expand All @@ -46,7 +50,8 @@ SMOWriter::
{
// throw exception
cerr << "problem closing smo" << endl;
}
throw "problem closing smo";
}
}


Expand Down
17 changes: 17 additions & 0 deletions seamass/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> >& mzs,
vector< vector<double> >& intensities,
ii instrument_type,
Expand Down

0 comments on commit 423b979

Please sign in to comment.