c5aa5ed3ec9a25e76dd6f316b793a195d6f62292
cline
  Thu Jan 6 15:27:12 2011 -0800
Updated the peptide mapping schema to change the data type of precursorMz froma float to a string.  Why did I do such a bizarre and unexpected thing?
Because it turns out that when data is loaded into mysql, the precursorMz field
(and all other floats) are rounded to three digits after the decimal point.  This is often not enough to distinguish between precursorMz values that we've seen in practice so far, where the first differences may be five digits after the decimal point.  The precursorMz field is used to identify the spectra, not as a float on which any further computation is done.  So, by making its data type a string, we've ensured that the significant distinctions between spectra will not be rounded away, and that all spectra continue to be identifiable via precursorMz.

diff --git src/hg/inc/peptideMapping.h src/hg/inc/peptideMapping.h
index 3a67b05..734d27c 100644
--- src/hg/inc/peptideMapping.h
+++ src/hg/inc/peptideMapping.h
@@ -6,31 +6,31 @@
 #define PEPTIDEMAPPING_H
 
 #define PEPTIDEMAPPING_NUM_COLS 10
 
 struct peptideMapping
 /* Format for genomic mappings of mass spec proteogenomic hits */
     {
     struct peptideMapping *next;  /* Next in singly linked list. */
     char *chrom;	/* Reference sequence chromosome or scaffold */
     unsigned chromStart;	/* Start position in chromosome */
     unsigned chromEnd;	/* End position in chromosome */
     char *name;	/* Peptide sequence of the hit */
     unsigned score;	/* Log e-value scaled to a score of 0 (worst) to 1000 (best) */
     char strand[2];	/* + or - */
     float rawScore;	/* Raw score for this hit, as estimated through HMM analysis */
-    float precursorMz;	/* Precursor Mz */
+    char *precursorMz;	/* Precursor Mz */
     unsigned peptideRank;	/* Rank of this hit, for peptides with multiple genomic hits */
     unsigned peptideRepeatCount;	/* Indicates how many times this same hit was observed */
     };
 
 void peptideMappingStaticLoad(char **row, struct peptideMapping *ret);
 /* Load a row from peptideMapping table into ret.  The contents of ret will
  * be replaced at the next call to this function. */
 
 struct peptideMapping *peptideMappingLoad(char **row);
 /* Load a peptideMapping from row fetched with select * from peptideMapping
  * from database.  Dispose of this with peptideMappingFree(). */
 
 struct peptideMapping *peptideMappingLoadAll(char *fileName);
 /* Load all peptideMapping from whitespace-separated file.
  * Dispose of this with peptideMappingFreeList(). */