Search in sources :

Example 1 with AntigenRecognitionSiteLoader

use of org.dash.valid.ars.AntigenRecognitionSiteLoader in project ImmunogeneticDataTools by nmdp-bioinformatics.

the class GLStringUtilities method checkAntigenRecognitionSite.

/**
 * @param locus
 * @param alleleBuffer
 * @param match
 * @return
 * @throws UnexpectedAlleleException
 */
public static boolean checkAntigenRecognitionSite(String allele, String referenceAllele) {
    String matchedValue = convertToProteinLevel(allele);
    AntigenRecognitionSiteLoader instance = null;
    try {
        instance = AntigenRecognitionSiteLoader.getInstance();
    } catch (IOException | InvalidFormatException e) {
        LOGGER.warning("Could not load ars data.");
        e.printStackTrace();
    }
    HashMap<String, HashSet<String>> arsMap = instance.getArsMap();
    if (arsMap.containsKey(referenceAllele)) {
        for (String arsCode : arsMap.keySet()) {
            if (arsCode.equals(referenceAllele) && arsMap.get(arsCode).contains(matchedValue)) {
                return true;
            }
        }
    }
    return false;
}
Also used : IOException(java.io.IOException) InvalidFormatException(org.apache.poi.openxml4j.exceptions.InvalidFormatException) AntigenRecognitionSiteLoader(org.dash.valid.ars.AntigenRecognitionSiteLoader) HashSet(java.util.HashSet)

Aggregations

IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 InvalidFormatException (org.apache.poi.openxml4j.exceptions.InvalidFormatException)1 AntigenRecognitionSiteLoader (org.dash.valid.ars.AntigenRecognitionSiteLoader)1