Search in sources :

Example 1 with GeneDifferentialExpressionMetaAnalysisResult

use of ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysisResult in project Gemma by PavlidisLab.

the class PhenotypeAssociationManagerServiceImpl method makeDifferentialExpressionEvidencesFromDiffExpressionMetaAnalysis.

@Override
public ValidateEvidenceValueObject makeDifferentialExpressionEvidencesFromDiffExpressionMetaAnalysis(Long geneDifferentialExpressionMetaAnalysisId, SortedSet<CharacteristicValueObject> phenotypes, Double selectionThreshold) {
    GeneDifferentialExpressionMetaAnalysis geneDifferentialExpressionMetaAnalysis = this.geneDiffExMetaAnalysisService.load(geneDifferentialExpressionMetaAnalysisId);
    // check that no evidence already exists with that metaAnalysis
    Collection<DifferentialExpressionEvidence> differentialExpressionEvidence = this.phenoAssocService.loadEvidenceWithGeneDifferentialExpressionMetaAnalysis(geneDifferentialExpressionMetaAnalysisId, 1);
    if (!differentialExpressionEvidence.isEmpty()) {
        ValidateEvidenceValueObject validateEvidenceValueObject = new ValidateEvidenceValueObject();
        validateEvidenceValueObject.setSameEvidenceFound(true);
        return validateEvidenceValueObject;
    }
    for (GeneDifferentialExpressionMetaAnalysisResult geneDifferentialExpressionMetaAnalysisResult : geneDifferentialExpressionMetaAnalysis.getResults()) {
        if (geneDifferentialExpressionMetaAnalysisResult.getMetaQvalue() <= selectionThreshold) {
            DiffExpressionEvidenceValueObject diffExpressionEvidenceValueObject = new DiffExpressionEvidenceValueObject(-1L, geneDifferentialExpressionMetaAnalysis, geneDifferentialExpressionMetaAnalysisResult, phenotypes, "IEP", selectionThreshold);
            // set the score
            ScoreValueObject scoreValueObject = new ScoreValueObject(null, geneDifferentialExpressionMetaAnalysisResult.getMetaPvalue().toString(), "P-value");
            diffExpressionEvidenceValueObject.setScoreValueObject(scoreValueObject);
            ValidateEvidenceValueObject validateEvidenceValueObject = this.makeEvidence(diffExpressionEvidenceValueObject);
            if (validateEvidenceValueObject != null) {
                // since this method created multiple evidence, if a problem is detected stop the transaction
                throw new RuntimeException("makeDifferentialExpressionEvidencesFromDiffExpressionMetaAnalysis() problem detected");
            }
        }
    }
    return null;
}
Also used : GeneDifferentialExpressionMetaAnalysis(ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysis) GeneDifferentialExpressionMetaAnalysisResult(ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysisResult)

Aggregations

GeneDifferentialExpressionMetaAnalysis (ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysis)1 GeneDifferentialExpressionMetaAnalysisResult (ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysisResult)1