@@ -560,8 +560,20 @@ void CometWritePepXML::PrintResults(int iWhichQuery,
560
560
if (iWhichResult > 0 && !isEqual (pOutput[iWhichResult].fXcorr , pOutput[iWhichResult-1 ].fXcorr ))
561
561
iRankXcorr++;
562
562
563
+ double dLastDeltaCn = 1.0 ; // this is deltaCn between first and last peptide in output list
564
+
565
+ if (g_staticParams.options .bExportAdditionalScoresPepXML )
566
+ {
567
+ if (pOutput[iWhichResult].fXcorr > 0.0 && pOutput[iNumPrintLines-1 ].fXcorr >= 0.0 )
568
+ dLastDeltaCn = (pOutput[iWhichResult].fXcorr - pOutput[iNumPrintLines-1 ].fXcorr )/pOutput[iWhichResult].fXcorr ;
569
+ else if (pOutput[iWhichResult].fXcorr > 0.0 && pOutput[iNumPrintLines-1 ].fXcorr < 0.0 )
570
+ dLastDeltaCn = 1.0 ;
571
+ else
572
+ dLastDeltaCn = 0.0 ;
573
+ }
574
+
563
575
if (pOutput[iWhichResult].fXcorr > g_staticParams.options .dMinimumXcorr )
564
- PrintPepXMLSearchHit (iWhichQuery, iWhichResult, iRankXcorr, iPrintTargetDecoy, pOutput, fpout, fpdb, dDeltaCn);
576
+ PrintPepXMLSearchHit (iWhichQuery, iWhichResult, iRankXcorr, iPrintTargetDecoy, pOutput, fpout, fpdb, dDeltaCn, dLastDeltaCn );
565
577
}
566
578
567
579
fprintf (fpout, " </search_result>\n " );
@@ -576,7 +588,8 @@ void CometWritePepXML::PrintPepXMLSearchHit(int iWhichQuery,
576
588
Results *pOutput,
577
589
FILE *fpout,
578
590
FILE *fpdb,
579
- double dDeltaCn)
591
+ double dDeltaCn,
592
+ double dLastDeltaCn)
580
593
{
581
594
int i;
582
595
int iNTT;
@@ -881,11 +894,30 @@ void CometWritePepXML::PrintPepXMLSearchHit(int iWhichQuery,
881
894
fprintf (fpout, " </modification_info>\n " );
882
895
}
883
896
884
- fprintf (fpout, " <search_score name=\" xcorr\" value=\" %0.3f \" />\n " , pOutput[iWhichResult].fXcorr );
885
- fprintf (fpout, " <search_score name=\" deltacn\" value=\" %0.3f \" />\n " , dDeltaCn);
897
+ fprintf (fpout, " <search_score name=\" xcorr\" value=\" %0.4f \" />\n " , pOutput[iWhichResult].fXcorr );
898
+ fprintf (fpout, " <search_score name=\" deltacn\" value=\" %0.4f \" />\n " , dDeltaCn);
886
899
fprintf (fpout, " <search_score name=\" spscore\" value=\" %0.1f\" />\n " , pOutput[iWhichResult].fScoreSp );
887
900
fprintf (fpout, " <search_score name=\" sprank\" value=\" %d\" />\n " , pOutput[iWhichResult].iRankSp );
888
901
fprintf (fpout, " <search_score name=\" expect\" value=\" %0.2E\" />\n " , pOutput[iWhichResult].dExpect );
902
+
903
+ if (g_staticParams.options .bExportAdditionalScoresPepXML )
904
+ {
905
+ fprintf (fpout, " <search_score name=\" lnrSp\" value=\" %0.4f\" />\n " , log ((double )pOutput[iWhichResult].iRankSp ));
906
+ fprintf (fpout, " <search_score name=\" deltLCn\" value=\" %0.4f\" />\n " , dLastDeltaCn);
907
+ fprintf (fpout, " <search_score name=\" lnExpect\" value=\" %0.4f\" />\n " , log (pOutput[iWhichResult].dExpect ));
908
+ fprintf (fpout, " <search_score name=\" IonFrac\" value=\" %0.4f\" />\n " , (double )pOutput[iWhichResult].iMatchedIons / pOutput[iWhichResult].iTotalIons );
909
+
910
+ unsigned long uliNumMatch;
911
+ if (iPrintTargetDecoy == 2 )
912
+ uliNumMatch = pQuery->_uliNumMatchedDecoyPeptides ;
913
+ else
914
+ uliNumMatch = pQuery->_uliNumMatchedPeptides ;
915
+ if (uliNumMatch > 0 )
916
+ fprintf (fpout, " <search_score name=\" lnNumSP\" value=\" %0.4f\" />\n " , log ((double )(uliNumMatch)));
917
+ else
918
+ fprintf (fpout, " <search_score name=\" lnNumSP\" value=\" %0.4f\" />\n " , -20.0 );
919
+ }
920
+
889
921
fprintf (fpout, " </search_hit>\n " );
890
922
}
891
923
0 commit comments