edu.cmu.cs.sb.chromviewer
Class BiomartAccess

java.lang.Object
  extended by edu.cmu.cs.sb.chromviewer.BiomartAccess

public class BiomartAccess
extends java.lang.Object

Class responsible for downloading gene locations from Biomart


Constructor Summary
BiomartAccess(java.lang.String fname)
          Constructor, sets m_file to a File handle on fname
 
Method Summary
 int executeCountQuery(java.lang.String xmlMessage)
          Executes the BioMart query in xmlMessage that counts the number of records satisfying query.
 void executeQuery(java.io.BufferedOutputStream bos, java.lang.String xmlMessage, int[] npercentdone, int nstatusfield, java.lang.Object lockpd)
          ExecuteQuery.
 java.util.HashSet getValidAttributes(java.lang.String szdataset)
          Gets a HashSet of valid attributes for the gene location
 void updateGeneFile(java.lang.String species, java.lang.String szoutfile, int[] npercentdone, int nstatusfield, java.lang.Object lockpd)
          Species is the name of the species to download the locations for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BiomartAccess

public BiomartAccess(java.lang.String fname)
Constructor, sets m_file to a File handle on fname

Method Detail

executeCountQuery

public int executeCountQuery(java.lang.String xmlMessage)
                      throws java.io.IOException
Executes the BioMart query in xmlMessage that counts the number of records satisfying query. Returns this count of records. This is used for the progress download.

Throws:
java.io.IOException

executeQuery

public void executeQuery(java.io.BufferedOutputStream bos,
                         java.lang.String xmlMessage,
                         int[] npercentdone,
                         int nstatusfield,
                         java.lang.Object lockpd)
                  throws java.io.IOException
ExecuteQuery. xmlMessage is the string containing the BioMart query to execute. bos is the the output stream where the results of xmlMessage is written Updates npercentdone[nstatusfield] after obtaining lock on lockpd

Throws:
java.io.IOException

getValidAttributes

public java.util.HashSet getValidAttributes(java.lang.String szdataset)
                                     throws java.io.IOException
Gets a HashSet of valid attributes for the gene location

Throws:
java.io.IOException

updateGeneFile

public void updateGeneFile(java.lang.String species,
                           java.lang.String szoutfile,
                           int[] npercentdone,
                           int nstatusfield,
                           java.lang.Object lockpd)
                    throws java.io.IOException
Species is the name of the species to download the locations for. Updates npercentdone[nstatusfield] with status, first gets lock on lockpd

Throws:
java.io.IOException