From d8cfd707bc13d1bd8a1234939fa83489d79173cc Mon Sep 17 00:00:00 2001 From: sjia Date: Tue, 15 Dec 2009 20:35:18 +0000 Subject: [PATCH] Updated documentation git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2363 348d0f76-0448-11de-a6fe-93d51630548a --- .../HLAcaller/FrequencyFileReader.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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()); }