diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/HLAcaller/FrequencyFileReader.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/HLAcaller/FrequencyFileReader.java index bd585a2ac..986c4cb26 100644 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/HLAcaller/FrequencyFileReader.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/HLAcaller/FrequencyFileReader.java @@ -1,6 +1,5 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. +/** + * File reader used by other Walkers to read HLA allele frequencies. */ package org.broadinstitute.sting.playground.gatk.walkers.HLAcaller; @@ -13,12 +12,16 @@ import java.util.Hashtable; */ public class FrequencyFileReader { Hashtable AlleleFrequencies = new Hashtable(); + Hashtable UniqueAlleles = new Hashtable(); public Hashtable GetAlleleFrequencies(){ return AlleleFrequencies; } - public void ReadFile(String filename){ + public Hashtable GetUniqueAlleles(){ + return UniqueAlleles; + } + public void ReadFile(String filename, String uniqueAllelesFile){ try{ FileInputStream fstream = new FileInputStream(filename); DataInputStream in = new DataInputStream(fstream); @@ -31,6 +34,16 @@ public class FrequencyFileReader { //System.out.printf("Loaded: %s\t%s\n",s[0],AlleleFrequencies.get(s[0]).toString()); } in.close(); + + fstream = new FileInputStream(uniqueAllelesFile); + in = new DataInputStream(fstream); + br = new BufferedReader(new InputStreamReader(in)); + //Read File Line By Line + while ((strLine = br.readLine()) != null) { + UniqueAlleles.put(strLine,strLine); + //System.out.printf("Loaded: %s\t%s\n",s[0],AlleleFrequencies.get(s[0]).toString()); + } + in.close(); }catch (Exception e){//Catch exception if any System.err.println("FrequencyFileReader Error: " + e.getMessage()); }