1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,402 +0,0 @@ |
1 |
-/*************************************************************************** |
|
2 |
-cramp.cpp |
|
3 |
- |
|
4 |
-*************************************************************************** |
|
5 |
-cramp.hpp -- renamed cramp.h to avoid R checker warning |
|
6 |
- |
|
7 |
- A C++ wrapper for the RAMP code. |
|
8 |
- |
|
9 |
- Use this library to parse an mzXML file in a non-sequential way, by |
|
10 |
- taking advantage of the index element. |
|
11 |
- |
|
12 |
- (C) 2004 by Brian Pratt, Insilicos LLC |
|
13 |
- |
|
14 |
- Based on mzXML2Other, which has this copyright: |
|
15 |
- ------------------- |
|
16 |
- begin : Wed Apr 2 |
|
17 |
- copyright : (C) 2002 by Pedrioli Patrick, ISB, Proteomics |
|
18 |
- email : ppatrick@student.ethz.ch |
|
19 |
- ***************************************************************************/ |
|
20 |
- |
|
21 |
-/*************************************************************************** |
|
22 |
-* * |
|
23 |
-* This program is free software; you can redistribute it and/or modify * |
|
24 |
-* it under the terms of the GNU Library or "Lesser" General Public * |
|
25 |
-* License (LGPL) as published by the Free Software Foundation; * |
|
26 |
-* either version 2 of the License, or (at your option) any later * |
|
27 |
-* version. * |
|
28 |
-* * |
|
29 |
-***************************************************************************/ |
|
30 |
- |
|
31 |
-#include<Rcpp.h> |
|
32 |
- |
|
33 |
-// Taken from http://tolstoy.newcastle.edu.au/R/e2/devel/06/11/1242.html |
|
34 |
-// and http://stackoverflow.com/questions/11588765/using-rcpp-with-windows-specific-includes |
|
35 |
-// Undefine the Realloc macro, which is defined by both R and by Windows stuff |
|
36 |
-// Also need to undefine the Free macro |
|
37 |
-#if defined(__MINGW32__) |
|
38 |
-#undef Realloc |
|
39 |
-#undef Free |
|
40 |
-#endif |
|
41 |
- |
|
42 |
-#include <stdlib.h> |
|
43 |
-#include <iostream> |
|
44 |
-#include <fstream> |
|
45 |
-#include "stdio.h" |
|
46 |
-#if !defined(_MSC_VER) && !defined(__MINGW32__) |
|
47 |
-#include "sys/errno.h" |
|
48 |
-#endif |
|
49 |
-#include "cramp.h" |
|
50 |
-#include<R.h> |
|
51 |
- |
|
52 |
-#if defined(__MINGW32__) |
|
53 |
-#include <windows.h> |
|
54 |
-#endif |
|
55 |
- |
|
56 |
-/** |
|
57 |
- * This function performs a non-sequential parsing operation on an indexed |
|
58 |
- * msxml file. |
|
59 |
- * |
|
60 |
- * @param fileName: Name of the msxml file |
|
61 |
- * @param startSCan: Number of the scan we want to read from |
|
62 |
- * @param what: -HEADER will return num, msLevel and retentionTime |
|
63 |
- * -SCAN will return only the peaks |
|
64 |
- * -ALL will return everything found in scan, precursorMz and peaks |
|
65 |
- * |
|
66 |
- * @return pData is dynamically allocate and becomes property of the caller, who |
|
67 |
- * is responsible for its deallocation!! |
|
68 |
- */ |
|
69 |
- |
|
70 |
- |
|
71 |
- |
|
72 |
-cRamp::cRamp( const char* fileName,bool declaredScansOnly ) : |
|
73 |
- m_filename(fileName), m_declaredScansOnly(declaredScansOnly), m_runInfo() |
|
74 |
-{ |
|
75 |
- m_handle = rampOpenFile(fileName); |
|
76 |
- m_scanOffsets = NULL; |
|
77 |
- m_runInfo = NULL; |
|
78 |
- m_lastScan = 0; |
|
79 |
- if (!OK()) |
|
80 |
- { |
|
81 |
- // HENRY -- I would prefer this to be silent, and let the caller deals with it |
|
82 |
- // cout << "Error: Could not open file " << fileName << ": " << strerror(errno) << endl; |
|
83 |
- // END HENRY |
|
84 |
- } |
|
85 |
- else |
|
86 |
- { |
|
87 |
- |
|
88 |
- m_runInfo = getRunInfo(); |
|
89 |
- |
|
90 |
- // HENRY -- always read index to set scan count, since scan count |
|
91 |
- // declared at the top of the mzXML file is unreliable now that |
|
92 |
- // there are missing scans. |
|
93 |
- // This will also set the structs m_scanOffsets, and the value m_lastScan |
|
94 |
- |
|
95 |
- // if (m_runInfo->m_data.scanCount < 0) { // undeclared scan count |
|
96 |
- // this will provoke reading of index, which sets scan count |
|
97 |
- rampScanInfo* tmp = getScanHeaderInfo ( 1 ); |
|
98 |
- delete(tmp); // was free - but see https://github.com/sneumann/mzR/issues/52 |
|
99 |
- // } |
|
100 |
- // END HENRY |
|
101 |
- } |
|
102 |
-} |
|
103 |
- |
|
104 |
-cRamp::~cRamp() |
|
105 |
-{ |
|
106 |
- rampCloseFile(m_handle); |
|
107 |
- |
|
108 |
- // NB: these pointers may be null on file open failure, |
|
109 |
- // but free/delete of NULL is OK per C++ standard |
|
110 |
- free(m_scanOffsets); |
|
111 |
- delete m_runInfo; // was free() - but allocated with new |
|
112 |
-} |
|
113 |
- |
|
114 |
-// |
|
115 |
-// here are the private guts |
|
116 |
-// |
|
117 |
-rampInfo* cRamp::do_ramp( ramp_fileoffset_t arg , eWhatToRead what ) |
|
118 |
-{ |
|
119 |
- |
|
120 |
- switch( what ) |
|
121 |
- { |
|
122 |
- case RAMP_RUNINFO: |
|
123 |
- case RAMP_HEADER: |
|
124 |
- case RAMP_PEAKS: |
|
125 |
- case RAMP_INSTRUMENT: |
|
126 |
- break; // OK |
|
127 |
- default: |
|
128 |
- Rf_error("unknown read type!\n"); |
|
129 |
- return NULL; |
|
130 |
- break; |
|
131 |
- } |
|
132 |
- |
|
133 |
- rampInfo* returnPtr=NULL; |
|
134 |
- |
|
135 |
- if ((RAMP_RUNINFO != what) && (RAMP_INSTRUMENT != what) && !m_scanOffsets) |
|
136 |
- { |
|
137 |
- int iLastScan = 0; |
|
138 |
- // we need the index to get anything besides the header |
|
139 |
- // std::cerr << "in: getIndexOffset(m_handle);!\n"; |
|
140 |
- ramp_fileoffset_t indexOffset = getIndexOffset(m_handle); |
|
141 |
- // std::cerr << "out: getIndexOffset(m_handle);!\n"; |
|
142 |
- |
|
143 |
- // std::cerr << "in: readIndex();!\n"; |
|
144 |
- m_scanOffsets = readIndex(m_handle, indexOffset, &iLastScan); |
|
145 |
- //std::cerr << "out: readIndex();!\n"; |
|
146 |
- if (iLastScan >= m_runInfo->m_data.scanCount) |
|
147 |
- { |
|
148 |
- if (!m_declaredScansOnly) |
|
149 |
- { |
|
150 |
- m_runInfo->m_data.scanCount = iLastScan; |
|
151 |
- } |
|
152 |
- else // get rid of all the fake entries created |
|
153 |
- { |
|
154 |
- |
|
155 |
- // std::cerr << "get rid of all the fake entries created\n"; |
|
156 |
- for (int n=1; n<=iLastScan; n++) // ramp is 1 based |
|
157 |
- { |
|
158 |
- if (m_scanOffsets[n]==-1) |
|
159 |
- { |
|
160 |
- // find a run of fakes |
|
161 |
- int m; |
|
162 |
- for (m=n+1; (m<=iLastScan)&&(m_scanOffsets[m]==-1); m++); |
|
163 |
- if (m<=iLastScan) |
|
164 |
- { |
|
165 |
- memmove(m_scanOffsets+n,m_scanOffsets+m, |
|
166 |
- sizeof(ramp_fileoffset_t)*((iLastScan-m)+1)); |
|
167 |
- } |
|
168 |
- iLastScan-=(m-n); |
|
169 |
- } |
|
170 |
- } |
|
171 |
- } |
|
172 |
- } |
|
173 |
- // HENRY - store last scan explicitly. |
|
174 |
- m_lastScan = iLastScan; |
|
175 |
- // END HENRY |
|
176 |
- } |
|
177 |
- |
|
178 |
- |
|
179 |
- // HENRY -- arg is out of bounds. instead of creating havoc in RAMP, let's just kill it here. |
|
180 |
- if (RAMP_RUNINFO != what && (RAMP_INSTRUMENT != what) && (arg > m_runInfo->m_data.scanCount || arg < 1)) |
|
181 |
- { |
|
182 |
- return (NULL); |
|
183 |
- } |
|
184 |
- |
|
185 |
- if (m_scanOffsets || (RAMP_RUNINFO == what) || (RAMP_INSTRUMENT == what)) |
|
186 |
- { |
|
187 |
- ramp_fileoffset_t scanOffset=-1; |
|
188 |
- if (RAMP_RUNINFO == what || RAMP_INSTRUMENT == what) |
|
189 |
- { |
|
190 |
- scanOffset = 0; // read from head of file |
|
191 |
- } |
|
192 |
- else |
|
193 |
- { |
|
194 |
- scanOffset = m_scanOffsets[arg]; // ramp is one-based |
|
195 |
- } |
|
196 |
- |
|
197 |
- if (scanOffset >= 0) |
|
198 |
- { |
|
199 |
- |
|
200 |
- // ----------------------------------------------------------------------- |
|
201 |
- // And now we can parse the info we were looking for |
|
202 |
- // ----------------------------------------------------------------------- |
|
203 |
- |
|
204 |
- |
|
205 |
- // Ok now we have to copy everything in our structure |
|
206 |
- switch( what ) |
|
207 |
- { |
|
208 |
- case RAMP_RUNINFO: |
|
209 |
- // std::cerr << "in: rampRunInfo( m_handle )\n"; |
|
210 |
- returnPtr = new rampRunInfo( m_handle ); |
|
211 |
- // std::cerr << "out: rampRunInfo( m_handle )\n"; |
|
212 |
- break; |
|
213 |
- case RAMP_HEADER: |
|
214 |
- // std::cerr << "in: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
215 |
- returnPtr = new rampScanInfo( m_handle, scanOffset, (int)arg ); |
|
216 |
- //std::cerr << "out: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
217 |
- if (returnPtr) |
|
218 |
- { |
|
219 |
-#ifdef HAVE_PWIZ_MZML_LIB |
|
220 |
- if (!m_handle->mzML) // rampadapter already set this for us |
|
221 |
-#endif |
|
222 |
- ((rampScanInfo *)returnPtr)->m_data.filePosition = scanOffset; // for future reference |
|
223 |
- |
|
224 |
- // HENRY -- error checking here |
|
225 |
- if (((rampScanInfo*)returnPtr)->m_data.acquisitionNum < 0) |
|
226 |
- { |
|
227 |
- // something failed in RAMP, possibly because it's a missing scan |
|
228 |
- delete ((rampScanInfo*)returnPtr); |
|
229 |
- returnPtr = NULL; |
|
230 |
- } |
|
231 |
- } |
|
232 |
- break; |
|
233 |
- case RAMP_PEAKS: |
|
234 |
- returnPtr = new rampPeakList( m_handle, scanOffset); |
|
235 |
- |
|
236 |
- // HENRY -- error checking here |
|
237 |
- if (returnPtr && ((rampPeakList*)returnPtr)->getPeakCount() <= 0) |
|
238 |
- { |
|
239 |
- // something failed in RAMP, possibly because it's a missing scan |
|
240 |
- delete ((rampPeakList*)returnPtr); |
|
241 |
- returnPtr = NULL; |
|
242 |
- } |
|
243 |
- break; |
|
244 |
- |
|
245 |
- // HENRY -- add the instrument info reading functionality (present in RAMP, but not provided in cRAMP before) |
|
246 |
- case RAMP_INSTRUMENT: |
|
247 |
- // std::cerr << "in: rampInstrumentInfo(m_handle)\n" ; |
|
248 |
- returnPtr = new rampInstrumentInfo(m_handle); |
|
249 |
- //std::cerr << "out: rampInstrumentInfo(m_handle)\n" ; |
|
250 |
- if (((rampInstrumentInfo*)returnPtr)->m_instrumentStructPtr == NULL) |
|
251 |
- { |
|
252 |
- delete ((rampInstrumentInfo*)returnPtr); |
|
253 |
- returnPtr = NULL; |
|
254 |
- } |
|
255 |
- break; |
|
256 |
- } |
|
257 |
- |
|
258 |
- } |
|
259 |
- } |
|
260 |
- |
|
261 |
- |
|
262 |
- |
|
263 |
- return returnPtr; |
|
264 |
-} |
|
265 |
- |
|
266 |
- |
|
267 |
-/** |
|
268 |
- * This function performs a non-sequential parsing operation on an indexed |
|
269 |
- * msxml file to obtain minimal info on the msRun contained in the file. |
|
270 |
- |
|
271 |
- * |
|
272 |
- * @return rapRunInfo* is dynamically allocate and becomes property of the caller, who |
|
273 |
- * is responsible for its deallocation!! |
|
274 |
- */ |
|
275 |
- |
|
276 |
-rampRunInfo* cRamp::getRunInfo ( ) |
|
277 |
-{ |
|
278 |
- rampRunInfo* result; |
|
279 |
- if (m_runInfo) // did we derive this already? |
|
280 |
- { |
|
281 |
- result = new rampRunInfo(*m_runInfo); |
|
282 |
- } |
|
283 |
- else |
|
284 |
- { |
|
285 |
- result = (rampRunInfo*) do_ramp(0, RAMP_RUNINFO); |
|
286 |
- } |
|
287 |
- return result; |
|
288 |
-} |
|
289 |
- |
|
290 |
-/** |
|
291 |
- * This function performs a non-sequential parsing operation on an indexed |
|
292 |
- * msxml file to obtain minimal header info for a numbered scan (thus minimizing parse time). |
|
293 |
- * |
|
294 |
- * @param fileName: Name of the msxml file |
|
295 |
- * @param startSCan: Number of the scan we want to read from |
|
296 |
- * @return rapHeaderInfo* is dynamically allocate and becomes property of the caller, who |
|
297 |
- * is responsible for its deallocation!! returns just the minimal header info num, msLevel and retentionTime |
|
298 |
- */ |
|
299 |
- |
|
300 |
-rampScanInfo* cRamp::getScanHeaderInfo ( int whichScan ) |
|
301 |
-{ |
|
302 |
- return (rampScanInfo*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_HEADER); |
|
303 |
-} |
|
304 |
- |
|
305 |
- |
|
306 |
-/** |
|
307 |
- * This function performs a non-sequential parsing operation on an indexed |
|
308 |
- * msxml file to obtain peak info for a numbered scan. |
|
309 |
- * |
|
310 |
- * @param fileName: Name of the msxml file |
|
311 |
- * @param startSCan: Number of the scan we want to read from |
|
312 |
- * @return rapPeakList* is dynamically allocate and becomes property of the caller, who |
|
313 |
- * is responsible for its deallocation!! returns everything found in scan, precursorMz and peaks |
|
314 |
- */ |
|
315 |
- |
|
316 |
-rampPeakList* cRamp::getPeakList ( int whichScan ) |
|
317 |
-{ |
|
318 |
- return (rampPeakList*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_PEAKS); |
|
319 |
-} |
|
320 |
- |
|
321 |
-// HENRY - provides instrument info getting method |
|
322 |
-rampInstrumentInfo* cRamp::getInstrumentInfo () |
|
323 |
-{ |
|
324 |
- return (rampInstrumentInfo*) do_ramp(0, RAMP_INSTRUMENT); |
|
325 |
-} |
|
326 |
-// END HENRY |
|
327 |
- |
|
328 |
- |
|
329 |
-// HENRY - sequential access parser that skips over missing scans. This version only reads scan header. |
|
330 |
-bool cRampIterator::nextScan(rampScanInfo** scanInfo) |
|
331 |
-{ |
|
332 |
- while (++m_currentScan <= m_cramp.getLastScan() && m_cramp.getScanOffset(m_currentScan) <= 0); |
|
333 |
- if (m_currentScan > m_cramp.getLastScan()) |
|
334 |
- { |
|
335 |
- return (false); |
|
336 |
- } |
|
337 |
- |
|
338 |
- *scanInfo = (rampScanInfo*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_HEADER); |
|
339 |
- return (true); |
|
340 |
-} |
|
341 |
-// END HENRY |
|
342 |
- |
|
343 |
-// HENRY - sequential access parser that skips over missing scans. This version reads both scan header and peak list. |
|
344 |
-bool cRampIterator::nextScan(rampScanInfo** scanInfo, rampPeakList** peakList) |
|
345 |
-{ |
|
346 |
- while (++m_currentScan <= m_cramp.getLastScan() && m_cramp.getScanOffset(m_currentScan) <= 0); |
|
347 |
- if (m_currentScan > m_cramp.getLastScan()) |
|
348 |
- { |
|
349 |
- return (false); |
|
350 |
- } |
|
351 |
- |
|
352 |
- *scanInfo = (rampScanInfo*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_HEADER); |
|
353 |
- *peakList = (rampPeakList*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_PEAKS); |
|
354 |
- |
|
355 |
- return (true); |
|
356 |
- |
|
357 |
-} |
|
358 |
-// END HENRY |
|
359 |
- |
|
360 |
-// HENRY - resets the sequential access parser to the first scan. |
|
361 |
-void cRampIterator::reset() |
|
362 |
-{ |
|
363 |
- m_currentScan = 1; |
|
364 |
-} |
|
365 |
-// END HENRY |
|
366 |
- |
|
367 |
-/** |
|
368 |
- * populate from a file handle |
|
369 |
- **/ |
|
370 |
-rampPeakList::rampPeakList(RAMPFILE *handle, ramp_fileoffset_t index) |
|
371 |
-{ |
|
372 |
- init(); |
|
373 |
- m_peaksCount = readPeaksCount(handle,index); |
|
374 |
- m_pPeaks = (rampPeakInfoStruct *)readPeaks(handle,index); |
|
375 |
-} |
|
376 |
- |
|
377 |
-/** |
|
378 |
- * populate from a file handle |
|
379 |
- **/ |
|
380 |
-rampScanInfo::rampScanInfo(RAMPFILE *handle, ramp_fileoffset_t index, int seqNum) |
|
381 |
-{ |
|
382 |
- init(); |
|
383 |
- readHeader(handle,index,&m_data); |
|
384 |
- m_data.seqNum = seqNum; |
|
385 |
-} |
|
386 |
- |
|
387 |
-/** |
|
388 |
- * populate from a file handle |
|
389 |
- **/ |
|
390 |
-rampRunInfo::rampRunInfo(RAMPFILE *handle) |
|
391 |
-{ |
|
392 |
- init(); |
|
393 |
- readMSRun(handle,&m_data); |
|
394 |
-} |
|
395 |
- |
|
396 |
-// HENRY - provides instrument info reading functionality |
|
397 |
-rampInstrumentInfo::rampInstrumentInfo(RAMPFILE *handle) |
|
398 |
-{ |
|
399 |
- init(); |
|
400 |
- m_instrumentStructPtr = getInstrumentStruct(handle); |
|
401 |
-} |
|
402 |
-// END HENRY |
From: Laurent <lg390@cam.ac.uk>
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@121284 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -95,7 +95,7 @@ cRamp::cRamp( const char* fileName,bool declaredScansOnly ) : |
95 | 95 |
// if (m_runInfo->m_data.scanCount < 0) { // undeclared scan count |
96 | 96 |
// this will provoke reading of index, which sets scan count |
97 | 97 |
rampScanInfo* tmp = getScanHeaderInfo ( 1 ); |
98 |
- free(tmp); |
|
98 |
+ delete(tmp); // was free - but see https://github.com/sneumann/mzR/issues/52 |
|
99 | 99 |
// } |
100 | 100 |
// END HENRY |
101 | 101 |
} |
Commit information:
Commit id: 289dc240065888efcaa22ae75951e81f94fc800f
Fix package description after merge
Committed by: Steffen Neumann
Author Name: Steffen Neumann
Commit date: 2014-09-28 17:21:35 +0200
Author date: 2014-09-28 17:21:35 +0200
Commit id: 88248e8d6d86bb54dc260f0c55608dd1a949ade4
merged gsoc into master
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-27 08:49:45 +0100
Author date: 2014-09-27 08:49:45 +0100
Commit id: bb01e0fe0b4f04335925472a7c2b91bd22b57755
included KK's segfault patch and fixed unit test accordingly
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-27 08:44:50 +0100
Author date: 2014-09-27 08:44:50 +0100
Commit id: 708bd0b8ac4b2b5bae9a9b91588a260f2eeefb46
add message about pwiz backend in Bioc 3.1
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-25 01:20:52 +0100
Author date: 2014-09-25 01:20:52 +0100
Commit id: 4c1410ec3c8f153ad0a4b04722cad5a7d77cfd4c
restoring ramp as default backend
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-25 01:06:21 +0100
Author date: 2014-09-25 01:06:21 +0100
Commit id: c5d60529934813456555934bbeed29502100b41b
show pwiz method
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 21:09:38 +0100
Author date: 2014-09-21 21:09:38 +0100
Commit id: 20bfbfa1db25ec247f2313804d9b73c086a2d920
add close,mzRpwiz-method alias
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 21:04:48 +0100
Author date: 2014-09-21 21:04:48 +0100
Commit id: f80ecdc2a7f14c311b42ad279c62307a6e0aad30
test that close(pwiz) works
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 20:45:50 +0100
Author date: 2014-09-21 20:45:50 +0100
Commit id: d18dc8b0c7197c72b1bb2a70e7becfe983ced9a1
fixed signature for pwiz close method
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 20:44:41 +0100
Author date: 2014-09-21 20:44:41 +0100
Commit id: c0d7451e6b31068cde89f08ac5037a1509857cc5
fix codoc mismatch
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 19:02:00 +0100
Author date: 2014-09-21 19:02:00 +0100
Commit id: 14974a3d0890a7e2a1a7179aaa483e20a5700ef9
add close for pwiz backend to news
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 18:58:06 +0100
Author date: 2014-09-21 18:58:06 +0100
Commit id: c9d2bbb339c0ecdc9870dbd7a59bfbb94ef67f73
dummy close for pwiz backend
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 18:56:48 +0100
Author date: 2014-09-21 18:56:48 +0100
Commit id: 6d608b453328d6c751dc828d2586b016eb17b095
more close calls to remove for pwiz backend
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 18:52:55 +0100
Author date: 2014-09-21 18:52:55 +0100
Commit id: 5650801e07df64e2d74302ec98a31938bb62f11f
no isInitialised with pwiz
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 18:41:57 +0100
Author date: 2014-09-21 18:41:57 +0100
Commit id: 2a3d0eeb24673eb74c3ffa38fefb1883f9bee15d
no close with pwiz
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 17:46:38 +0100
Author date: 2014-09-21 17:46:38 +0100
Commit id: b3ae014569b6e46ccb6b396dfb9320dd7ba8fb16
bump version to avoid confusions
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 17:30:28 +0100
Author date: 2014-09-21 17:30:28 +0100
Commit id: a1bd596ffbeef73b4b505342f45742f9997e33d1
using pwiz as default raw data backend
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-21 17:29:02 +0100
Author date: 2014-09-21 17:29:02 +0100
Commit id: 51b4ea21d9cf034d54b0911bf281af3a937375de
Steffen's changes in v 1.11.11
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-20 16:21:14 +0100
Author date: 2014-09-20 16:21:14 +0100
Commit id: 81cde1ca48974585c9d6f51927087a922b13dd89
add new length to doc header
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-20 16:06:46 +0100
Author date: 2014-09-20 16:06:46 +0100
Commit id: 3fe883cb7ecad4867908fb907374a4df63b50a1f
show and length mzRident methods
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-09-20 15:56:26 +0100
Author date: 2014-09-20 15:56:26 +0100
Commit id: 3efb44e00fb94cdf0eb8207634218cbb47ab1b54
VignetteBuilder: knitr
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-08-27 01:03:36 +0100
Author date: 2014-08-27 01:03:36 +0100
Commit id: 73b0f902dfaa53f359318708f0606dc1f4677057
BiocStyle vig
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-08-26 23:59:29 +0100
Author date: 2014-08-26 23:59:29 +0100
Commit id: 185f281d07ed7b4a7f093eaf7b61271a88c85e20
update readme
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-08-26 23:20:02 +0100
Author date: 2014-08-26 23:20:02 +0100
Commit id: d5cc992e128594d331592b2bd57871fabf6737c9
update to build
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-08-17 22:41:17 +0100
Author date: 2014-08-17 22:41:17 +0100
Commit id: 27318416c94859102a061838a1a3f83d378414e3
bump to 1.99
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-08-17 22:12:44 +0100
Author date: 2014-08-17 22:12:44 +0100
Commit id: 13caefb4d4b469f0406ed96509ea4cebce8235b0
pulled from https://github.com/thirdwing/mzR
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-08-17 22:00:57 +0100
Author date: 2014-08-17 22:00:57 +0100
Commit id: 14822efb6c2238eda371718043bec9cc8fb27558
doc
Committed by: qkou
Author Name: qkou
Commit date: 2014-08-16 22:06:51 -0400
Author date: 2014-08-16 22:06:51 -0400
Commit id: 323424443efac769c436fb87128fad64a0358187
R_init_mzR.c
Committed by: qkou
Author Name: qkou
Commit date: 2014-08-10 00:46:14 -0400
Author date: 2014-08-10 00:46:14 -0400
Commit id: a91c0601e674efbb6949331a53ea9c6af53a4ba5
vignettes
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-06 21:03:23 -0400
Author date: 2014-08-06 21:03:23 -0400
Commit id: 4607e0a595f60a083d1eb90b804348ac5a8c1fb4
update with msdata
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-05 12:33:40 -0400
Author date: 2014-08-05 12:33:40 -0400
Commit id: cc09a790eda22b7d64226116ada89bad9089e0b2
modified: src/RcppPwiz.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-04 22:29:15 -0400
Author date: 2014-08-04 22:29:15 -0400
Commit id: fac511ee0f7841791bbf5380f2c948fd045b3adb
unit test against mzID
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-04 22:16:03 -0400
Author date: 2014-08-04 22:16:03 -0400
Commit id: 449952e31fe354b2589d8a723a4f8a842812ede6
enzymes() returns data.frame
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-03 16:29:59 -0400
Author date: 2014-08-03 16:29:59 -0400
Commit id: 874fba33e8029023d5e3bbd168dc998d51544c9d
writing support dropped
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-03 16:14:26 -0400
Author date: 2014-08-03 16:14:26 -0400
Commit id: 338f3e80dd8f98419555ab1a4aa443e14d089f24
modifications()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-03 16:02:20 -0400
Author date: 2014-08-03 16:02:20 -0400
Commit id: 34ee62ee27e7b012b9ce2bd696d63e5f80185200
psms() update
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-03 15:41:36 -0400
Author date: 2014-08-03 15:41:36 -0400
Commit id: b8bdea9a1e2a7ab3410eea5c26566ef74e488d95
score()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-03 14:14:53 -0400
Author date: 2014-08-03 14:14:53 -0400
Commit id: a42f1195b3f0b40c28aa2acfb782e517633206c9
psms()
Committed by: qkou
Author Name: qkou
Commit date: 2014-08-03 13:54:34 -0400
Author date: 2014-08-03 13:54:34 -0400
Commit id: 6c2a87019e3b328dbecc1a965d3e41e6539e0d90
para() update, numeric correction
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-08-02 23:57:41 -0400
Author date: 2014-08-02 23:57:41 -0400
Commit id: 119edf40600beb8e3b8e8006a0d955a887d06b1d
update para()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-30 10:54:40 -0400
Author date: 2014-07-30 10:54:40 -0400
Commit id: 69ac718d0418f2ab3ba824a735975ae6c04aec00
update database()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-30 10:38:42 -0400
Author date: 2014-07-30 10:38:42 -0400
Commit id: f7818556b2e1e3296a727eca6d2853a8b7a16b12
clean
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-29 21:35:59 -0400
Author date: 2014-07-29 21:35:59 -0400
Commit id: f67403a92b6beca4128c36b42367414463234253
database()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-29 21:33:07 -0400
Author date: 2014-07-29 21:33:07 -0400
Commit id: 8b0255a9c7da6ccc6c7796f49f608b792bac0dfe
para()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-29 20:33:14 -0400
Author date: 2014-07-29 20:33:14 -0400
Commit id: 183afed91ad6beb07fffb5cbe4673773619d938b
Rd
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-29 00:36:40 -0400
Author date: 2014-07-29 00:36:40 -0400
Commit id: 73d380115e205eedc211869d6eace3564b3fc1cf
modified: vignettes/mzR.Rnw
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-27 00:49:10 -0400
Author date: 2014-07-27 00:49:10 -0400
Commit id: 93214634ff41a9da84019320dfe6314cb7f94422
score
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-26 19:42:34 -0400
Author date: 2014-07-26 19:42:34 -0400
Commit id: cbdee47033cf10927b0dc33a02208c9ff9d89771
same header info
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-22 12:45:46 -0400
Author date: 2014-07-22 12:45:46 -0400
Commit id: 1e6ebe39851ecddedf01daa2c69fcd1f2dba906c
modified: NAMESPACE modified: R/AllGenerics.R modified: R/methods-mzRident.R modified: inst/unitTests/runit.backends.R modified: man/metadata.Rd modified: man/mzR-class.Rd
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-18 00:40:10 -0400
Author date: 2014-07-18 00:40:10 -0400
Commit id: 0ed92085be5af56a78cdf0f1732a356c48d7a0f9
1.11.10
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-17 21:31:27 -0400
Author date: 2014-07-17 21:31:27 -0400
Commit id: b6e254b2cca93778bfcdc549b75052d0b19bb2bb
fixed
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-16 01:40:10 -0400
Author date: 2014-07-16 01:40:10 -0400
Commit id: 096aa2a6f5aebb5b99bc2e22a0fb023b1353b141
Merge pull request #3 from lgatto/master
fix backend checking
Committed by: Qiang Kou
Author Name: Qiang Kou
Commit date: 2014-07-15 21:20:15 -0400
Author date: 2014-07-15 21:20:15 -0400
Commit id: 6d8623c47c0b53e6805b9757c178c4639319a29d
fix backend checking
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-07-15 23:32:46 +0100
Author date: 2014-07-15 23:32:46 +0100
Commit id: 9060e3435a76ace952d915c3bb993e04ac93f12a
modified: src/RcppIdent.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-14 10:52:41 -0400
Author date: 2014-07-14 10:52:41 -0400
Commit id: 068ec46671400a2db3bfb10f001f30599b8495e8
modified: ChangeLog
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-12 17:29:16 -0400
Author date: 2014-07-12 17:29:16 -0400
Commit id: a8f42c9de00ed64470733eb5c63567e99d40e867
more info
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-12 14:57:33 -0400
Author date: 2014-07-12 14:57:33 -0400
Commit id: 4a88ad7c2c8ec911c44a45d16dedced9530505c2
modified: src/RcppIdent.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-12 14:13:29 -0400
Author date: 2014-07-12 14:13:29 -0400
Commit id: 935d44c5a52b895fe6ff663c062e006e4f25fab0
modified: src/RcppIdent.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-12 13:52:33 -0400
Author date: 2014-07-12 13:52:33 -0400
Commit id: f1c05ff287215f385938a116042d09bcea2aae88
modified: R/methods-mzRident.R modified: man/mzR-class.Rd modified: src/RcppIdent.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-12 11:20:58 -0400
Author date: 2014-07-12 11:20:58 -0400
Commit id: ca620536203355349c7267ad15a2ab6a2d248319
pass R CMD check
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-12 00:36:08 -0400
Author date: 2014-07-12 00:36:08 -0400
Commit id: add1d1c98fe60955953036641671527337e89363
modified: R/methods-mzRident.R modified: man/metadata.Rd modified: man/mzR-class.Rd modified: src/Makevars modified: src/Makevars.win
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-11 23:48:02 -0400
Author date: 2014-07-11 23:48:02 -0400
Commit id: 050051489df378a26aa97cccfefbf7ebe4102ef5
pepInfo()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-11 18:10:10 -0400
Author date: 2014-07-11 18:10:10 -0400
Commit id: f093e39599ea2357c91816b7ff9de102f33e8e68
modified: NAMESPACE modified: R/AllGenerics.R modified: R/methods-mzRident.R modified: src/RcppIdent.cpp modified: src/RcppIdent.h modified: src/RcppIdentModule.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-11 15:12:28 -0400
Author date: 2014-07-11 15:12:28 -0400
Commit id: 3dc85db859c4d36040d3edb9ceb57074b0476f2d
modified: NAMESPACE modified: R/AllGenerics.R modified: R/methods-mzRident.R modified: src/RcppIdent.cpp modified: src/RcppIdent.h modified: src/RcppIdentModule.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-11 14:49:47 -0400
Author date: 2014-07-11 14:49:47 -0400
Commit id: ab1261cb3bfe1c02de5f7a053e6de5223686488d
modified: NAMESPACE modified: R/AllGenerics.R modified: R/methods-mzRident.R modified: src/RcppIdent.cpp modified: src/RcppIdent.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-11 13:47:12 -0400
Author date: 2014-07-11 13:47:12 -0400
Commit id: 01a4a2be981724624719580cd8e4f0866091f295
version
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-11 01:48:50 -0400
Author date: 2014-07-11 01:48:50 -0400
Commit id: 5f49d13b736cebd65484a5993cdcce253853d4e7
remove mz5
Committed by: qkou
Author Name: qkou
Commit date: 2014-07-11 01:41:00 -0400
Author date: 2014-07-11 01:41:00 -0400
Commit id: fb3dbe2f1bf007cd033fd803426d4be2e362b3e2
Update H5public.h
Committed by: Qiang Kou
Author Name: Qiang Kou
Commit date: 2014-07-07 08:46:19 -0400
Author date: 2014-07-07 08:46:19 -0400
Commit id: 2446f08fdadd11c38a1cb54dddfe1e52b1a7bca9
modified: src/pwiz/utility/chemistry/Chemistry.hpp modified: src/pwiz/utility/misc/Std.hpp modified: src/pwiz/utility/misc/sha1calc.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-04 19:41:41 -0400
Author date: 2014-07-04 19:41:41 -0400
Commit id: b7c28c0db06b2dc9f8f5a7dcd218b7581ffd8121
compiled
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-04 18:05:54 -0400
Author date: 2014-07-04 18:05:54 -0400
Commit id: 1ffe5c024dafd51c2342f4d1dd930cb8d67d8041
modified: DESCRIPTION modified: src/Makevars.win
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-04 10:09:46 -0400
Author date: 2014-07-04 10:09:46 -0400
Commit id: 06e03716f187508072c33d3f0e9e79e135b22c05
modified: src/Makevars modified: src/hdf5/src/H5public.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-03 22:32:09 -0400
Author date: 2014-07-03 22:32:09 -0400
Commit id: 488ed2bd55151ece46c8cb5ac1df11f73b7c47a3
modified: src/Makevars
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-03 21:48:39 -0400
Author date: 2014-07-03 21:48:39 -0400
Commit id: 06f4d0a3832e47ad4a69e53d7b9b751dbb9f2770
modified: src/hdf5/src/H5public.h modified: src/pwiz/utility/misc/SHA1.cpp modified: src/pwiz/utility/misc/SHA1.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-07-03 21:47:50 -0400
Author date: 2014-07-03 21:47:50 -0400
Commit id: ff58989379a67f20ac8797ba437d430d8b5a2d62
modified: src/RcppIdent.cpp
Committed by: qkou
Author Name: qkou
Commit date: 2014-06-30 09:42:05 -0400
Author date: 2014-06-30 09:42:05 -0400
Commit id: 58dfa68675768c13950299c43229c1b0f1f1824b
modified: src/RcppIdent.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-28 21:17:18 -0400
Author date: 2014-06-28 21:17:18 -0400
Commit id: 6c228ae30c477e76add7e3ea805e386f1a0d862d
modified: src/RcppIdent.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-28 20:16:55 -0400
Author date: 2014-06-28 20:16:55 -0400
Commit id: 464d4e83a9e06732f7c3f1a0172a9cb2bbd53943
modified: src/RcppIdent.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-28 17:21:01 -0400
Author date: 2014-06-28 17:21:01 -0400
Commit id: ed36541a5fc99192f9df55222f2a2d9a6352ae33
idInfo
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-28 17:02:20 -0400
Author date: 2014-06-28 17:02:20 -0400
Commit id: 1ed6dceee93d2f57a66a94b15774212403d42200
modified: NAMESPACE modified: R/AllGenerics.R modified: R/methods-mzRident.R modified: src/RcppIdent.cpp modified: src/RcppIdent.h modified: src/RcppIdentModule.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-28 15:19:47 -0400
Author date: 2014-06-28 15:19:47 -0400
Commit id: 47b2a99876650729a329ebeebc174d9873919667
modified: DESCRIPTION
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-28 13:12:13 -0400
Author date: 2014-06-28 13:12:13 -0400
Commit id: ecad541c1e2d92f7be63433c5bf362d7b7f955b2
mzid supported done
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-28 13:04:27 -0400
Author date: 2014-06-28 13:04:27 -0400
Commit id: 684340ce7ee5b8fadbd4dfa839e3b0d7ba9b1c91
mzid file support
Committed by: kouqiang
Author Name: kouqiang
Commit date: 2014-06-28 01:02:19 -0400
Author date: 2014-06-28 01:02:19 -0400
Commit id: 7382b1321539a2838ae75da6f9c1ff9cbe98bb6b
mzid
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-27 23:38:36 -0400
Author date: 2014-06-27 23:38:36 -0400
Commit id: 5423b4c653762d90ce6d4bf7dcf1d591a2a9987f
modified: R/methods-mzRpwiz.R modified: R/zzz.R modified: src/RcppPwiz.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-27 23:27:36 -0400
Author date: 2014-06-27 23:27:36 -0400
Commit id: 9e20328e920207328eb68b9fa59c198d0d634a0f
Update AllGenerics.R
Committed by: Qiang Kou
Author Name: Qiang Kou
Commit date: 2014-06-27 22:52:37 -0400
Author date: 2014-06-27 22:52:37 -0400
Commit id: 19731b9e51b72027eb02ee6be5aa7343c5b12ace
modified: NAMESPACE modified: R/AllGenerics.R modified: R/methods-mzRpwiz.R modified: man/metadata.Rd modified: man/mzR-class.Rd modified: man/openMSfile.Rd modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h modified: src/RcppPwizModule.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-27 22:03:31 -0400
Author date: 2014-06-27 22:03:31 -0400
Commit id: 94ac2b4ba810d0f820a9266be782667e375ede9a
modified: src/RcppPwiz.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-27 10:15:58 -0400
Author date: 2014-06-27 10:15:58 -0400
Commit id: 1259a8db48d4f7aa9ffe403dd5ee574bbfd238fb
modified: R/zzz.R modified: src/RcppPwiz.cpp
Committed by: kouqiang
Author Name: kouqiang
Commit date: 2014-06-27 00:44:31 -0400
Author date: 2014-06-27 00:44:31 -0400
Commit id: 9791bc574989cdefe279071dbf3a47232e1d8c86
identadata src
Committed by: kouqiang
Author Name: kouqiang
Commit date: 2014-06-27 00:22:35 -0400
Author date: 2014-06-27 00:22:35 -0400
Commit id: ede49e01e23c6586777d72fdd0dfef4bd40729f2
software info
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 22:20:57 -0400
Author date: 2014-06-26 22:20:57 -0400
Commit id: 431b2b42a93ff52a05d82801d1830ba81c72f18f
writeMSfile()
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 21:53:11 -0400
Author date: 2014-06-26 21:53:11 -0400
Commit id: 53a7a31378bd42adcf779cd1fbe9e2d052a507d7
deleted: src/hdf5/c++/src/H5 deleted: src/hdf5/c++/src/H5DataTy deleted: src/pwiz/data/common/BinaryIndexSt deleted: src/pwiz/data/common/ParamT deleted: src/pwiz/data/m deleted: src/pwiz/data/msdata/BinaryDataEnc deleted: src/pwiz/data/msdata/Chroma deleted: src/pwiz/data/msdata/MSNu deleted: src/pwiz/data/msdata/Seri deleted: src/pwiz/data/msdata/Serializer deleted: src/pwiz/data/msdata/Serializer_mz deleted: src/pwiz/data/msdata/Sp deleted: src/pwiz/data/msdata/Spec deleted: src/pwiz/data/msdata/mz5/Refer deleted: src/pwiz/utility/mis deleted: src/pwiz/utility/misc/IntegerS
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 19:04:22 -0400
Author date: 2014-06-26 19:04:22 -0400
Commit id: 359a40045162a49d94d68f0d60f2c6bb43970a2c
modified: NAMESPACE modified: R/AllGenerics.R modified: R/io.R modified: R/methods-mzRpwiz.R modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h modified: src/RcppPwizModule.cpp new file: src/boost/filesystem/src/operations new file: src/hdf5/c++/src/H5 new file: src/hdf5/c++/src/H5DataTy new file: src/pwiz/data/common/BinaryIndexSt new file: src/pwiz/data/common/ParamT new file: src/pwiz/data/m new file: src/pwiz/data/msdata/BinaryDataEnc new file: src/pwiz/data/msdata/Chroma new file: src/pwiz/data/msdata/MSNu new file: src/pwiz/data/msdata/Seri new file: src/pwiz/data/msdata/Serializer new file: src/pwiz/data/msdata/Serializer_mz new file: src/pwiz/data/msdata/Sp new file: src/pwiz/data/msdata/Spec new file: src/pwiz/data/msdata/mz5/Refer new file: src/pwiz/utility/mis new file: src/pwiz/utility/misc/IntegerS
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 19:00:48 -0400
Author date: 2014-06-26 19:00:48 -0400
Commit id: 2ce04488e7a8e623a7dfd2b9408da0b9dd5059a4
modified: inst/unitTests/runit.backends.R modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 15:59:21 -0400
Author date: 2014-06-26 15:59:21 -0400
Commit id: 3103fd4fa92ddd63700c8b5940344db44e97be09
modified: src/RcppPwiz.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 13:33:44 -0400
Author date: 2014-06-26 13:33:44 -0400
Commit id: 329f7c1201360f5ebf5703d4837b25ae332e7a85
modified: man/metadata.Rd modified: man/mzR-class.Rd modified: src/RcppPwiz.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 11:35:13 -0400
Author date: 2014-06-26 11:35:13 -0400
Commit id: 0adf852da9ccec69103038ca96b30e8715d3c898
modified: inst/unitTests/runit.backends.R modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-26 11:20:03 -0400
Author date: 2014-06-26 11:20:03 -0400
Commit id: 219b5287ca5531577b4a6c80f403957ddef5ab94
modified: src/RcppPwiz.cpp
Committed by: kouqiang
Author Name: kouqiang
Commit date: 2014-06-26 01:33:43 -0400
Author date: 2014-06-26 01:33:43 -0400
Commit id: 14316dcb1c16ca922d9962ed9ecdaac324e1a151
deleted: src/R_init_mzR.c modified: src/RcppPwiz.cpp deleted: src/ramp_base64.cpp deleted: src/ramp_base64.h
Committed by: kouqiang
Author Name: kouqiang
Commit date: 2014-06-26 01:04:14 -0400
Author date: 2014-06-26 01:04:14 -0400
Commit id: efb21501a1b05b680b3d35aa124216f9977b5993
modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-25 23:44:07 -0400
Author date: 2014-06-25 23:44:07 -0400
Commit id: 4e9e1dec2879178547d681603aec46259a6a9978
mz5
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-25 22:54:26 -0400
Author date: 2014-06-25 22:54:26 -0400
Commit id: 0e7fc23b1ff7508fed6331c0e517a8dc6fa33a0c
mz5
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-25 22:28:24 -0400
Author date: 2014-06-25 22:28:24 -0400
Commit id: 9ad55a2cdd89791bf75ad23f0ee91b3fc70624ad
mz5
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-25 22:13:35 -0400
Author date: 2014-06-25 22:13:35 -0400
Commit id: c9fecd83ebf31f142c22030f4593fe5ac675323a
modified: R/methods-mzRpwiz.R modified: src/RcppPwiz.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-24 23:31:33 -0400
Author date: 2014-06-24 23:31:33 -0400
Commit id: 4edf517724950d6771fd19c979a460711baa5891
modified: R/methods-mzRpwiz.R modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-24 23:01:49 -0400
Author date: 2014-06-24 23:01:49 -0400
Commit id: 22ca998b6b6d3a7496f293f44909436a5b7d8ad0
modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-24 21:31:58 -0400
Author date: 2014-06-24 21:31:58 -0400
Commit id: 6beb4ce5c49cafa644766e23453ed6d10bb89c34
modified: man/metadata.Rd modified: man/mzR-class.Rd
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-22 12:02:07 -0400
Author date: 2014-06-22 12:02:07 -0400
Commit id: dc5e65d93bb67d1b4a1488b90099946e22eed13c
deleted: .travis.yml
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-22 11:26:02 -0400
Author date: 2014-06-22 11:26:02 -0400
Commit id: be53359804d6c7416c715c3eb259fb931c6c117a
modified: .travis.yml modified: src/Makevars.win
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-21 21:33:37 -0400
Author date: 2014-06-21 21:33:37 -0400
Commit id: 1afd9887dac232f3e72fe9d20d44a72b42e28461
deleted: .Rinstignore
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-21 21:27:46 -0400
Author date: 2014-06-21 21:27:46 -0400
Commit id: bd4c954bd246787137eb0d961a91bb80b774cb6a
new file: .Rbuildignore new file: .travis.yml
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-21 21:25:47 -0400
Author date: 2014-06-21 21:25:47 -0400
Commit id: 3bc8fcca8002a62458a2b2dd1c6b7cf6a8cfab9f
fixed error on windows and snow leopard
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-21 21:18:50 -0400
Author date: 2014-06-21 21:18:50 -0400
Commit id: ed9c622443eb992cf3322d687312e3f56bf8be72
Update Makevars.win
Committed by: Qiang Kou
Author Name: Qiang Kou
Commit date: 2014-06-15 00:55:16 +0800
Author date: 2014-06-15 00:55:16 +0800
Commit id: bf8c7bd931cd93b5db6d84c9c1bf323ea7702e74
new file: src/boost/signals/connection.hpp new file: src/boost/signals/detail/config.hpp new file: src/boost/signals/detail/gen_signal_N.pl new file: src/boost/signals/detail/named_slot_map.hpp new file: src/boost/signals/detail/signal_base.hpp new file: src/boost/signals/detail/signals_common.hpp new file: src/boost/signals/detail/slot_call_iterator.hpp new file: src/boost/signals/signal0.hpp new file: src/boost/signals/signal1.hpp new file: src/boost/signals/signal10.hpp new file: src/boost/signals/signal2.hpp new file: src/boost/signals/signal3.hpp new file: src/boost/signals/signal4.hpp new file: src/boost/signals/signal5.hpp new file: src/boost/signals/signal6.hpp new file: src/boost/signals/signal7.hpp new file: src/boost/signals/signal8.hpp new file: src/boost/signals/signal9.hpp new file: src/boost/signals/signal_template.hpp new file: src/boost/signals/slot.hpp new file: src/boost/signals/trackable.hpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-14 12:52:52 -0400
Author date: 2014-06-14 12:52:52 -0400
Commit id: 5ac3655c7e81f429859eb6b509208f8ec785e1f9
modified: src/Makevars.win
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-07 11:42:14 -0400
Author date: 2014-06-07 11:42:14 -0400
Commit id: f9f42e3d83adbaf98a201e50866821bc0e43598a
modified: ChangeLog modified: src/RcppPwiz.cpp modified: src/hdf5/src/H5FDmulti.c
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-07 11:24:01 -0400
Author date: 2014-06-07 11:24:01 -0400
Commit id: d8d6f92e46efa93f8234e542b1c4f8f98cee59e5
modified: R/zzz.R.in
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-06 17:28:36 -0400
Author date: 2014-06-06 17:28:36 -0400
Commit id: e64a8bb7bb7988047466848e5b449038ae9460b3
modified: R/zzz.R modified: src/Makevars
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-06 16:40:29 -0400
Author date: 2014-06-06 16:40:29 -0400
Commit id: 0a44cc02ea9b5417ac51f60632fc1b6100c6d160
modified: src/Makevars
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-06 16:01:08 -0400
Author date: 2014-06-06 16:01:08 -0400
Commit id: 4d19d457031e0ae9af343a44774f5deebae01cc8
modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-06 14:16:37 -0400
Author date: 2014-06-06 14:16:37 -0400
Commit id: effcb581a573e13b7b7cc9b459ef2dec4885b4be
modified: src/RcppPwiz.cpp
Committed by: kouqiang
Author Name: kouqiang
Commit date: 2014-06-06 04:33:43 -0400
Author date: 2014-06-06 04:33:43 -0400
Commit id: 028f6748d4cf81d47569edcd67fe25064b084e60
modified: NAMESPACE modified: R/AllGenerics.R modified: R/methods-mzRpwiz.R modified: src/RcppPwiz.cpp
Committed by: thirdwing
Author Name: thirdwing
Commit date: 2014-06-04 23:21:43 -0400
Author date: 2014-06-04 23:21:43 -0400
Commit id: d95b557d2c637630ca784889cd0ef1f56b8423d5
Update methods-mzRpwiz.R
Committed by: Qiang Kou
Author Name: Qiang Kou
Commit date: 2014-06-04 21:51:47 -0400
Author date: 2014-06-04 21:51:47 -0400
Commit id: aad52653c2ceb33655364d5a39c0559225746cfb
Update RcppPwizModule.cpp
Committed by: Qiang Kou
Author Name: Qiang Kou
Commit date: 2014-06-04 21:50:32 -0400
Author date: 2014-06-04 21:50:32 -0400
Commit id: 4fda90cc08feb731aeb65c6015a033fbe46c372e
Update RcppPwiz.cpp
Committed by: Qiang Kou
Author Name: Qiang Kou
Commit date: 2014-06-04 21:48:06 -0400
Author date: 2014-06-04 21:48:06 -0400
Commit id: 660d2e984fabdd20997ff8b648d361c7d9aae711
modified: src/RcppPwiz.cpp modified: src/RcppPwiz.h
Committed by: qkou
Author Name: qkou
Commit date: 2014-06-02 13:07:57 -0400
Author date: 2014-06-02 13:07:57 -0400
Commit id: ec6bbdf496a57f2f39b2e4c3bbada75a060e5bbe
modified: src/boost_aux/boost/utility/singleton.hpp
Committed by: qkou
Author Name: qkou
Commit date: 2014-06-02 09:21:07 -0400
Author date: 2014-06-02 09:21:07 -0400
Commit id: a093954cb779467026288c7f51cca083e0a20661
modified: src/pwiz/data/msdata/ramp/ramp.cpp
Committed by: qkou
Author Name: qkou
Commit date: 2014-05-29 07:36:21 -0400
Author date: 2014-05-29 07:36:21 -0400
Commit id: 4510a1cda50ee8f1f43b667297918dcffed45af2
modified: src/Makevars modified: src/cramp.h modified: src/pwiz/data/msdata/ramp/ramp.cpp deleted: src/ramp.cpp deleted: src/ramp.h modified: src/rampR.cpp deleted: src/ramp_base64.cpp deleted: src/ramp_base64.h
Committed by: qkou
Author Name: qkou
Commit date: 2014-05-28 20:17:42 -0400
Author date: 2014-05-28 20:17:42 -0400
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@94635 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -2,14 +2,14 @@ |
2 | 2 |
cramp.cpp |
3 | 3 |
|
4 | 4 |
*************************************************************************** |
5 |
-cramp.hpp -- renamed cramp.h to avoid R checker warning |
|
5 |
+cramp.hpp -- renamed cramp.h to avoid R checker warning |
|
6 | 6 |
|
7 | 7 |
A C++ wrapper for the RAMP code. |
8 | 8 |
|
9 | 9 |
Use this library to parse an mzXML file in a non-sequential way, by |
10 |
- taking advantage of the index element. |
|
10 |
+ taking advantage of the index element. |
|
11 | 11 |
|
12 |
- (C) 2004 by Brian Pratt, Insilicos LLC |
|
12 |
+ (C) 2004 by Brian Pratt, Insilicos LLC |
|
13 | 13 |
|
14 | 14 |
Based on mzXML2Other, which has this copyright: |
15 | 15 |
------------------- |
... | ... |
@@ -69,42 +69,46 @@ cramp.hpp -- renamed cramp.h to avoid R checker warning |
69 | 69 |
|
70 | 70 |
|
71 | 71 |
|
72 |
-cRamp::cRamp( const char* fileName,bool declaredScansOnly ) : |
|
73 |
- m_filename(fileName), m_declaredScansOnly(declaredScansOnly), m_runInfo() |
|
72 |
+cRamp::cRamp( const char* fileName,bool declaredScansOnly ) : |
|
73 |
+ m_filename(fileName), m_declaredScansOnly(declaredScansOnly), m_runInfo() |
|
74 | 74 |
{ |
75 |
- m_handle = rampOpenFile(fileName); |
|
76 |
- m_scanOffsets = NULL; |
|
77 |
- m_runInfo = NULL; |
|
78 |
- m_lastScan = 0; |
|
79 |
- if (!OK()) { |
|
80 |
- // HENRY -- I would prefer this to be silent, and let the caller deals with it |
|
81 |
- // cout << "Error: Could not open file " << fileName << ": " << strerror(errno) << endl; |
|
82 |
- // END HENRY |
|
83 |
- } else { |
|
84 |
- |
|
85 |
- m_runInfo = getRunInfo(); |
|
86 |
- |
|
87 |
- // HENRY -- always read index to set scan count, since scan count |
|
88 |
- // declared at the top of the mzXML file is unreliable now that |
|
89 |
- // there are missing scans. |
|
90 |
- // This will also set the structs m_scanOffsets, and the value m_lastScan |
|
91 |
- |
|
92 |
- // if (m_runInfo->m_data.scanCount < 0) { // undeclared scan count |
|
93 |
- // this will provoke reading of index, which sets scan count |
|
94 |
- rampScanInfo* tmp = getScanHeaderInfo ( 1 ); |
|
95 |
- free(tmp); |
|
96 |
- // } |
|
97 |
- // END HENRY |
|
98 |
- } |
|
75 |
+ m_handle = rampOpenFile(fileName); |
|
76 |
+ m_scanOffsets = NULL; |
|
77 |
+ m_runInfo = NULL; |
|
78 |
+ m_lastScan = 0; |
|
79 |
+ if (!OK()) |
|
80 |
+ { |
|
81 |
+ // HENRY -- I would prefer this to be silent, and let the caller deals with it |
|
82 |
+ // cout << "Error: Could not open file " << fileName << ": " << strerror(errno) << endl; |
|
83 |
+ // END HENRY |
|
84 |
+ } |
|
85 |
+ else |
|
86 |
+ { |
|
87 |
+ |
|
88 |
+ m_runInfo = getRunInfo(); |
|
89 |
+ |
|
90 |
+ // HENRY -- always read index to set scan count, since scan count |
|
91 |
+ // declared at the top of the mzXML file is unreliable now that |
|
92 |
+ // there are missing scans. |
|
93 |
+ // This will also set the structs m_scanOffsets, and the value m_lastScan |
|
94 |
+ |
|
95 |
+ // if (m_runInfo->m_data.scanCount < 0) { // undeclared scan count |
|
96 |
+ // this will provoke reading of index, which sets scan count |
|
97 |
+ rampScanInfo* tmp = getScanHeaderInfo ( 1 ); |
|
98 |
+ free(tmp); |
|
99 |
+ // } |
|
100 |
+ // END HENRY |
|
101 |
+ } |
|
99 | 102 |
} |
100 | 103 |
|
101 |
-cRamp::~cRamp() { |
|
102 |
- rampCloseFile(m_handle); |
|
103 |
- |
|
104 |
- // NB: these pointers may be null on file open failure, |
|
105 |
- // but free/delete of NULL is OK per C++ standard |
|
106 |
- free(m_scanOffsets); |
|
107 |
- delete m_runInfo; // was free() - but allocated with new |
|
104 |
+cRamp::~cRamp() |
|
105 |
+{ |
|
106 |
+ rampCloseFile(m_handle); |
|
107 |
+ |
|
108 |
+ // NB: these pointers may be null on file open failure, |
|
109 |
+ // but free/delete of NULL is OK per C++ standard |
|
110 |
+ free(m_scanOffsets); |
|
111 |
+ delete m_runInfo; // was free() - but allocated with new |
|
108 | 112 |
} |
109 | 113 |
|
110 | 114 |
// |
... | ... |
@@ -112,157 +116,180 @@ cRamp::~cRamp() { |
112 | 116 |
// |
113 | 117 |
rampInfo* cRamp::do_ramp( ramp_fileoffset_t arg , eWhatToRead what ) |
114 | 118 |
{ |
115 |
- |
|
116 |
- switch( what ) { |
|
117 |
- case RAMP_RUNINFO: |
|
118 |
- case RAMP_HEADER: |
|
119 |
- case RAMP_PEAKS: |
|
120 |
- case RAMP_INSTRUMENT: |
|
121 |
- break; // OK |
|
122 |
- default: |
|
123 |
- Rf_error("unknown read type!\n"); |
|
124 |
- return NULL; |
|
125 |
- break; |
|
126 |
- } |
|
127 |
- |
|
128 |
- rampInfo* returnPtr=NULL; |
|
129 |
- |
|
130 |
- if ((RAMP_RUNINFO != what) && (RAMP_INSTRUMENT != what) && !m_scanOffsets) { |
|
131 |
- int iLastScan = 0; |
|
132 |
- // we need the index to get anything besides the header |
|
133 |
- // std::cerr << "in: getIndexOffset(m_handle);!\n"; |
|
134 |
- ramp_fileoffset_t indexOffset = getIndexOffset(m_handle); |
|
135 |
- // std::cerr << "out: getIndexOffset(m_handle);!\n"; |
|
136 |
- |
|
137 |
- // std::cerr << "in: readIndex();!\n"; |
|
138 |
- m_scanOffsets = readIndex(m_handle, indexOffset, &iLastScan); |
|
139 |
- //std::cerr << "out: readIndex();!\n"; |
|
140 |
- if (iLastScan >= m_runInfo->m_data.scanCount) { |
|
141 |
- if (!m_declaredScansOnly) { |
|
142 |
- m_runInfo->m_data.scanCount = iLastScan; |
|
143 |
- } else { // get rid of all the fake entries created |
|
144 |
- |
|
145 |
- // std::cerr << "get rid of all the fake entries created\n"; |
|
146 |
- for (int n=1;n<=iLastScan;n++) { // ramp is 1 based |
|
147 |
- if (m_scanOffsets[n]==-1) { |
|
148 |
- // find a run of fakes |
|
149 |
- int m; |
|
150 |
- for (m=n+1;(m<=iLastScan)&&(m_scanOffsets[m]==-1);m++); |
|
151 |
- if (m<=iLastScan) { |
|
152 |
- memmove(m_scanOffsets+n,m_scanOffsets+m, |
|
153 |
- sizeof(ramp_fileoffset_t)*((iLastScan-m)+1)); |
|
154 |
- } |
|
155 |
- iLastScan-=(m-n); |
|
156 |
- } |
|
157 |
- } |
|
158 |
- } |
|
159 |
- } |
|
160 |
- // HENRY - store last scan explicitly. |
|
161 |
- m_lastScan = iLastScan; |
|
162 |
- // END HENRY |
|
163 |
- } |
|
164 |
- |
|
165 |
- |
|
166 |
- // HENRY -- arg is out of bounds. instead of creating havoc in RAMP, let's just kill it here. |
|
167 |
- if (RAMP_RUNINFO != what && (RAMP_INSTRUMENT != what) && (arg > m_runInfo->m_data.scanCount || arg < 1)) { |
|
168 |
- return (NULL); |
|
169 |
- } |
|
170 |
- |
|
171 |
- if (m_scanOffsets || (RAMP_RUNINFO == what) || (RAMP_INSTRUMENT == what)) { |
|
172 |
- ramp_fileoffset_t scanOffset=-1; |
|
173 |
- if (RAMP_RUNINFO == what || RAMP_INSTRUMENT == what) { |
|
174 |
- scanOffset = 0; // read from head of file |
|
175 |
- } else { |
|
176 |
- scanOffset = m_scanOffsets[arg]; // ramp is one-based |
|
177 |
- } |
|
178 |
- |
|
179 |
- if (scanOffset >= 0) { |
|
180 |
- |
|
181 |
- // ----------------------------------------------------------------------- |
|
182 |
- // And now we can parse the info we were looking for |
|
183 |
- // ----------------------------------------------------------------------- |
|
184 |
- |
|
185 |
- |
|
186 |
- // Ok now we have to copy everything in our structure |
|
187 |
- switch( what ) |
|
188 |
- { |
|
189 |
- case RAMP_RUNINFO: |
|
190 |
- // std::cerr << "in: rampRunInfo( m_handle )\n"; |
|
191 |
- returnPtr = new rampRunInfo( m_handle ); |
|
192 |
- // std::cerr << "out: rampRunInfo( m_handle )\n"; |
|
193 |
- break; |
|
194 |
- case RAMP_HEADER: |
|
195 |
- // std::cerr << "in: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
196 |
- returnPtr = new rampScanInfo( m_handle, scanOffset, (int)arg ); |
|
197 |
- //std::cerr << "out: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
198 |
- if (returnPtr) { |
|
199 |
-#ifdef HAVE_PWIZ_MZML_LIB |
|
200 |
- if (!m_handle->mzML) // rampadapter already set this for us |
|
201 |
-#endif |
|
202 |
- ((rampScanInfo *)returnPtr)->m_data.filePosition = scanOffset; // for future reference |
|
203 |
- |
|
204 |
- // HENRY -- error checking here |
|
205 |
- if (((rampScanInfo*)returnPtr)->m_data.acquisitionNum < 0) { |
|
206 |
- // something failed in RAMP, possibly because it's a missing scan |
|
207 |
- delete ((rampScanInfo*)returnPtr); |
|
208 |
- returnPtr = NULL; |
|
209 |
- } |
|
119 |
+ |
|
120 |
+ switch( what ) |
|
121 |
+ { |
|
122 |
+ case RAMP_RUNINFO: |
|
123 |
+ case RAMP_HEADER: |
|
124 |
+ case RAMP_PEAKS: |
|
125 |
+ case RAMP_INSTRUMENT: |
|
126 |
+ break; // OK |
|
127 |
+ default: |
|
128 |
+ Rf_error("unknown read type!\n"); |
|
129 |
+ return NULL; |
|
130 |
+ break; |
|
131 |
+ } |
|
132 |
+ |
|
133 |
+ rampInfo* returnPtr=NULL; |
|
134 |
+ |
|
135 |
+ if ((RAMP_RUNINFO != what) && (RAMP_INSTRUMENT != what) && !m_scanOffsets) |
|
136 |
+ { |
|
137 |
+ int iLastScan = 0; |
|
138 |
+ // we need the index to get anything besides the header |
|
139 |
+ // std::cerr << "in: getIndexOffset(m_handle);!\n"; |
|
140 |
+ ramp_fileoffset_t indexOffset = getIndexOffset(m_handle); |
|
141 |
+ // std::cerr << "out: getIndexOffset(m_handle);!\n"; |
|
142 |
+ |
|
143 |
+ // std::cerr << "in: readIndex();!\n"; |
|
144 |
+ m_scanOffsets = readIndex(m_handle, indexOffset, &iLastScan); |
|
145 |
+ //std::cerr << "out: readIndex();!\n"; |
|
146 |
+ if (iLastScan >= m_runInfo->m_data.scanCount) |
|
147 |
+ { |
|
148 |
+ if (!m_declaredScansOnly) |
|
149 |
+ { |
|
150 |
+ m_runInfo->m_data.scanCount = iLastScan; |
|
210 | 151 |
} |
211 |
- break; |
|
212 |
- case RAMP_PEAKS: |
|
213 |
- returnPtr = new rampPeakList( m_handle, scanOffset); |
|
214 |
- |
|
215 |
- // HENRY -- error checking here |
|
216 |
- if (returnPtr && ((rampPeakList*)returnPtr)->getPeakCount() <= 0) { |
|
217 |
- // something failed in RAMP, possibly because it's a missing scan |
|
218 |
- delete ((rampPeakList*)returnPtr); |
|
219 |
- returnPtr = NULL; |
|
152 |
+ else // get rid of all the fake entries created |
|
153 |
+ { |
|
154 |
+ |
|
155 |
+ // std::cerr << "get rid of all the fake entries created\n"; |
|
156 |
+ for (int n=1; n<=iLastScan; n++) // ramp is 1 based |
|
157 |
+ { |
|
158 |
+ if (m_scanOffsets[n]==-1) |
|
159 |
+ { |
|
160 |
+ // find a run of fakes |
|
161 |
+ int m; |
|
162 |
+ for (m=n+1; (m<=iLastScan)&&(m_scanOffsets[m]==-1); m++); |
|
163 |
+ if (m<=iLastScan) |
|
164 |
+ { |
|
165 |
+ memmove(m_scanOffsets+n,m_scanOffsets+m, |
|
166 |
+ sizeof(ramp_fileoffset_t)*((iLastScan-m)+1)); |
|
167 |
+ } |
|
168 |
+ iLastScan-=(m-n); |
|
169 |
+ } |
|
170 |
+ } |
|
220 | 171 |
} |
221 |
- break; |
|
222 |
- |
|
223 |
- // HENRY -- add the instrument info reading functionality (present in RAMP, but not provided in cRAMP before) |
|
224 |
- case RAMP_INSTRUMENT: |
|
225 |
- // std::cerr << "in: rampInstrumentInfo(m_handle)\n" ; |
|
226 |
- returnPtr = new rampInstrumentInfo(m_handle); |
|
227 |
- //std::cerr << "out: rampInstrumentInfo(m_handle)\n" ; |
|
228 |
- if (((rampInstrumentInfo*)returnPtr)->m_instrumentStructPtr == NULL) { |
|
229 |
- delete ((rampInstrumentInfo*)returnPtr); |
|
230 |
- returnPtr = NULL; |
|
172 |
+ } |
|
173 |
+ // HENRY - store last scan explicitly. |
|
174 |
+ m_lastScan = iLastScan; |
|
175 |
+ // END HENRY |
|
176 |
+ } |
|
177 |
+ |
|
178 |
+ |
|
179 |
+ // HENRY -- arg is out of bounds. instead of creating havoc in RAMP, let's just kill it here. |
|
180 |
+ if (RAMP_RUNINFO != what && (RAMP_INSTRUMENT != what) && (arg > m_runInfo->m_data.scanCount || arg < 1)) |
|
181 |
+ { |
|
182 |
+ return (NULL); |
|
183 |
+ } |
|
184 |
+ |
|
185 |
+ if (m_scanOffsets || (RAMP_RUNINFO == what) || (RAMP_INSTRUMENT == what)) |
|
186 |
+ { |
|
187 |
+ ramp_fileoffset_t scanOffset=-1; |
|
188 |
+ if (RAMP_RUNINFO == what || RAMP_INSTRUMENT == what) |
|
189 |
+ { |
|
190 |
+ scanOffset = 0; // read from head of file |
|
191 |
+ } |
|
192 |
+ else |
|
193 |
+ { |
|
194 |
+ scanOffset = m_scanOffsets[arg]; // ramp is one-based |
|
195 |
+ } |
|
196 |
+ |
|
197 |
+ if (scanOffset >= 0) |
|
198 |
+ { |
|
199 |
+ |
|
200 |
+ // ----------------------------------------------------------------------- |
|
201 |
+ // And now we can parse the info we were looking for |
|
202 |
+ // ----------------------------------------------------------------------- |
|
203 |
+ |
|
204 |
+ |
|
205 |
+ // Ok now we have to copy everything in our structure |
|
206 |
+ switch( what ) |
|
207 |
+ { |
|
208 |
+ case RAMP_RUNINFO: |
|
209 |
+ // std::cerr << "in: rampRunInfo( m_handle )\n"; |
|
210 |
+ returnPtr = new rampRunInfo( m_handle ); |
|
211 |
+ // std::cerr << "out: rampRunInfo( m_handle )\n"; |
|
212 |
+ break; |
|
213 |
+ case RAMP_HEADER: |
|
214 |
+ // std::cerr << "in: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
215 |
+ returnPtr = new rampScanInfo( m_handle, scanOffset, (int)arg ); |
|
216 |
+ //std::cerr << "out: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
217 |
+ if (returnPtr) |
|
218 |
+ { |
|
219 |
+#ifdef HAVE_PWIZ_MZML_LIB |
|
220 |
+ if (!m_handle->mzML) // rampadapter already set this for us |
|
221 |
+#endif |
|
222 |
+ ((rampScanInfo *)returnPtr)->m_data.filePosition = scanOffset; // for future reference |
|
223 |
+ |
|
224 |
+ // HENRY -- error checking here |
|
225 |
+ if (((rampScanInfo*)returnPtr)->m_data.acquisitionNum < 0) |
|
226 |
+ { |
|
227 |
+ // something failed in RAMP, possibly because it's a missing scan |
|
228 |
+ delete ((rampScanInfo*)returnPtr); |
|
229 |
+ returnPtr = NULL; |
|
230 |
+ } |
|
231 |
+ } |
|
232 |
+ break; |
|
233 |
+ case RAMP_PEAKS: |
|
234 |
+ returnPtr = new rampPeakList( m_handle, scanOffset); |
|
235 |
+ |
|
236 |
+ // HENRY -- error checking here |
|
237 |
+ if (returnPtr && ((rampPeakList*)returnPtr)->getPeakCount() <= 0) |
|
238 |
+ { |
|
239 |
+ // something failed in RAMP, possibly because it's a missing scan |
|
240 |
+ delete ((rampPeakList*)returnPtr); |
|
241 |
+ returnPtr = NULL; |
|
242 |
+ } |
|
243 |
+ break; |
|
244 |
+ |
|
245 |
+ // HENRY -- add the instrument info reading functionality (present in RAMP, but not provided in cRAMP before) |
|
246 |
+ case RAMP_INSTRUMENT: |
|
247 |
+ // std::cerr << "in: rampInstrumentInfo(m_handle)\n" ; |
|
248 |
+ returnPtr = new rampInstrumentInfo(m_handle); |
|
249 |
+ //std::cerr << "out: rampInstrumentInfo(m_handle)\n" ; |
|
250 |
+ if (((rampInstrumentInfo*)returnPtr)->m_instrumentStructPtr == NULL) |
|
251 |
+ { |
|
252 |
+ delete ((rampInstrumentInfo*)returnPtr); |
|
253 |
+ returnPtr = NULL; |
|
254 |
+ } |
|
255 |
+ break; |
|
231 | 256 |
} |
232 |
- break; |
|
233 |
- } |
|
234 |
- |
|
235 |
- } |
|
236 |
- } |
|
237 |
- |
|
238 |
- |
|
239 |
- |
|
240 |
- return returnPtr; |
|
257 |
+ |
|
258 |
+ } |
|
259 |
+ } |
|
260 |
+ |
|
261 |
+ |
|
262 |
+ |
|
263 |
+ return returnPtr; |
|
241 | 264 |
} |
242 | 265 |
|
243 | 266 |
|
244 | 267 |
/** |
245 | 268 |
* This function performs a non-sequential parsing operation on an indexed |
246 |
- * msxml file to obtain minimal info on the msRun contained in the file. |
|
269 |
+ * msxml file to obtain minimal info on the msRun contained in the file. |
|
247 | 270 |
|
248 | 271 |
* |
249 | 272 |
* @return rapRunInfo* is dynamically allocate and becomes property of the caller, who |
250 | 273 |
* is responsible for its deallocation!! |
251 | 274 |
*/ |
252 | 275 |
|
253 |
-rampRunInfo* cRamp::getRunInfo ( ) { |
|
254 |
- rampRunInfo* result; |
|
255 |
- if (m_runInfo) { // did we derive this already? |
|
256 |
- result = new rampRunInfo(*m_runInfo); |
|
257 |
- } else { |
|
258 |
- result = (rampRunInfo*) do_ramp(0, RAMP_RUNINFO); |
|
259 |
- } |
|
260 |
- return result; |
|
276 |
+rampRunInfo* cRamp::getRunInfo ( ) |
|
277 |
+{ |
|
278 |
+ rampRunInfo* result; |
|
279 |
+ if (m_runInfo) // did we derive this already? |
|
280 |
+ { |
|
281 |
+ result = new rampRunInfo(*m_runInfo); |
|
282 |
+ } |
|
283 |
+ else |
|
284 |
+ { |
|
285 |
+ result = (rampRunInfo*) do_ramp(0, RAMP_RUNINFO); |
|
286 |
+ } |
|
287 |
+ return result; |
|
261 | 288 |
} |
262 | 289 |
|
263 | 290 |
/** |
264 | 291 |
* This function performs a non-sequential parsing operation on an indexed |
265 |
- * msxml file to obtain minimal header info for a numbered scan (thus minimizing parse time). |
|
292 |
+ * msxml file to obtain minimal header info for a numbered scan (thus minimizing parse time). |
|
266 | 293 |
* |
267 | 294 |
* @param fileName: Name of the msxml file |
268 | 295 |
* @param startSCan: Number of the scan we want to read from |
... | ... |
@@ -270,8 +297,9 @@ rampRunInfo* cRamp::getRunInfo ( ) { |
270 | 297 |
* is responsible for its deallocation!! returns just the minimal header info num, msLevel and retentionTime |
271 | 298 |
*/ |
272 | 299 |
|
273 |
-rampScanInfo* cRamp::getScanHeaderInfo ( int whichScan ) { |
|
274 |
- return (rampScanInfo*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_HEADER); |
|
300 |
+rampScanInfo* cRamp::getScanHeaderInfo ( int whichScan ) |
|
301 |
+{ |
|
302 |
+ return (rampScanInfo*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_HEADER); |
|
275 | 303 |
} |
276 | 304 |
|
277 | 305 |
|
... | ... |
@@ -285,79 +313,90 @@ rampScanInfo* cRamp::getScanHeaderInfo ( int whichScan ) { |
285 | 313 |
* is responsible for its deallocation!! returns everything found in scan, precursorMz and peaks |
286 | 314 |
*/ |
287 | 315 |
|
288 |
-rampPeakList* cRamp::getPeakList ( int whichScan ) { |
|
289 |
- return (rampPeakList*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_PEAKS); |
|
316 |
+rampPeakList* cRamp::getPeakList ( int whichScan ) |
|
317 |
+{ |
|
318 |
+ return (rampPeakList*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_PEAKS); |
|
290 | 319 |
} |
291 | 320 |
|
292 | 321 |
// HENRY - provides instrument info getting method |
293 |
-rampInstrumentInfo* cRamp::getInstrumentInfo () { |
|
294 |
- return (rampInstrumentInfo*) do_ramp(0, RAMP_INSTRUMENT); |
|
322 |
+rampInstrumentInfo* cRamp::getInstrumentInfo () |
|
323 |
+{ |
|
324 |
+ return (rampInstrumentInfo*) do_ramp(0, RAMP_INSTRUMENT); |
|
295 | 325 |
} |
296 | 326 |
// END HENRY |
297 | 327 |
|
298 | 328 |
|
299 | 329 |
// HENRY - sequential access parser that skips over missing scans. This version only reads scan header. |
300 |
-bool cRampIterator::nextScan(rampScanInfo** scanInfo) { |
|
301 |
- while (++m_currentScan <= m_cramp.getLastScan() && m_cramp.getScanOffset(m_currentScan) <= 0); |
|
302 |
- if (m_currentScan > m_cramp.getLastScan()) { |
|
303 |
- return (false); |
|
304 |
- } |
|
305 |
- |
|
306 |
- *scanInfo = (rampScanInfo*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_HEADER); |
|
307 |
- return (true); |
|
330 |
+bool cRampIterator::nextScan(rampScanInfo** scanInfo) |
|
331 |
+{ |
|
332 |
+ while (++m_currentScan <= m_cramp.getLastScan() && m_cramp.getScanOffset(m_currentScan) <= 0); |
|
333 |
+ if (m_currentScan > m_cramp.getLastScan()) |
|
334 |
+ { |
|
335 |
+ return (false); |
|
336 |
+ } |
|
337 |
+ |
|
338 |
+ *scanInfo = (rampScanInfo*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_HEADER); |
|
339 |
+ return (true); |
|
308 | 340 |
} |
309 | 341 |
// END HENRY |
310 | 342 |
|
311 | 343 |
// HENRY - sequential access parser that skips over missing scans. This version reads both scan header and peak list. |
312 |
-bool cRampIterator::nextScan(rampScanInfo** scanInfo, rampPeakList** peakList) { |
|
313 |
- while (++m_currentScan <= m_cramp.getLastScan() && m_cramp.getScanOffset(m_currentScan) <= 0); |
|
314 |
- if (m_currentScan > m_cramp.getLastScan()) { |
|
315 |
- return (false); |
|
316 |
- } |
|
317 |
- |
|
318 |
- *scanInfo = (rampScanInfo*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_HEADER); |
|
319 |
- *peakList = (rampPeakList*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_PEAKS); |
|
344 |
+bool cRampIterator::nextScan(rampScanInfo** scanInfo, rampPeakList** peakList) |
|
345 |
+{ |
|
346 |
+ while (++m_currentScan <= m_cramp.getLastScan() && m_cramp.getScanOffset(m_currentScan) <= 0); |
|
347 |
+ if (m_currentScan > m_cramp.getLastScan()) |
|
348 |
+ { |
|
349 |
+ return (false); |
|
350 |
+ } |
|
351 |
+ |
|
352 |
+ *scanInfo = (rampScanInfo*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_HEADER); |
|
353 |
+ *peakList = (rampPeakList*)m_cramp.do_ramp((ramp_fileoffset_t)(m_currentScan), RAMP_PEAKS); |
|
320 | 354 |
|
321 |
- return (true); |
|
355 |
+ return (true); |
|
322 | 356 |
|
323 | 357 |
} |
324 | 358 |
// END HENRY |
325 | 359 |
|
326 | 360 |
// HENRY - resets the sequential access parser to the first scan. |
327 |
-void cRampIterator::reset() { |
|
328 |
- m_currentScan = 1; |
|
361 |
+void cRampIterator::reset() |
|
362 |
+{ |
|
363 |
+ m_currentScan = 1; |
|
329 | 364 |
} |
330 | 365 |
// END HENRY |
331 | 366 |
|
332 | 367 |
/** |
333 | 368 |
* populate from a file handle |
334 | 369 |
**/ |
335 |
-rampPeakList::rampPeakList(RAMPFILE *handle, ramp_fileoffset_t index) { |
|
336 |
- init(); |
|
337 |
- m_peaksCount = readPeaksCount(handle,index); |
|
338 |
- m_pPeaks = (rampPeakInfoStruct *)readPeaks(handle,index); |
|
370 |
+rampPeakList::rampPeakList(RAMPFILE *handle, ramp_fileoffset_t index) |
|
371 |
+{ |
|
372 |
+ init(); |
|
373 |
+ m_peaksCount = readPeaksCount(handle,index); |
|
374 |
+ m_pPeaks = (rampPeakInfoStruct *)readPeaks(handle,index); |
|
339 | 375 |
} |
340 | 376 |
|
341 | 377 |
/** |
342 | 378 |
* populate from a file handle |
343 | 379 |
**/ |
344 |
-rampScanInfo::rampScanInfo(RAMPFILE *handle, ramp_fileoffset_t index, int seqNum) { |
|
345 |
- init(); |
|
346 |
- readHeader(handle,index,&m_data); |
|
347 |
- m_data.seqNum = seqNum; |
|
380 |
+rampScanInfo::rampScanInfo(RAMPFILE *handle, ramp_fileoffset_t index, int seqNum) |
|
381 |
+{ |
|
382 |
+ init(); |
|
383 |
+ readHeader(handle,index,&m_data); |
|
384 |
+ m_data.seqNum = seqNum; |
|
348 | 385 |
} |
349 | 386 |
|
350 | 387 |
/** |
351 | 388 |
* populate from a file handle |
352 | 389 |
**/ |
353 |
-rampRunInfo::rampRunInfo(RAMPFILE *handle) { |
|
354 |
- init(); |
|
355 |
- readMSRun(handle,&m_data); |
|
390 |
+rampRunInfo::rampRunInfo(RAMPFILE *handle) |
|
391 |
+{ |
|
392 |
+ init(); |
|
393 |
+ readMSRun(handle,&m_data); |
|
356 | 394 |
} |
357 | 395 |
|
358 | 396 |
// HENRY - provides instrument info reading functionality |
359 |
-rampInstrumentInfo::rampInstrumentInfo(RAMPFILE *handle) { |
|
360 |
- init(); |
|
361 |
- m_instrumentStructPtr = getInstrumentStruct(handle); |
|
397 |
+rampInstrumentInfo::rampInstrumentInfo(RAMPFILE *handle) |
|
398 |
+{ |
|
399 |
+ init(); |
|
400 |
+ m_instrumentStructPtr = getInstrumentStruct(handle); |
|
362 | 401 |
} |
363 | 402 |
// END HENRY |
Commit information:
Commit id: 967ff13a84539345f77c75211d0c204a3f3d0edc
Commit message: good job everybody
Committed by: Laurent
Author Name: Laurent
Commit date: 2014-06-22 06:54:49 +0100
Author date: 2014-06-22 06:54:49 +0100
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@91685 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
/*************************************************************************** |
2 | 2 |
cramp.cpp |
3 | 3 |
|
4 |
-/*************************************************************************** |
|
4 |
+*************************************************************************** |
|
5 | 5 |
cramp.hpp -- renamed cramp.h to avoid R checker warning |
6 | 6 |
|
7 | 7 |
A C++ wrapper for the RAMP code. |
... | ... |
@@ -28,7 +28,16 @@ cramp.hpp -- renamed cramp.h to avoid R checker warning |
28 | 28 |
* * |
29 | 29 |
***************************************************************************/ |
30 | 30 |
|
31 |
+#include<Rcpp.h> |
|
31 | 32 |
|
33 |
+// Taken from http://tolstoy.newcastle.edu.au/R/e2/devel/06/11/1242.html |
|
34 |
+// and http://stackoverflow.com/questions/11588765/using-rcpp-with-windows-specific-includes |
|
35 |
+// Undefine the Realloc macro, which is defined by both R and by Windows stuff |
|
36 |
+// Also need to undefine the Free macro |
|
37 |
+#if defined(__MINGW32__) |
|
38 |
+#undef Realloc |
|
39 |
+#undef Free |
|
40 |
+#endif |
|
32 | 41 |
|
33 | 42 |
#include <stdlib.h> |
34 | 43 |
#include <iostream> |
... | ... |
@@ -40,6 +49,10 @@ cramp.hpp -- renamed cramp.h to avoid R checker warning |
40 | 49 |
#include "cramp.h" |
41 | 50 |
#include<R.h> |
42 | 51 |
|
52 |
+#if defined(__MINGW32__) |
|
53 |
+#include <windows.h> |
|
54 |
+#endif |
|
55 |
+ |
|
43 | 56 |
/** |
44 | 57 |
* This function performs a non-sequential parsing operation on an indexed |
45 | 58 |
* msxml file. |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@71124 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -38,7 +38,7 @@ cramp.hpp -- renamed cramp.h to avoid R checker warning |
38 | 38 |
#include "sys/errno.h" |
39 | 39 |
#endif |
40 | 40 |
#include "cramp.h" |
41 |
- |
|
41 |
+#include<R.h> |
|
42 | 42 |
|
43 | 43 |
/** |
44 | 44 |
* This function performs a non-sequential parsing operation on an indexed |
... | ... |
@@ -107,7 +107,7 @@ rampInfo* cRamp::do_ramp( ramp_fileoffset_t arg , eWhatToRead what ) |
107 | 107 |
case RAMP_INSTRUMENT: |
108 | 108 |
break; // OK |
109 | 109 |
default: |
110 |
- std::cerr << "unknown read type!\n"; |
|
110 |
+ Rf_error("unknown read type!\n"); |
|
111 | 111 |
return NULL; |
112 | 112 |
break; |
113 | 113 |
} |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@63259 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -117,12 +117,19 @@ rampInfo* cRamp::do_ramp( ramp_fileoffset_t arg , eWhatToRead what ) |
117 | 117 |
if ((RAMP_RUNINFO != what) && (RAMP_INSTRUMENT != what) && !m_scanOffsets) { |
118 | 118 |
int iLastScan = 0; |
119 | 119 |
// we need the index to get anything besides the header |
120 |
+ // std::cerr << "in: getIndexOffset(m_handle);!\n"; |
|
120 | 121 |
ramp_fileoffset_t indexOffset = getIndexOffset(m_handle); |
122 |
+ // std::cerr << "out: getIndexOffset(m_handle);!\n"; |
|
123 |
+ |
|
124 |
+ // std::cerr << "in: readIndex();!\n"; |
|
121 | 125 |
m_scanOffsets = readIndex(m_handle, indexOffset, &iLastScan); |
126 |
+ //std::cerr << "out: readIndex();!\n"; |
|
122 | 127 |
if (iLastScan >= m_runInfo->m_data.scanCount) { |
123 | 128 |
if (!m_declaredScansOnly) { |
124 | 129 |
m_runInfo->m_data.scanCount = iLastScan; |
125 | 130 |
} else { // get rid of all the fake entries created |
131 |
+ |
|
132 |
+ // std::cerr << "get rid of all the fake entries created\n"; |
|
126 | 133 |
for (int n=1;n<=iLastScan;n++) { // ramp is 1 based |
127 | 134 |
if (m_scanOffsets[n]==-1) { |
128 | 135 |
// find a run of fakes |
... | ... |
@@ -167,10 +174,14 @@ rampInfo* cRamp::do_ramp( ramp_fileoffset_t arg , eWhatToRead what ) |
167 | 174 |
switch( what ) |
168 | 175 |
{ |
169 | 176 |
case RAMP_RUNINFO: |
177 |
+ // std::cerr << "in: rampRunInfo( m_handle )\n"; |
|
170 | 178 |
returnPtr = new rampRunInfo( m_handle ); |
179 |
+ // std::cerr << "out: rampRunInfo( m_handle )\n"; |
|
171 | 180 |
break; |
172 | 181 |
case RAMP_HEADER: |
182 |
+ // std::cerr << "in: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
173 | 183 |
returnPtr = new rampScanInfo( m_handle, scanOffset, (int)arg ); |
184 |
+ //std::cerr << "out: rampScanInfo( m_handle, scanOffset, (int)arg )\n" ; |
|
174 | 185 |
if (returnPtr) { |
175 | 186 |
#ifdef HAVE_PWIZ_MZML_LIB |
176 | 187 |
if (!m_handle->mzML) // rampadapter already set this for us |
... | ... |
@@ -198,7 +209,9 @@ rampInfo* cRamp::do_ramp( ramp_fileoffset_t arg , eWhatToRead what ) |
198 | 209 |
|
199 | 210 |
// HENRY -- add the instrument info reading functionality (present in RAMP, but not provided in cRAMP before) |
200 | 211 |
case RAMP_INSTRUMENT: |
212 |
+ // std::cerr << "in: rampInstrumentInfo(m_handle)\n" ; |
|
201 | 213 |
returnPtr = new rampInstrumentInfo(m_handle); |
214 |
+ //std::cerr << "out: rampInstrumentInfo(m_handle)\n" ; |
|
202 | 215 |
if (((rampInstrumentInfo*)returnPtr)->m_instrumentStructPtr == NULL) { |
203 | 216 |
delete ((rampInstrumentInfo*)returnPtr); |
204 | 217 |
returnPtr = NULL; |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@57456 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,337 @@ |
1 |
+/*************************************************************************** |
|
2 |
+cramp.cpp |
|
3 |
+ |
|
4 |
+/*************************************************************************** |
|
5 |
+cramp.hpp -- renamed cramp.h to avoid R checker warning |
|
6 |
+ |
|
7 |
+ A C++ wrapper for the RAMP code. |
|
8 |
+ |
|
9 |
+ Use this library to parse an mzXML file in a non-sequential way, by |
|
10 |
+ taking advantage of the index element. |
|
11 |
+ |
|
12 |
+ (C) 2004 by Brian Pratt, Insilicos LLC |
|
13 |
+ |
|
14 |
+ Based on mzXML2Other, which has this copyright: |
|
15 |
+ ------------------- |
|
16 |
+ begin : Wed Apr 2 |
|
17 |
+ copyright : (C) 2002 by Pedrioli Patrick, ISB, Proteomics |
|
18 |
+ email : ppatrick@student.ethz.ch |
|
19 |
+ ***************************************************************************/ |
|
20 |
+ |
|
21 |
+/*************************************************************************** |
|
22 |
+* * |
|
23 |
+* This program is free software; you can redistribute it and/or modify * |
|
24 |
+* it under the terms of the GNU Library or "Lesser" General Public * |
|
25 |
+* License (LGPL) as published by the Free Software Foundation; * |
|
26 |
+* either version 2 of the License, or (at your option) any later * |
|
27 |
+* version. * |
|
28 |
+* * |
|
29 |
+***************************************************************************/ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+ |
|
33 |
+#include <stdlib.h> |
|
34 |
+#include <iostream> |
|
35 |
+#include <fstream> |
|
36 |
+#include "stdio.h" |
|
37 |
+#if !defined(_MSC_VER) && !defined(__MINGW32__) |
|
38 |
+#include "sys/errno.h" |
|
39 |
+#endif |
|
40 |
+#include "cramp.h" |
|
41 |
+ |
|
42 |
+ |
|
43 |
+/** |
|
44 |
+ * This function performs a non-sequential parsing operation on an indexed |
|
45 |
+ * msxml file. |
|
46 |
+ * |
|
47 |
+ * @param fileName: Name of the msxml file |
|
48 |
+ * @param startSCan: Number of the scan we want to read from |
|
49 |
+ * @param what: -HEADER will return num, msLevel and retentionTime |
|
50 |
+ * -SCAN will return only the peaks |
|
51 |
+ * -ALL will return everything found in scan, precursorMz and peaks |
|
52 |
+ * |
|
53 |
+ * @return pData is dynamically allocate and becomes property of the caller, who |
|
54 |
+ * is responsible for its deallocation!! |
|
55 |
+ */ |
|
56 |
+ |
|
57 |
+ |
|
58 |
+ |
|
59 |
+cRamp::cRamp( const char* fileName,bool declaredScansOnly ) : |
|
60 |
+ m_filename(fileName), m_declaredScansOnly(declaredScansOnly), m_runInfo() |
|
61 |
+{ |
|
62 |
+ m_handle = rampOpenFile(fileName); |
|
63 |
+ m_scanOffsets = NULL; |
|
64 |
+ m_runInfo = NULL; |
|
65 |
+ m_lastScan = 0; |
|
66 |
+ if (!OK()) { |
|
67 |
+ // HENRY -- I would prefer this to be silent, and let the caller deals with it |
|
68 |
+ // cout << "Error: Could not open file " << fileName << ": " << strerror(errno) << endl; |
|
69 |
+ // END HENRY |
|
70 |
+ } else { |
|
71 |
+ |
|
72 |
+ m_runInfo = getRunInfo(); |
|
73 |
+ |
|
74 |
+ // HENRY -- always read index to set scan count, since scan count |
|
75 |
+ // declared at the top of the mzXML file is unreliable now that |
|
76 |
+ // there are missing scans. |
|
77 |
+ // This will also set the structs m_scanOffsets, and the value m_lastScan |
|
78 |
+ |
|
79 |
+ // if (m_runInfo->m_data.scanCount < 0) { // undeclared scan count |
|
80 |
+ // this will provoke reading of index, which sets scan count |
|
81 |
+ rampScanInfo* tmp = getScanHeaderInfo ( 1 ); |
|
82 |
+ free(tmp); |
|
83 |
+ // } |
|
84 |
+ // END HENRY |
|
85 |
+ } |
|
86 |
+} |
|
87 |
+ |
|
88 |
+cRamp::~cRamp() { |
|
89 |
+ rampCloseFile(m_handle); |
|
90 |
+ |
|
91 |
+ // NB: these pointers may be null on file open failure, |
|
92 |
+ // but free/delete of NULL is OK per C++ standard |
|
93 |
+ free(m_scanOffsets); |
|
94 |
+ delete m_runInfo; // was free() - but allocated with new |
|
95 |
+} |
|
96 |
+ |
|
97 |
+// |
|
98 |
+// here are the private guts |
|
99 |
+// |
|
100 |
+rampInfo* cRamp::do_ramp( ramp_fileoffset_t arg , eWhatToRead what ) |
|
101 |
+{ |
|
102 |
+ |
|
103 |
+ switch( what ) { |
|
104 |
+ case RAMP_RUNINFO: |
|
105 |
+ case RAMP_HEADER: |
|
106 |
+ case RAMP_PEAKS: |
|
107 |
+ case RAMP_INSTRUMENT: |
|
108 |
+ break; // OK |
|
109 |
+ default: |
|
110 |
+ std::cerr << "unknown read type!\n"; |
|
111 |
+ return NULL; |
|
112 |
+ break; |
|
113 |
+ } |
|
114 |
+ |
|
115 |
+ rampInfo* returnPtr=NULL; |
|
116 |
+ |
|
117 |
+ if ((RAMP_RUNINFO != what) && (RAMP_INSTRUMENT != what) && !m_scanOffsets) { |
|
118 |
+ int iLastScan = 0; |
|
119 |
+ // we need the index to get anything besides the header |
|
120 |
+ ramp_fileoffset_t indexOffset = getIndexOffset(m_handle); |
|
121 |
+ m_scanOffsets = readIndex(m_handle, indexOffset, &iLastScan); |
|
122 |
+ if (iLastScan >= m_runInfo->m_data.scanCount) { |
|
123 |
+ if (!m_declaredScansOnly) { |
|
124 |
+ m_runInfo->m_data.scanCount = iLastScan; |
|
125 |
+ } else { // get rid of all the fake entries created |
|
126 |
+ for (int n=1;n<=iLastScan;n++) { // ramp is 1 based |
|
127 |
+ if (m_scanOffsets[n]==-1) { |
|
128 |
+ // find a run of fakes |
|
129 |
+ int m; |
|
130 |
+ for (m=n+1;(m<=iLastScan)&&(m_scanOffsets[m]==-1);m++); |
|
131 |
+ if (m<=iLastScan) { |
|
132 |
+ memmove(m_scanOffsets+n,m_scanOffsets+m, |
|
133 |
+ sizeof(ramp_fileoffset_t)*((iLastScan-m)+1)); |
|
134 |
+ } |
|
135 |
+ iLastScan-=(m-n); |
|
136 |
+ } |
|
137 |
+ } |
|
138 |
+ } |
|
139 |
+ } |
|
140 |
+ // HENRY - store last scan explicitly. |
|
141 |
+ m_lastScan = iLastScan; |
|
142 |
+ // END HENRY |
|
143 |
+ } |
|
144 |
+ |
|
145 |
+ |
|
146 |
+ // HENRY -- arg is out of bounds. instead of creating havoc in RAMP, let's just kill it here. |
|
147 |
+ if (RAMP_RUNINFO != what && (RAMP_INSTRUMENT != what) && (arg > m_runInfo->m_data.scanCount || arg < 1)) { |
|
148 |
+ return (NULL); |
|
149 |
+ } |
|
150 |
+ |
|
151 |
+ if (m_scanOffsets || (RAMP_RUNINFO == what) || (RAMP_INSTRUMENT == what)) { |
|
152 |
+ ramp_fileoffset_t scanOffset=-1; |
|
153 |
+ if (RAMP_RUNINFO == what || RAMP_INSTRUMENT == what) { |
|
154 |
+ scanOffset = 0; // read from head of file |
|
155 |
+ } else { |
|
156 |
+ scanOffset = m_scanOffsets[arg]; // ramp is one-based |
|
157 |
+ } |
|
158 |
+ |
|
159 |
+ if (scanOffset >= 0) { |
|
160 |
+ |
|
161 |
+ // ----------------------------------------------------------------------- |
|
162 |
+ // And now we can parse the info we were looking for |
|
163 |
+ // ----------------------------------------------------------------------- |
|
164 |
+ |
|
165 |
+ |
|
166 |
+ // Ok now we have to copy everything in our structure |
|
167 |
+ switch( what ) |
|
168 |
+ { |
|
169 |
+ case RAMP_RUNINFO: |
|
170 |
+ returnPtr = new rampRunInfo( m_handle ); |
|
171 |
+ break; |
|
172 |
+ case RAMP_HEADER: |
|
173 |
+ returnPtr = new rampScanInfo( m_handle, scanOffset, (int)arg ); |
|
174 |
+ if (returnPtr) { |
|
175 |
+#ifdef HAVE_PWIZ_MZML_LIB |
|
176 |
+ if (!m_handle->mzML) // rampadapter already set this for us |
|
177 |
+#endif |
|
178 |
+ ((rampScanInfo *)returnPtr)->m_data.filePosition = scanOffset; // for future reference |
|
179 |
+ |
|
180 |
+ // HENRY -- error checking here |
|
181 |
+ if (((rampScanInfo*)returnPtr)->m_data.acquisitionNum < 0) { |
|
182 |
+ // something failed in RAMP, possibly because it's a missing scan |
|
183 |
+ delete ((rampScanInfo*)returnPtr); |
|
184 |
+ returnPtr = NULL; |
|
185 |
+ } |
|
186 |
+ } |
|
187 |
+ break; |
|
188 |
+ case RAMP_PEAKS: |
|
189 |
+ returnPtr = new rampPeakList( m_handle, scanOffset); |
|
190 |
+ |
|
191 |
+ // HENRY -- error checking here |
|
192 |
+ if (returnPtr && ((rampPeakList*)returnPtr)->getPeakCount() <= 0) { |
|
193 |
+ // something failed in RAMP, possibly because it's a missing scan |
|
194 |
+ delete ((rampPeakList*)returnPtr); |
|
195 |
+ returnPtr = NULL; |
|
196 |
+ } |
|
197 |
+ break; |
|
198 |
+ |
|
199 |
+ // HENRY -- add the instrument info reading functionality (present in RAMP, but not provided in cRAMP before) |
|
200 |
+ case RAMP_INSTRUMENT: |
|
201 |
+ returnPtr = new rampInstrumentInfo(m_handle); |
|
202 |
+ if (((rampInstrumentInfo*)returnPtr)->m_instrumentStructPtr == NULL) { |
|
203 |
+ delete ((rampInstrumentInfo*)returnPtr); |
|
204 |
+ returnPtr = NULL; |
|
205 |
+ } |
|
206 |
+ break; |
|
207 |
+ } |
|
208 |
+ |
|
209 |
+ } |
|
210 |
+ } |
|
211 |
+ |
|
212 |
+ |
|
213 |
+ |
|
214 |
+ return returnPtr; |
|
215 |
+} |
|
216 |
+ |
|
217 |
+ |
|
218 |
+/** |
|
219 |
+ * This function performs a non-sequential parsing operation on an indexed |
|
220 |
+ * msxml file to obtain minimal info on the msRun contained in the file. |
|
221 |
+ |
|
222 |
+ * |
|
223 |
+ * @return rapRunInfo* is dynamically allocate and becomes property of the caller, who |
|
224 |
+ * is responsible for its deallocation!! |
|
225 |
+ */ |
|
226 |
+ |
|
227 |
+rampRunInfo* cRamp::getRunInfo ( ) { |
|
228 |
+ rampRunInfo* result; |
|
229 |
+ if (m_runInfo) { // did we derive this already? |
|
230 |
+ result = new rampRunInfo(*m_runInfo); |
|
231 |
+ } else { |
|
232 |
+ result = (rampRunInfo*) do_ramp(0, RAMP_RUNINFO); |
|
233 |
+ } |
|
234 |
+ return result; |
|
235 |
+} |
|
236 |
+ |
|
237 |
+/** |
|
238 |
+ * This function performs a non-sequential parsing operation on an indexed |
|
239 |
+ * msxml file to obtain minimal header info for a numbered scan (thus minimizing parse time). |
|
240 |
+ * |
|
241 |
+ * @param fileName: Name of the msxml file |
|
242 |
+ * @param startSCan: Number of the scan we want to read from |
|
243 |
+ * @return rapHeaderInfo* is dynamically allocate and becomes property of the caller, who |
|
244 |
+ * is responsible for its deallocation!! returns just the minimal header info num, msLevel and retentionTime |
|
245 |
+ */ |
|
246 |
+ |
|
247 |
+rampScanInfo* cRamp::getScanHeaderInfo ( int whichScan ) { |
|
248 |
+ return (rampScanInfo*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_HEADER); |
|
249 |
+} |
|
250 |
+ |
|
251 |
+ |
|
252 |
+/** |
|
253 |
+ * This function performs a non-sequential parsing operation on an indexed |
|
254 |
+ * msxml file to obtain peak info for a numbered scan. |
|
255 |
+ * |
|
256 |
+ * @param fileName: Name of the msxml file |
|
257 |
+ * @param startSCan: Number of the scan we want to read from |
|
258 |
+ * @return rapPeakList* is dynamically allocate and becomes property of the caller, who |
|
259 |
+ * is responsible for its deallocation!! returns everything found in scan, precursorMz and peaks |
|
260 |
+ */ |
|
261 |
+ |
|
262 |
+rampPeakList* cRamp::getPeakList ( int whichScan ) { |
|
263 |
+ return (rampPeakList*) do_ramp((ramp_fileoffset_t)whichScan, RAMP_PEAKS); |
|
264 |
+} |
|
265 |
+ |
|
266 |
+// HENRY - provides instrument info getting method |
|
267 |
+rampInstrumentInfo* cRamp::getInstrumentInfo () { |
|
268 |
+ return (rampInstrumentInfo*) do_ramp(0, RAMP_INSTRUMENT); |
|
269 |
+} |
|
270 |
+// END HENRY |
|
271 |
+ |
|
272 |
+ |
|
273 |
+// HENRY - sequential access parser that skips over missing scans. This version only reads scan header. |
|
274 |
+bool cRampIterator::nextScan(rampScanInfo** scanInfo) { |
|
275 |
+ while (++m_currentScan <= m_cramp.getLastScan() && m_cramp.getScanOffset(m_currentScan) <= 0); |
|
276 |
+ if (m_currentScan > m_cramp.getLastScan()) { |
|
277 |
+ return (false); |
|
278 |
+ } |
|