@@ -60,18 +60,12 @@ public PsmReader()
60
60
{ PsmFileType . PeptideShaker , new string [ ] { ", " } } ,
61
61
} ;
62
62
63
- // TODO:
64
- // try to cast filetype as IQuantifiableResultFile
65
- // var readResult as IQuantifiableResultFile
66
- // 1. use Parsefiletype extension to get supported filetype enum
67
- // 2. get ResultFile by passing in filePath and enum
68
- // try cast resultFile to IQuantResultFile
69
- private static List < Identification > TryReadQuantifiableResultFile ( string filepath , bool silent , List < SpectraFileInfo > rawfiles )
63
+ private static List < Identification > TryReadQuantifiableResultFile ( string filepath , bool silent , List < SpectraFileInfo > rawfiles , bool usePepQValue )
70
64
{
71
65
try
72
66
{
73
67
IQuantifiableResultFile quantifiable = FileReader . ReadQuantifiableResultFile ( filepath ) ;
74
- List < Identification > identifications = quantifiable . MakeIdentifications ( rawfiles ) ;
68
+ List < Identification > identifications = quantifiable . MakeIdentifications ( rawfiles , usePepQValue ) ;
75
69
if ( ! silent )
76
70
{
77
71
Console . WriteLine ( "Done reading PSMs; found " + identifications . Count ) ;
@@ -89,10 +83,11 @@ private static List<Identification> TryReadQuantifiableResultFile(string filepat
89
83
public List < Identification > ReadPsms ( string filepath , bool silent , List < SpectraFileInfo > rawfiles , double qValueThreshold = 0.01 , bool usePepQValue = false )
90
84
{
91
85
// check if file path can be read in using readers as QuantifiableResultFile
92
- List < Identification > quantifiableIdentifications = TryReadQuantifiableResultFile ( filepath , silent , rawfiles ) ;
86
+ List < Identification > quantifiableIdentifications = TryReadQuantifiableResultFile ( filepath , silent , rawfiles , usePepQValue ) ;
93
87
if ( quantifiableIdentifications != null )
94
88
{
95
- return quantifiableIdentifications ;
89
+ qValueThreshold = Math . Max ( qValueThreshold , 0.01 ) ;
90
+ return quantifiableIdentifications . Where ( id => id . QValue < qValueThreshold ) . ToList ( ) ;
96
91
}
97
92
98
93
if ( _modSequenceToMonoMass == null )
0 commit comments