ProteoWizard
Classes | Macros | Typedefs | Enumerations | Functions
ramp.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <netinet/in.h>
#include <sys/stat.h>
#include "ramp_base64.h"
#include <string.h>
#include <string>
#include <ctype.h>

Go to the source code of this file.

Classes

struct  RAMPFILE
struct  ScanHeaderStruct
struct  RunHeaderStruct
struct  InstrumentStruct
struct  ScanCacheStruct

Macros

#define ramp_fread(buf, len, handle)   fread(buf,1,len,(handle)->fileHandle)
#define ramp_fgets(buf, len, handle)   fgets(buf, len, (handle)->fileHandle)
#define ramp_feof(handle)   feof((handle)->fileHandle)
#define ramp_fseek(a, b, c)   fseeko((a)->fileHandle,b,c)
#define ramp_ftell(a)   ftello((a)->fileHandle)
#define INSTRUMENT_LENGTH   2000
#define SCANTYPE_LENGTH   32
#define CHARGEARRAY_LENGTH   128

Typedefs

typedef FILE * ramp_filehandle_t
typedef double RAMPREAL
typedef off_t ramp_fileoffset_t
typedef struct InstrumentStruct InstrumentStruct

Enumerations

enum  e_contentType { mzInt = 0, mzRuler, mzOnly, intensityOnly }
enum  {
  MASK_SCANS_TYPE = 0x0003, BIT_ORIGIN_SCANS = 0x0001, BIT_AVERAGE_SCANS = 0x0002, OPTION_AVERAGE_SCANS = BIT_AVERAGE_SCANS,
  OPTION_ORIGIN_SCANS = BIT_ORIGIN_SCANS, OPTION_ALL_SCANS = BIT_ORIGIN_SCANS | BIT_AVERAGE_SCANS, DEFAULT_OPTION = OPTION_AVERAGE_SCANS
}

Functions

RAMPFILErampOpenFile (const char *filename)
void rampCloseFile (RAMPFILE *pFI)
std::string rampConstructInputFileName (const std::string &basename)
char * rampConstructInputFileName (char *buf, int buflen, const char *basename)
char * rampConstructInputPath (char *buf, int inbuflen, const char *dir_in, const char *basename)
int rampValidateOrDeriveInputFilename (char *inbuf, int inbuflen, char *spectrumName)
char * rampTrimBaseName (char *buf)
char * rampValidFileType (const char *buf)
const char ** rampListSupportedFileTypes ()
int rampSelfTest (char *filename)
ramp_fileoffset_t getIndexOffset (RAMPFILE *pFI)
ramp_fileoffset_treadIndex (RAMPFILE *pFI, ramp_fileoffset_t indexOffset, int *iLastScan)
void readHeader (RAMPFILE *pFI, ramp_fileoffset_t lScanIndex, struct ScanHeaderStruct *scanHeader)
int readMsLevel (RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)
double readStartMz (RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)
double readEndMz (RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)
int readPeaksCount (RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)
RAMPREALreadPeaks (RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)
void readRunHeader (RAMPFILE *pFI, ramp_fileoffset_t *pScanIndex, struct RunHeaderStruct *runHeader, int iLastScan)
void readMSRun (RAMPFILE *pFI, struct RunHeaderStruct *runHeader)
InstrumentStructgetInstrumentStruct (RAMPFILE *pFI)
void setRampOption (long option)
int isScanAveraged (struct ScanHeaderStruct *scanHeader)
int isScanMergedResult (struct ScanHeaderStruct *scanHeader)
void getScanSpanRange (const struct ScanHeaderStruct *scanHeader, int *startScanNum, int *endScanNum)
struct ScanCacheStructgetScanCache (int size)
void freeScanCache (struct ScanCacheStruct *cache)
void clearScanCache (struct ScanCacheStruct *cache)
struct ScanHeaderStructreadHeaderCached (struct ScanCacheStruct *cache, int seqNum, RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)
int readMsLevelCached (struct ScanCacheStruct *cache, int seqNum, RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)
const RAMPREALreadPeaksCached (struct ScanCacheStruct *cache, int seqNum, RAMPFILE *pFI, ramp_fileoffset_t lScanIndex)

Macro Definition Documentation

#define ramp_fread (   buf,
  len,
  handle 
)    fread(buf,1,len,(handle)->fileHandle)

Definition at line 132 of file ramp.h.

#define ramp_fgets (   buf,
  len,
  handle 
)    fgets(buf, len, (handle)->fileHandle)

