Skip to content

Commit

Permalink
Use NUM_ION_SERIES in place of MAX_FRAGMENT_IONS_TYPE. Discovered tha…
Browse files Browse the repository at this point in the history
…t the latter was set too large causing segfaults in Windows searches.
  • Loading branch information
jke000 committed May 31, 2024
1 parent e658123 commit f00df0c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion CometSearch/CometDataInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class CometSearchManager;
#define MIN_PEPTIDE_LEN 1 // min # of AA for a petpide
#define MAX_PEPTIDE_LEN 51 // max # of AA for a peptide; one more than actual # to account for terminating char
#define MAX_PEPTIDE_LEN_P2 53 // max # of AA for a peptide plus 2 for N/C-term
#define MAX_FRAGMENT_IONS_TYPE 9 // allowed fragment ions (aka a/b/c/x/y/z) ; check why this is 9!

#define FRAGINDEX_MIN_IONS_SCORE 3 // min # of matched ions for peptide to register for E-value xcorr histogram
#define FRAGINDEX_MIN_IONS_REPORT 3 // min # of matched ions for peptide to be reported
Expand Down
4 changes: 2 additions & 2 deletions CometSearch/CometFragmentIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class CometFragmentIndex
static bool CompareByMass(const DBIndex &lhs,
const DBIndex &rhs);

unsigned int _uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedIonMassesDecoy[MAX_FRAGMENT_CHARGE+1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedIonMassesDecoy[MAX_FRAGMENT_CHARGE+1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedPrecursorNL[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE];
unsigned int _uiBinnedPrecursorNLDecoy[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE];

Expand Down
6 changes: 3 additions & 3 deletions CometSearch/CometSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ void CometSearch::SearchFragmentIndex(size_t iWhichQuery,
unsigned int uiFragmentMass;
int iArraySize = (int)((g_staticParams.options.dPeptideMassHigh + 100.0) * g_staticParams.dInverseBinWidth);

unsigned int uiBinnedIonMasses[MAX_FRAGMENT_CHARGE + 1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int uiBinnedIonMasses[MAX_FRAGMENT_CHARGE + 1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int uiBinnedPrecursorNL[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE];

bool* pbDuplFragment = new bool[iArraySize];
Expand Down Expand Up @@ -3622,7 +3622,7 @@ void CometSearch::XcorrScore(char *szProteinSeq,
int iLenPeptideMinus1 = iLenPeptide - 1;

// Pointer to either regular or decoy uiBinnedIonMasses[][][][][].
unsigned int (*p_uiBinnedIonMasses)[MAX_FRAGMENT_CHARGE+1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int (*p_uiBinnedIonMasses)[MAX_FRAGMENT_CHARGE+1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int (*p_uiBinnedPrecursorNL)[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE];

// Point to right set of arrays depending on target or decoy search.
Expand Down Expand Up @@ -3804,7 +3804,7 @@ void CometSearch::XcorrScoreI(char *szProteinSeq,
int iLenPeptide,
int *piVarModSites,
struct sDBEntry *dbe,
unsigned int uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT],
unsigned int uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT],
unsigned int uiBinnedPrecursorNL[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE],
int iNumMatchedFragmentIons)
{
Expand Down
6 changes: 3 additions & 3 deletions CometSearch/CometSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class CometSearch
int iLenPeptide,
int *piVarModSites,
struct sDBEntry *dbe,
unsigned int uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT],
unsigned int uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT],
unsigned int uiBinnedPrecursorNL[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE],
int iNumMatchedFragmentIons);

Expand Down Expand Up @@ -305,8 +305,8 @@ class CometSearch
VarModInfo _varModInfo;
ProteinInfo _proteinInfo;

unsigned int _uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedIonMassesDecoy[MAX_FRAGMENT_CHARGE+1][MAX_FRAGMENT_IONS_TYPE][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedIonMasses[MAX_FRAGMENT_CHARGE+1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedIonMassesDecoy[MAX_FRAGMENT_CHARGE+1][NUM_ION_SERIES][MAX_PEPTIDE_LEN][BIN_MOD_COUNT];
unsigned int _uiBinnedPrecursorNL[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE];
unsigned int _uiBinnedPrecursorNLDecoy[MAX_PRECURSOR_NL_SIZE][MAX_PRECURSOR_CHARGE];

Expand Down

0 comments on commit f00df0c

Please sign in to comment.