@@ -0,0 +1,2055 @@
+/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage org.mskcc.cbio.oncokb.importer;%0A%0Aimport org.mskcc.cbio.oncokb.model.Alteration;%0Aimport org.mskcc.cbio.oncokb.model.Evidence;%0Aimport org.mskcc.cbio.oncokb.model.Gene;%0Aimport org.mskcc.cbio.oncokb.model.LevelOfEvidence;%0Aimport org.mskcc.cbio.oncokb.util.AlterationUtils;%0Aimport org.mskcc.cbio.oncokb.util.ApplicationContextSingleton;%0Aimport org.mskcc.cbio.oncokb.util.LevelUtils;%0A%0Aimport java.io.IOException;%0Aimport java.util.Collections;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0A/**%0A * @author zhangh2 %0A */%0A%0Apublic class AlterationLevel %7B%0A    private AlterationLevel() %7B%0A        throw new AssertionError();%0A    %7D%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        List%3CGene%3E genes = ApplicationContextSingleton.getGeneBo().findAll();%0A%0A        System.out.println(%22Gene%5CtAlteration%5CtLevel%22);%0A        for (Gene gene : genes) %7B%0A            List%3CAlteration%3E alterations = ApplicationContextSingleton.getAlterationBo().findAlterationsByGene(Collections.singleton(gene));%0A            Set%3CAlteration%3E alterationsWithoutVUS = AlterationUtils.excludeVUS(new HashSet%3C%3E(alterations));%0A            for (Alteration alteration : alterationsWithoutVUS) %7B%0A                List%3CAlteration%3E relevantAlts = ApplicationContextSingleton.getAlterationBo().findRelevantAlterations(alteration, alterations);%0A                List%3CEvidence%3E relevantEvidences = ApplicationContextSingleton.getEvidenceBo().findEvidencesByAlteration(relevantAlts);%0A                LevelOfEvidence levelOfEvidence = LevelUtils.getHighestLevelFromEvidence(new HashSet%3C%3E(relevantEvidences));%0A                String level = %22NA%22;%0A%0A                if (levelOfEvidence != null && levelOfEvidence.getLevel() != null) %7B%0A                    level = levelOfEvidence.getLevel().toUpperCase();%0A                %7D%0A                System.out.println(gene.getHugoSymbol() + %22%5Ct%22 + alteration.getAlteration() + %22%5Ct%22 + level);%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add script to calculate the highest level for each variant of all genes