Updated documentation

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2363 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
sjia 2009-12-15 20:35:18 +00:00
parent 4322beeb35
commit d8cfd707bc
1 changed files with 17 additions and 4 deletions

View File

@ -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());
}