public static binStack[] genIndex(DataView _quiXMLv, string rawPath, int scansbyframe, BinStackOptions options) { int numMatches = _quiXMLv.Count; int numFrames = countFrames(_quiXMLv, scansbyframe); int numRawFiles; //LookupCollection RawFilesColl = countRawFiles(fileXml, out numRawFiles); LookupCollection RawFilesColl = countRawFiles(_quiXMLv, out numRawFiles); //create index binStack[] stackIndex = new binStack[numRawFiles]; //fill rawfilenames in the index ArrayList rawFilesKeys = (ArrayList)RawFilesColl.Keys; ArrayList rawFilesValues = (ArrayList)RawFilesColl.Values; for (int i = 0; i < numRawFiles; i++) { stackIndex[i] = new binStack((int)rawFilesValues[i]); stackIndex[i].rawFileName = rawFilesKeys[i].ToString(); } fillScans(stackIndex, _quiXMLv, options); //share out the spectra amongst the frames int currFrame = 1; int currScanofFrame = 1; for (int i = 0; i < numRawFiles; i++) { for (int j = 0; j <= stackIndex[i].scan.GetUpperBound(0); j++) { stackIndex[i].scan[j].frame = currFrame; currScanofFrame++; if (currScanofFrame > scansbyframe) { currFrame++; currScanofFrame = 1; } } } //WARNING: very dangerous change, but necessary to maintain old binstacks: in currFrame // we swap the values of scanNumber by spectrumIndex (once we have obtained the desired // spectrum, we use the unique index (spectrumIndex). return(stackIndex); }
public static binStack[] genIndex(string fileXml, string schemaFile, string rawPath, int scansbyframe, BinStackOptions options) { int numMatches = countMatches(fileXml); int numFrames = countFrames(fileXml, scansbyframe); int numRawFiles; LookupCollection RawFilesColl = countRawFiles(fileXml, out numRawFiles); //create index binStack[] stackIndex = new binStack[numRawFiles]; //fill rawfilenames in the index ArrayList rawFilesKeys = (ArrayList)RawFilesColl.Keys; ArrayList rawFilesValues = (ArrayList)RawFilesColl.Values; for (int i = 0; i < numRawFiles; i++) { stackIndex[i] = new binStack((int)rawFilesValues[i]); stackIndex[i].rawFileName = rawFilesKeys[i].ToString(); } fillScans(stackIndex, fileXml, schemaFile, options); //share out the spectra amongst the frames int currFrame = 1; int currScanofFrame = 1; for (int i = 0; i < numRawFiles; i++) { for (int j = 0; j <= stackIndex[i].scan.GetUpperBound(0); j++) { stackIndex[i].scan[j].frame = currFrame; currScanofFrame++; if (currScanofFrame > scansbyframe) { currFrame++; currScanofFrame = 1; } } } return(stackIndex); }