methods.interologs.blast
Class BlastHitFileParser

java.lang.Object
  extended by methods.interologs.blast.BlastHitFileParser

public class BlastHitFileParser
extends Object

Contains static methods to parse hits from a BLAST hit file.

Note: The functions assume the output format generated by the -m 8 option in BLAST 2.x (tabular output).

This class is not instantiatble.

Author:
Jan Krumsiek

Method Summary
static BlastHits parseBlastHits(File hitfile)
          Parse BLAST hits from a given BLAST hit file in tabular format.
static BlastHits parseBlastHits(File hitfile, String organism1, String organism2)
          Parse BLAST hits from a given BLAST hit file in tabular format.
static BlastHits parseBlastHits(InputStream input)
          Parse BLAST hits from a given input stream.
static BlastHits parseBlastHits(InputStream input, String organism1, String organism2)
          Parse BLAST hits from a given input stream.
static BlastHits parseBlastHits(String hitfile)
          Parse BLAST hits from a given BLAST hit file in tabular format.
static BlastHits parseBlastHits(String hitfile, String organism1, String organism2)
          Parse BLAST hits from a given BLAST hit file in tabular format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseBlastHits

public static BlastHits parseBlastHits(String hitfile)
                                throws IOException,
                                       ProCopeException
Parse BLAST hits from a given BLAST hit file in tabular format.

Parameters:
hitfile - BLAST hit file
Returns:
BLAST hits read from the hit file
Throws:
IOException - if the file could not be opened
ProCopeException - if the BLAST hit file format is not valid

parseBlastHits

public static BlastHits parseBlastHits(String hitfile,
                                       String organism1,
                                       String organism2)
                                throws IOException,
                                       ProCopeException
Parse BLAST hits from a given BLAST hit file in tabular format. You can supply organism identifiers for each first and second protein of an edge. See also: ProteinManager

Parameters:
hitfile - BLAST hit file
organism1 - organism identifier for each first protein of an edge or null for no organism
organism2 - organism identifier for each second protein of an edge or null for no organism
Returns:
BLAST hits read from the hit file
Throws:
IOException - if the file could not be opened
ProCopeException - if the BLAST hit file format is not valid

parseBlastHits

public static BlastHits parseBlastHits(File hitfile)
                                throws IOException,
                                       ProCopeException
Parse BLAST hits from a given BLAST hit file in tabular format.

Parameters:
hitfile - BLAST hit file
Returns:
BLAST hits read from the hit file
Throws:
IOException - if the file could not be opened
ProCopeException - if the BLAST hit file format is not valid

parseBlastHits

public static BlastHits parseBlastHits(File hitfile,
                                       String organism1,
                                       String organism2)
                                throws IOException,
                                       ProCopeException
Parse BLAST hits from a given BLAST hit file in tabular format. You can supply organism identifiers for each first and second protein of an edge. See also: ProteinManager

Parameters:
hitfile - BLAST hit file
organism1 - organism identifier for each first protein of an edge or null for no organism
organism2 - organism identifier for each second protein of an edge or null for no organism
Returns:
BLAST hits read from the hit file
Throws:
IOException - if the file could not be opened
ProCopeException - if the BLAST hit file format is not valid

parseBlastHits

public static BlastHits parseBlastHits(InputStream input)
                                throws ProCopeException
Parse BLAST hits from a given input stream.

Parameters:
input - input stream from which the BLAST hits will be read
Returns:
BLAST hits read from the stream
Throws:
ProCopeException - if the BLAST hit file format is not valid

parseBlastHits

public static BlastHits parseBlastHits(InputStream input,
                                       String organism1,
                                       String organism2)
                                throws ProCopeException
Parse BLAST hits from a given input stream. You can supply organism identifiers for each first and second protein of an edge. See also: ProteinManager

Parameters:
input - input stream from which the BLAST hits will be read
organism1 - organism identifier for each first protein of an edge or null for no organism
organism2 - organism identifier for each second protein of an edge or null for no organism
Returns:
BLAST hits read from the stream
Throws:
ProCopeException - if the BLAST hit file format is not valid