Skip to content

Commit b236210

Browse files
committed
add hidden parameter 'pinfile_protein_delimiter' to change default protein tab delimiter; remove undocumented 'pin_mod_proteindelim' parameter that set this same delmiter to a comma
1 parent e458a89 commit b236210

File tree

4 files changed

+27
-25
lines changed

4 files changed

+27
-25
lines changed

Comet.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ void LoadParameters(char *pszParamsFile,
351351
szDecoyPrefix[0] = '\0';
352352
sscanf(szParamVal, "%255s", szDecoyPrefix);
353353
pSearchMgr->SetParam("decoy_prefix", szDecoyPrefix, szDecoyPrefix);
354-
355354
}
356355
else if (!strcmp(szParamName, "output_suffix"))
357356
{
@@ -500,12 +499,6 @@ void LoadParameters(char *pszParamsFile,
500499
sprintf(szParamStringVal, "%d", iIntParam);
501500
pSearchMgr->SetParam("clip_nterm_aa", szParamStringVal, iIntParam);
502501
}
503-
else if (!strcmp(szParamName, "pin_mod_proteindelim"))
504-
{
505-
sscanf(szParamVal, "%d", &iIntParam);
506-
sprintf(szParamStringVal, "%d", iIntParam);
507-
pSearchMgr->SetParam("pin_proteindelim_comma", szParamStringVal, iIntParam);
508-
}
509502
else if (!strcmp(szParamName, "minimum_xcorr"))
510503
{
511504
sscanf(szParamVal, "%lf", &dDoubleParam);
@@ -1335,6 +1328,13 @@ void LoadParameters(char *pszParamsFile,
13351328
sprintf(szParamStringVal, "%d", iIntParam);
13361329
pSearchMgr->SetParam("scale_fragmentNL", szParamStringVal, iIntParam);
13371330
}
1331+
else if (!strcmp(szParamName, "pinfile_protein_delimiter"))
1332+
{
1333+
char szDelimiter[256];
1334+
szDelimiter[0] = '\0';
1335+
sscanf(szParamVal, "%255s", szDelimiter);
1336+
pSearchMgr->SetParam("pinfile_protein_delimiter", szDelimiter, szDelimiter);
1337+
}
13381338
else if (!strcmp(szParamName, "max_iterations"))
13391339
{
13401340
sscanf(szParamVal, "%ld", &lLongParam);
@@ -1815,6 +1815,8 @@ peptide_length_range = 5 50 # minimum and maximum peptide length to a
18151815
if (iPrintParams == 2)
18161816
{
18171817
fprintf(fp,
1818+
"pinfile_protein_delimiter = # blank = default 'tab' delimiter between proteins; enter a char/string to use in place of the tab; Percolator pin output only\n");
1819+
fprintf(fp,
18181820
"num_results = 100 # number of results to store internally for Sp rank only; if Sp rank is not used, set this to num_output_lines\n");
18191821
}
18201822

CometSearch/CometDataInternal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct msdata // used in the preprocessing
101101
double dIntensity;
102102
};
103103

104-
struct Options // output parameters
104+
struct Options
105105
{
106106
int iNumPeptideOutputLines;
107107
int iWhichReadingFrame;
@@ -129,7 +129,6 @@ struct Options // output parameters
129129
int bOutputOutFiles;
130130
int bClipNtermMet; // 0=leave protein sequences alone; 1=also consider w/o N-term methionine
131131
int bClipNtermAA; // 0=leave peptide sequences as-is; 1=clip N-term amino acid from every peptide
132-
int bPinModProteinDelim; // 0=default pin output format; 1=change protein delimiter to comma
133132
int bSkipAlreadyDone; // 0=search everything; 1=don't re-search if .out exists
134133
// int bSkipUpdateCheck; // 0=do not check for updates; 1=check for updates
135134
int bMango; // 0=normal; 1=Mango x-link ms2 input
@@ -162,6 +161,7 @@ struct Options // output parameters
162161
IntRange peptideLengthRange;
163162
DoubleRange clearMzRange;
164163
char szActivationMethod[24]; // mzXML only
164+
string sPinProteinDelimiter; // PIN file protein delimiter; default tab
165165

166166
Options& operator=(Options& a)
167167
{
@@ -190,7 +190,6 @@ struct Options // output parameters
190190
bOutputOutFiles = a.bOutputOutFiles;
191191
bClipNtermMet = a.bClipNtermMet;
192192
bClipNtermAA = a.bClipNtermAA;
193-
bPinModProteinDelim = a.bPinModProteinDelim;
194193
bSkipAlreadyDone = a.bSkipAlreadyDone;
195194
// bSkipUpdateCheck = a.bSkipUpdateCheck;
196195
bMango = a.bMango;
@@ -216,6 +215,7 @@ struct Options // output parameters
216215
peptideLengthRange = a.peptideLengthRange;
217216
clearMzRange = a.clearMzRange;
218217
strcpy(szActivationMethod, a.szActivationMethod);
218+
sPinProteinDelimiter = a.sPinProteinDelimiter;
219219

220220
dFragIndexMinMass = a.dFragIndexMinMass;
221221
dFragIndexMaxMass = a.dFragIndexMaxMass;
@@ -874,7 +874,6 @@ struct StaticParams
874874
options.iNumFragmentThreads = 4;
875875
options.bClipNtermMet = 0;
876876
options.bClipNtermAA = 0;
877-
options.bPinModProteinDelim = 0;
878877

879878
options.lMaxIterations = 0;
880879

@@ -898,6 +897,7 @@ struct StaticParams
898897
strcpy(options.szActivationMethod, "ALL");
899898
// End of mzXML specific parameters.
900899

900+
options.sPinProteinDelimiter = '\t';
901901

902902
options.dFragIndexMinMass = FRAGINDEX_MIN_MASS;
903903
options.dFragIndexMaxMass = FRAGINDEX_MAX_MASS;

CometSearch/CometSearchManager.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,6 @@ bool CometSearchManager::InitializeStaticParams()
649649

650650
GetParamValue("clip_nterm_aa", g_staticParams.options.bClipNtermAA);
651651

652-
GetParamValue("pin_mod_proteindelim", g_staticParams.options.bPinModProteinDelim);
653-
654652
GetParamValue("minimum_xcorr", g_staticParams.options.dMinimumXcorr);
655653

656654
GetParamValue("theoretical_fragment_ions", g_staticParams.ionInformation.iTheoreticalFragmentIons);
@@ -1192,6 +1190,12 @@ bool CometSearchManager::InitializeStaticParams()
11921190
if (GetParamValue("activation_method", strData))
11931191
strcpy(g_staticParams.options.szActivationMethod, strData.c_str());
11941192

1193+
if (GetParamValue("pinfile_protein_delimiter", strData))
1194+
{
1195+
if (strData.length() > 0)
1196+
g_staticParams.options.sPinProteinDelimiter = strData;
1197+
}
1198+
11951199
GetParamValue("minimum_intensity", g_staticParams.options.dMinIntensity);
11961200
if (g_staticParams.options.dMinIntensity < 0.0)
11971201
g_staticParams.options.dMinIntensity = 0.0;
@@ -1627,6 +1631,12 @@ bool CometSearchManager::InitializeStaticParams()
16271631
}
16281632
}
16291633

1634+
if (g_staticParams.tolerances.dInputToleranceMinus > g_staticParams.tolerances.dInputTolerancePlus)
1635+
{
1636+
printf("\n Error: mass_tolerance_lower is greater than mass_tolerance_upper so no peptides will be analyzed.\n");
1637+
return false;
1638+
}
1639+
16301640
return true;
16311641
}
16321642

CometSearch/CometWritePercolator.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,7 @@ void CometWritePercolator::PrintPercolatorSearchHit(int iWhichQuery,
280280
for (it = vProteinTargets.begin(); it != vProteinTargets.end(); ++it)
281281
{
282282
if (bPrintTab)
283-
{
284-
if (g_staticParams.options.bPinModProteinDelim)
285-
fprintf(fpout, ",");
286-
else
287-
fprintf(fpout, "\t");
288-
}
283+
fprintf(fpout, "%s", g_staticParams.options.sPinProteinDelimiter.c_str());
289284

290285
fprintf(fpout, "%s", (*it).c_str());
291286
bPrintTab = true;
@@ -297,12 +292,7 @@ void CometWritePercolator::PrintPercolatorSearchHit(int iWhichQuery,
297292
for (it = vProteinDecoys.begin(); it != vProteinDecoys.end(); ++it)
298293
{
299294
if (bPrintTab)
300-
{
301-
if (g_staticParams.options.bPinModProteinDelim)
302-
fprintf(fpout, ",");
303-
else
304-
fprintf(fpout, "\t");
305-
}
295+
fprintf(fpout, "%s", g_staticParams.options.sPinProteinDelimiter.c_str());
306296

307297
fprintf(fpout, "%s", (*it).c_str());
308298
bPrintTab = true;

0 commit comments

Comments
 (0)