00001
#ifndef _ICPEP_TABLE_H_
00002
#define _ICPEP_TABLE_H_
00003
00004
#include "massspec/MS.rc.h"
00005
#include "proteome/proteome.h"
00006
#include "sequence/sequence.h"
00007
00008
typedef struct
00009
{
00010 IsotopicCluster ic;
00011 MassFilterResult mfr;
00012 MS2MatchResult mmr;
00013 } TableRow;
00014
00015
typedef struct
00016
{
00017
char* osp_format;
00018
int ab_column;
00019
int mz_column;
00020
int rt_column;
00021
char* mfr_format;
00022
int mfr_column;
00023
char* mmr_format;
00024
int mmr_column;
00025 } TableRowFormat;
00026
00027
typedef struct
00028
{
00029
int nRowIndex;
00030
int nDTAIndex;
00031
int nSeqChargeIndex;
00032 } TableIndices;
00033
00034
00035
typedef struct
00036
{
00037 DTAFile* pDTAFile;
00038 TableIndices indices;
00039
00040 } DTAFileToTableIndices;
00041
00042
typedef struct
00043
{
00044 SequestScoringPeptide* ssp;
00045 TableIndices indices;
00046
00047 } ScoringPeptideToTableIndices;
00048
00049
00050
typedef struct
00051
{
00052 TableRow* pRows;
00053
int nRows;
00054 DTAFileToTableIndices* DTA_INDICES;
00055
int nDTAIndices;
00056 ScoringPeptideToTableIndices* SPEP_INDICES;
00057
int nPSEQIndices;
00058
00059
unsigned char* pFlags;
00060
00061 } PeptideTable;
00062
00063
enum {TB_IC, SEQ_IC, TABLE_TYPE_IC_MFR, TABLE_TYPE_IC_MMR};
00064
enum {PEPTIDE_TABLE_QUERY_SSP, PEPTIDE_TABLE_QUERY_SSP_SEQ_ONLY};
00065
00066 TableRow* PeptideTable_readFromFile(
int* nRows,
int table_type);
00067
00068
int PeptideTable_countRows(
char* tb_filename);
00069
00070
void PeptideTable_fprint(FILE* fp, TableRow* rows,
int nsize);
00071
00072
void PeptideTable_fprint_IC_MFR(FILE* fp,
00073 IsotopicCluster* ic,
00074 MassFilterResult* mfr,
00075
int nsize,
int score_model);
00076
00077
void PeptideTable_fprint_IC_MMR(FILE* fp,
00078 IsotopicCluster* ic,
00079 MS2MatchResult* mmr,
00080
int nsize);
00081
00082
int PeptideTable_countDTAFiles(TableRow* rows,
int nRows);
00083
00084 MS2MatchResult* PeptideTable_getMS2MatchPointer(PeptideTable table,
int row);
00085 IsotopicCluster* PeptideTable_getIsotopicClusterPointer(PeptideTable table,
int row);
00086
00087 ScoringPeptideToTableIndices* PeptideTable_createScoringPeptideIndex(PeptideTable table,
int* nScoringPeptideIndices);
00088 DTAFileToTableIndices* PeptideTable_createDTAFileIndex(PeptideTable table,
int* nDTAIndices);
00089 TableIndices* PeptideTable_queryDTAFile(PeptideTable table,
00090 DTAFile query,
00091
int* nMatches);
00092
00093
void PeptideTable_queryScoringPeptide(PeptideTable table,
00094 SequestScoringPeptide* query,
00095
int nFlag,
00096 TableIndices* indices,
00097
int *nMatches);
00098
00099
void FPeak2iArray_fprintWithMassFilterResults( FILE* fp,
00100
FPeak2i* peaks,
00101 MassFilterResult* mfr,
00102
int nsize);
00103
00104
00105
#endif
00106