use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ValidationChecksBuilder method runAuthorLevelNoEffectChecks.
/**
* Run no effect checks on a row
*
* @param association row to be checked
*/
public Collection<ValidationError> runAuthorLevelNoEffectChecks(Association association) {
Collection<ValidationError> validationErrors = new ArrayList<>();
ValidationError orFound = errorCreationService.checkOrEmpty(association.getOrPerCopyNum());
validationErrors.add(orFound);
ValidationError betaFound = errorCreationService.checkBetaValuesIsEmpty(association.getBetaNum());
validationErrors.add(betaFound);
ValidationError betaUnitFound = errorCreationService.checkBetaUnitIsEmpty(association.getBetaUnit());
validationErrors.add(betaUnitFound);
ValidationError betaDirectionFound = errorCreationService.checkBetaDirectionIsEmpty(association.getBetaDirection());
validationErrors.add(betaDirectionFound);
ValidationError rangeFound = errorCreationService.checkRangeIsEmpty(association.getRange());
validationErrors.add(rangeFound);
return ErrorProcessingService.checkForValidErrors(validationErrors);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ValidationChecksBuilder method runAuthorLevelOrChecks.
/**
* Run OR checks on a row
*
* @param association association to be checked
*/
public Collection<ValidationError> runAuthorLevelOrChecks(Association association) {
Collection<ValidationError> validationErrors = new ArrayList<>();
ValidationError betaFoundForOr = errorCreationService.checkBetaValuesIsEmpty(association.getBetaNum());
validationErrors.add(betaFoundForOr);
ValidationError betaUnitFoundForOr = errorCreationService.checkBetaUnitIsEmpty(association.getBetaUnit());
validationErrors.add(betaUnitFoundForOr);
ValidationError betaDirectionFoundForOr = errorCreationService.checkBetaDirectionIsEmpty(association.getBetaDirection());
validationErrors.add(betaDirectionFoundForOr);
ValidationError rangeNotFound = errorCreationService.checkRangeIsPresent(association.getRange());
validationErrors.add(rangeNotFound);
return ErrorProcessingService.checkForValidErrors(validationErrors);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ValidationChecksBuilder method runRiskFrequencyChecks.
/**
* Run risk frequency checks on association and the risk alleles linked to a locus
*
* @param association row to be checked
*/
public Collection<ValidationError> runRiskFrequencyChecks(Association association) {
Collection<ValidationError> validationErrors = new ArrayList<>();
// Check the association risk frequency
validationErrors.add(errorCreationService.checkAssociationRiskFrequency(association.getRiskFrequency()));
// Check risk frequency on alleles if its a SNP interaction association
if (association.getSnpInteraction()) {
for (Locus locus : association.getLoci()) {
locus.getStrongestRiskAlleles().forEach(riskAllele -> {
validationErrors.add(errorCreationService.checkAlleleRiskFrequency(riskAllele.getRiskFrequency()));
});
}
}
return ErrorProcessingService.checkForValidErrors(validationErrors);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ValidationChecksBuilder method runBetaChecks.
/**
* Run Beta checks on a row
*
* @param association row to be checked
*/
public Collection<ValidationError> runBetaChecks(Association association) {
Collection<ValidationError> validationErrors = new ArrayList<>();
ValidationError betaIsPresent = errorCreationService.checkBetaIsPresentAndIsNotNegative(association.getBetaNum());
validationErrors.add(betaIsPresent);
ValidationError betaUnitNotFound = errorCreationService.checkBetaUnitIsPresent(association.getBetaUnit());
validationErrors.add(betaUnitNotFound);
ValidationError betaDirectionNotFound = errorCreationService.checkBetaDirectionIsPresent(association.getBetaDirection());
validationErrors.add(betaDirectionNotFound);
ValidationError orFound = errorCreationService.checkOrEmpty(association.getOrPerCopyNum());
validationErrors.add(orFound);
ValidationError orRecipFound = errorCreationService.checkOrRecipEmpty(association.getOrPerCopyRecip());
validationErrors.add(orRecipFound);
ValidationError orRecipRangeFound = errorCreationService.checkOrPerCopyRecipRangeIsEmpty(association.getOrPerCopyRecipRange());
validationErrors.add(orRecipRangeFound);
ValidationError rangeNotFound = errorCreationService.checkRangeIsPresent(association.getRange());
validationErrors.add(rangeNotFound);
return ErrorProcessingService.checkForValidErrors(validationErrors);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ValidationChecksBuilder method runAnnotationChecks.
/**
* Run general checks on a row annotation
*
* @param association association to be checked
*/
public Collection<ValidationError> runAnnotationChecks(Association association) {
Collection<ValidationError> validationErrors = new ArrayList<>();
validationErrors.add(errorCreationService.checkSnpType(association.getSnpType()));
if (association.getSnpInteraction()) {
for (Locus locus : association.getLoci()) {
locus.getStrongestRiskAlleles().forEach(riskAllele -> {
Boolean genomeWide = riskAllele.getGenomeWide();
Boolean limitedList = riskAllele.getLimitedList();
validationErrors.add(errorCreationService.checkSnpStatusIsPresent(genomeWide, limitedList));
});
}
}
return ErrorProcessingService.checkForValidErrors(validationErrors);
}
Aggregations