use of com.compomics.util.parameters.identification.advanced.ValidationQcParameters in project peptide-shaker by compomics.
the class MatchesValidator method updateProteinMatchValidationLevel.
/**
* Updates the validation status of a protein match. If the match was
* manually validated nothing will be changed.
*
* @param identification the identification object
* @param targetDecoyMap the protein level target/decoy map
* @param sequenceProvider a protein sequence provider
* @param spectrumProvider The spectrum provider.
* @param proteinDetailsProvider a protein details provider
* @param geneMaps the gene maps
* @param scoreThreshold the validation score doubtfulThreshold
* @param confidenceThreshold the confidence doubtfulThreshold after which a
* match should be considered as confident
* @param noValidated boolean indicating whether no validation was actually
* conducted
* @param nTargetLimit the limit in number of target hits before the first
* decoy hit
* @param identificationFeaturesGenerator the identification features
* generator
* @param proteinKey the key of the protein match of interest
* @param identificationParameters the identification parameters
*/
public static void updateProteinMatchValidationLevel(Identification identification, IdentificationFeaturesGenerator identificationFeaturesGenerator, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider, GeneMaps geneMaps, IdentificationParameters identificationParameters, TargetDecoyMap targetDecoyMap, double scoreThreshold, double nTargetLimit, double confidenceThreshold, boolean noValidated, long proteinKey) {
PSParameter psParameter = new PSParameter();
ProteinMatch proteinMatch = (ProteinMatch) identification.retrieveObject(proteinKey);
psParameter = (PSParameter) proteinMatch.getUrParam(psParameter);
psParameter.resetQcResults();
ValidationQcParameters validationQCParameters = identificationParameters.getIdValidationParameters().getValidationQCParameters();
if (!psParameter.getManualValidation()) {
if (identificationParameters.getFastaParameters().isTargetDecoy()) {
if (!noValidated && psParameter.getScore() <= scoreThreshold) {
boolean filtersPassed = true;
if (validationQCParameters.getProteinFilters() != null) {
for (Filter filter : validationQCParameters.getProteinFilters()) {
ProteinFilter proteinFilter = (ProteinFilter) filter;
boolean validation = proteinFilter.isValidated(proteinKey, identification, geneMaps, identificationFeaturesGenerator, identificationParameters, sequenceProvider, proteinDetailsProvider, spectrumProvider);
psParameter.setQcResult(filter.getName(), validation);
if (!validation) {
filtersPassed = false;
}
}
}
// @TODO: not sure whether we should include all 100% confidence hits by default?
boolean confidenceThresholdPassed = psParameter.getConfidence() >= confidenceThreshold;
if (filtersPassed && confidenceThresholdPassed) {
psParameter.setMatchValidationLevel(MatchValidationLevel.confident);
} else {
psParameter.setMatchValidationLevel(MatchValidationLevel.doubtful);
}
} else {
psParameter.setMatchValidationLevel(MatchValidationLevel.not_validated);
}
} else {
psParameter.setMatchValidationLevel(MatchValidationLevel.none);
}
identification.updateObject(proteinKey, proteinMatch);
}
}
Aggregations