本文整理汇总了C++中Spectrum::getMsLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ Spectrum::getMsLevel方法的具体用法?C++ Spectrum::getMsLevel怎么用?C++ Spectrum::getMsLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spectrum
的用法示例。
在下文中一共展示了Spectrum::getMsLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NewScanAverage
bool CNoiseReduction::NewScanAverage(Spectrum& sp, char* file, int width, float cutoff, int scanNum){
Spectrum ts;
vector<int> vPos;
int i;
int j;
int k;
int m;
int widthCount=0;
int numScans=1;
double dif;
double prec;
double dt;
double c;
bool bLeft=true;
int posLeft;
int posRight;
int index;
char cFilter1[256];
//char cFilter2[256];
//double slope;
//double intercept;
sp.clear();
Spectrum* specs;
specs = new Spectrum[width*2+1];
//if file is not null, create new buffer
if(file!=NULL){
strcpy(lastFile,file);
bs.clear();
if(scanNum>0) r->readFile(file,ts,scanNum);
else r->readFile(file,ts);
if(ts.getScanNumber()==0) {
delete [] specs;
return false;
}
bs.push_back(ts);
specs[0]=bs[0];
c=CParam(specs[0],3);
posA=0;
} else {
posA++;
if(posA>=(int)bs.size()) { //end of buffer, no more data
delete [] specs;
return false;
}
specs[0]=bs[posA];
c=CParam(specs[0],3);
}
specs[0].getRawFilter(cFilter1,256);
posLeft=posA;
posRight=posA;
while(widthCount<(width*2)){
index=-1;
//Alternate looking left and right
if(bLeft){
bLeft=false;
widthCount++;
while(true){
posLeft--;
if(posLeft<0) { //buffer is too short on left, add spectra
i=bs[0].getScanNumber();
while(true){
i--;
if(i==0) break;
r->readFile(lastFile,ts,i);
if(ts.getScanNumber()==0) continue;
else break;
}
if(i==0) break;
bs.push_front(ts);
posA++;
posRight++;
posLeft=0;
//ts.getRawFilter(cFilter2,256);
if(ts.getMsLevel()==cs.msLevel) {
index=posLeft;
break;
}
} else {
//bs[posLeft].getRawFilter(cFilter2,256);
if(bs[posLeft].getMsLevel()==cs.msLevel) {
index=posLeft;
break;
}
}
}
} else {
bLeft=true;
//.........这里部分代码省略.........
示例2: ScanAveragePlusDeNoise
bool CNoiseReduction::ScanAveragePlusDeNoise(Spectrum& sp, char* file, int width, float cutoff, int scanNum){
Spectrum ts;
Spectrum ps;
//MSReader r;
vector<int> v;
vector<int> vPos;
int i;
int j;
int k;
int widthCount=0;
int numScans=1;
int match;
double dif;
double prec;
double dt;
double c;
bool bLeft=true;
int posLeft=ps.getScanNumber()-1;
int posRight=ps.getScanNumber()+1;
int index;
char cFilter1[256];
//char cFilter2[256];
sp.clear();
//if file is not null, create new buffer
if(file!=NULL){
strcpy(lastFile,file);
bs.clear();
if(scanNum>0) r->readFile(file,ts,scanNum);
else r->readFile(file,ts);
if(ts.getScanNumber()==0) return false;
bs.push_back(ts);
ps=bs[0];
c=CParam(ps,3);
posA=0;
} else {
posA++;
//cout << "ER: " << posA << " " << bs.size() << endl;
if(posA>=(int)bs.size()) return false; //end of buffer, no more data
ps=bs[posA];
c=CParam(ps,3);
}
//set our pivot spectrum
//ps=bs[posA];
ps.getRawFilter(cFilter1,256);
//cout << "Averaging: " << ps.getScanNumber() << endl;
posLeft=posA;
posRight=posA;
while(widthCount<(width*2)){
index=-1;
//Alternate looking left and right
if(bLeft){
bLeft=false;
widthCount++;
while(true){
posLeft--;
//cout << posLeft << endl;
if(posLeft<0) { //buffer is too short on left, add spectra
i=bs[0].getScanNumber();
while(true){
i--;
//cout << "I: " << i << endl;
if(i==0) break;
r->readFile(lastFile,ts,i);
if(ts.getScanNumber()==0) continue;
else break;
}
if(i==0) break;
bs.push_front(ts);
for(i=0;i<(int)v.size();i++)v[i]++;
posA++;
posRight++;
posLeft=0;
//ts.getRawFilter(cFilter2,256);
if(ts.getMsLevel()==cs.msLevel) {
index=posLeft;
break;
}
} else {
//bs[posLeft].getRawFilter(cFilter2,256);
if(bs[posLeft].getMsLevel()==cs.msLevel) {
index=posLeft;
break;
}
}
}
} else {
bLeft=true;
widthCount++;
//.........这里部分代码省略.........