Search in sources :

Example 6 with Concept

use of org.edamontology.edammap.core.edam.Concept in project edammap by edamontology.

the class Report method writeMatches.

private static void writeMatches(ScoreArgs scoreArgs, Writer writer, Map<EdamUri, Concept> concepts, Query query, List<Publication> publications, MappingTest mapping) throws IOException {
    for (Branch branch : Branch.values()) {
        List<MatchTest> matches = mapping.getMatches(branch);
        if (matches.isEmpty())
            continue;
        writer.write("\t\t<div class=\"branch " + branch + "\">\n");
        writer.write("\t\t\t<h3>" + branch + "</h3>\n");
        for (MatchTest matchTest : matches) {
            Match match = matchTest.getMatch();
            writer.write("\t\t\t<div class=\"match " + matchTest.getTest().name() + "\">\n");
            writer.write("\t\t\t\t<div class=\"match-div\">\n");
            writeConcept(writer, concepts, match);
            writeQueryMatch(writer, query, publications, match.getQueryMatch(), true);
            writer.write("\t\t\t\t\t<div class=\"type\">" + match.getConceptMatch().getType() + "</div>\n");
            writeScore(scoreArgs, writer, branch, match);
            writer.write("\t\t\t\t</div>\n");
            List<MatchAverageStats> matchAverageStats = match.getMatchAverageStats();
            if (matchAverageStats != null && !matchAverageStats.isEmpty()) {
                // TODO
                Concept concept = concepts.get(match.getEdamUri());
                writer.write("\t\t\t\t<div class=\"details-div\">\n");
                writer.write("\t\t\t\t\t<div class=\"details\" tabindex=\"0\"></div>\n");
                writer.write("\t\t\t\t\t<div class=\"details-box\" tabindex=\"0\">\n");
                for (MatchAverageStats mas : matchAverageStats) {
                    writer.write("\t\t\t\t\t\t<div><div>");
                    writeQueryMatch(writer, query, publications, mas.getQueryMatch(), false);
                    writer.write("<br>" + percent(mas.getQueryMatch().getScore()) + "</div><div>");
                    ConceptMatchType conceptType = mas.getConceptMatch().getType();
                    writer.write("<span>" + conceptType + "</span>");
                    if (conceptType != ConceptMatchType.definition && conceptType != ConceptMatchType.comment && conceptType != ConceptMatchType.none) {
                        writer.write("<br>" + conceptMatchString(concept, mas.getConceptMatch()));
                    }
                    writer.write("<br>" + percent(mas.getConceptMatch().getScore()) + "</div><div>");
                    writer.write("<span>" + percent(mas.getScore()) + "</span></div></div>\n");
                }
                writer.write("\t\t\t\t\t</div>\n");
                writer.write("\t\t\t\t</div>\n");
            }
            writer.write("\t\t\t</div>\n");
        }
        writer.write("\t\t</div>\n");
    }
}
Also used : Concept(org.edamontology.edammap.core.edam.Concept) MatchAverageStats(org.edamontology.edammap.core.mapping.MatchAverageStats) Branch(org.edamontology.edammap.core.edam.Branch) ConceptMatchType(org.edamontology.edammap.core.mapping.ConceptMatchType) MatchTest(org.edamontology.edammap.core.benchmarking.MatchTest) QueryMatch(org.edamontology.edammap.core.mapping.QueryMatch) Match(org.edamontology.edammap.core.mapping.Match) ConceptMatch(org.edamontology.edammap.core.mapping.ConceptMatch)

Aggregations

Concept (org.edamontology.edammap.core.edam.Concept)6 EdamUri (org.edamontology.edammap.core.edam.EdamUri)4 MatchTest (org.edamontology.edammap.core.benchmarking.MatchTest)2 Branch (org.edamontology.edammap.core.edam.Branch)2 Idf (org.edamontology.edammap.core.idf.Idf)2 Match (org.edamontology.edammap.core.mapping.Match)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 MappingTest (org.edamontology.edammap.core.benchmarking.MappingTest)1 Results (org.edamontology.edammap.core.benchmarking.Results)1 IdfMake (org.edamontology.edammap.core.idf.IdfMake)1 ConceptMatch (org.edamontology.edammap.core.mapping.ConceptMatch)1 ConceptMatchType (org.edamontology.edammap.core.mapping.ConceptMatchType)1 MatchAverageStats (org.edamontology.edammap.core.mapping.MatchAverageStats)1 QueryMatch (org.edamontology.edammap.core.mapping.QueryMatch)1 Output (org.edamontology.edammap.core.output.Output)1 Param (org.edamontology.edammap.core.output.Param)1 PreProcessor (org.edamontology.edammap.core.preprocessing.PreProcessor)1