Class ShellDelegatingBlat

java.lang.Object
ubic.gemma.core.analysis.sequence.ShellDelegatingBlat
All Implemented Interfaces:
Blat

public class ShellDelegatingBlat extends Object implements Blat
Class to manage the gfServer and run BLAT searches. Delegates to the command-line shell to run blat.
Author:
pavlidis
  • Constructor Details

    • ShellDelegatingBlat

      public ShellDelegatingBlat()
      Create a blat object with settings read from the config file.
  • Method Details

    • getSearchedGenome

      public static ExternalDatabase getSearchedGenome(Taxon taxon)
    • blatQuery

      public List<BlatResult> blatQuery(BioSequence b) throws IOException
      Description copied from interface: Blat
      Run a BLAT search using the gfClient.
      Specified by:
      blatQuery in interface Blat
      Parameters:
      b - The genome is inferred from the Taxon held by the sequence.
      Returns:
      Collection of BlatResult objects.
      Throws:
      IOException - when there are IO problems.
    • blatQuery

      public List<BlatResult> blatQuery(BioSequence b, Taxon taxon, boolean sensitive) throws IOException
      Description copied from interface: Blat
      Run a BLAT search using the gfClient.
      Specified by:
      blatQuery in interface Blat
      Parameters:
      b - The genome is inferred from the Taxon held by the sequence.
      taxon - taxon
      sensitive - if true use the more sensitive gfServer, if available.
      Returns:
      Collection of BlatResult objects.
      Throws:
      IOException - when there are IO problems.
    • blatQuery

      public Map<BioSequence,List<BlatResult>> blatQuery(Collection<BioSequence> sequences, boolean sensitive, Taxon taxon) throws IOException
      Specified by:
      blatQuery in interface Blat
      Parameters:
      sequences - The genome is inferred from the Taxon held by the sequence.
      sensitive - if true use the more sensitive gfServer, if available.
      taxon - The taxon whose database will be searched.
      Returns:
      map of the input sequences to a corresponding collection of blat result(s)
      Throws:
      IOException - when there are IO problems.
    • blatQuery

      public Map<BioSequence,List<BlatResult>> blatQuery(Collection<BioSequence> sequences, Taxon taxon) throws IOException
      Specified by:
      blatQuery in interface Blat
      Throws:
      IOException
    • processPsl

      public List<BlatResult> processPsl(InputStream inputStream, Taxon taxon) throws IOException
      Process the output of a BLAT search in psl format.
      Parameters:
      inputStream - to the Blat output file in psl format
      taxon - taxon
      Returns:
      processed results.
      Throws:
      IOException - when there are IO problems.
    • startServer

      public void startServer(ShellDelegatingBlat.BlattableGenome genome, boolean sensitive, boolean waitForFullInitialization) throws IOException
      Start the server, if the port isn't already being used. If the port is in use, we assume it is a gfServer.
      Parameters:
      genome - genome
      waitForFullInitialization - if true, wait for the server to be fully initialized before returning, otherwise return immediately after starting the server.
      Throws:
      IOException - when there are IO problems.
    • isServerRunning

      public boolean isServerRunning()
      Check if the gfServer is running.
    • isServerReachable

      public boolean isServerReachable(ShellDelegatingBlat.BlattableGenome genome, boolean sensitive)
      Check if the gfServer for a given genome is reachable.
    • stopServer

      public void stopServer()
      Stop the gfServer, if it was started by this.