Definition at line 133 of file ramp.h.

#define ramp_feof (   handle)    feof((handle)->fileHandle)

Definition at line 134 of file ramp.h.

#define ramp_fseek (   a,
  b,
 
)    fseeko((a)->fileHandle,b,c)

Definition at line 141 of file ramp.h.

#define ramp_ftell (   a)    ftello((a)->fileHandle)

Definition at line 142 of file ramp.h.

#define INSTRUMENT_LENGTH   2000

Definition at line 152 of file ramp.h.

#define SCANTYPE_LENGTH   32

Definition at line 153 of file ramp.h.

#define CHARGEARRAY_LENGTH   128

Definition at line 154 of file ramp.h.


Typedef Documentation

typedef FILE* ramp_filehandle_t

Definition at line 79 of file ramp.h.

typedef double RAMPREAL

Definition at line 85 of file ramp.h.

typedef off_t ramp_fileoffset_t

Definition at line 140 of file ramp.h.


Enumeration Type Documentation

Enumerator:
mzInt 
mzRuler 
mzOnly 
intensityOnly 

Definition at line 91 of file ramp.h.

anonymous enum
Enumerator:
MASK_SCANS_TYPE 
BIT_ORIGIN_SCANS 
BIT_AVERAGE_SCANS 
OPTION_AVERAGE_SCANS 
OPTION_ORIGIN_SCANS 
OPTION_ALL_SCANS 
DEFAULT_OPTION 

Definition at line 270 of file ramp.h.

{
MASK_SCANS_TYPE = 0x0003,
BIT_ORIGIN_SCANS = 0x0001,
OPTION_AVERAGE_SCANS = BIT_AVERAGE_SCANS, // return scan including merged resultant scan
// but exclude 'real' scan via peaksCount=0
OPTION_ORIGIN_SCANS = BIT_ORIGIN_SCANS, // return 'real' scan
// but exclude merged resultant scan via peaksCount=0
// return 'real' scan + merged resultant scan
};

Function Documentation

RAMPFILE* rampOpenFile ( const char *  filename)
void rampCloseFile ( RAMPFILE pFI)
std::string rampConstructInputFileName ( const std::string &  basename)
char* rampConstructInputFileName ( char *  buf,
int  buflen,
const char *  basename 
)
char* rampConstructInputPath ( char *  buf,
int  inbuflen,
const char *  dir_in,
const char *  basename 
)
int rampValidateOrDeriveInputFilename ( char *  inbuf,
int  inbuflen,
char *  spectrumName 
)
char* rampTrimBaseName ( char *  buf)
char* rampValidFileType ( const char *  buf)
const char** rampListSupportedFileTypes ( )
int rampSelfTest ( char *  filename)
ramp_fileoffset_t getIndexOffset ( RAMPFILE pFI)
ramp_fileoffset_t* readIndex ( RAMPFILE pFI,
ramp_fileoffset_t  indexOffset,
int *  iLastScan 
)
void readHeader ( RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex,
struct ScanHeaderStruct scanHeader 
)
int readMsLevel ( RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)
double readStartMz ( RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)
double readEndMz ( RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)
int readPeaksCount ( RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)
RAMPREAL* readPeaks ( RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)
void readRunHeader ( RAMPFILE pFI,
ramp_fileoffset_t pScanIndex,
struct RunHeaderStruct runHeader,
int  iLastScan 
)
void readMSRun ( RAMPFILE pFI,
struct RunHeaderStruct runHeader 
)
InstrumentStruct* getInstrumentStruct ( RAMPFILE pFI)
void setRampOption ( long  option)
int isScanAveraged ( struct ScanHeaderStruct scanHeader)
int isScanMergedResult ( struct ScanHeaderStruct scanHeader)
void getScanSpanRange ( const struct ScanHeaderStruct scanHeader,
int *  startScanNum,
int *  endScanNum 
)
struct ScanCacheStruct* getScanCache ( int  size)
read
void freeScanCache ( struct ScanCacheStruct cache)
void clearScanCache ( struct ScanCacheStruct cache)
struct ScanHeaderStruct* readHeaderCached ( struct ScanCacheStruct cache,
int  seqNum,
RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)
read
int readMsLevelCached ( struct ScanCacheStruct cache,
int  seqNum,
RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)
const RAMPREAL* readPeaksCached ( struct ScanCacheStruct cache,
int  seqNum,
RAMPFILE pFI,
ramp_fileoffset_t  lScanIndex 
)