org.forester.sdi
Class RIO

java.lang.Object
  extended by org.forester.sdi.RIO

public final class RIO
extends Object


Constructor Summary
RIO()
          Default constructor.
 
Method Summary
 int getBootstraps()
          Returns the numbers of trees analyzed.
 double getDistance(String name)
          Returns the distance to a sequences/taxa after a distance list file has been read in with readDistanceList(File).
 double getDistance(String name1, String name2)
           
 int getExtNodesOfAnalyzedGeneTrees()
          Returns the numbers of number of ext nodes in gene trees analyzed (after stripping).
 HashMap<String,Integer> getInferredOrthologs(String seq_name)
          Returns a HashMap containing the inferred orthologs of the external gene tree node with the sequence name seq_name.
 HashMap<String,Integer> getInferredSuperOrthologs(String seq_name)
          Returns a HashMap containing the inferred "super orthologs" of the external gene tree node with the sequence name seq_name.
 HashMap<String,Integer> getInferredUltraParalogs(String seq_name)
          Returns a HashMap containing the inferred "ultra paralogs" of the external gene tree node with the sequence name seq_name.
static String getOrder(int sort)
          Returns the order in which ortholog (o), "super ortholog" (s) and distance (d) are returned and sorted (priority of sort always goes from left to right), given sort.
static StringBuffer getOrderHelp()
           
 long getTime()
          Returns the time (in ms) needed to run "inferOrthologs".
 void inferOrthologs(File gene_trees_file, Phylogeny species_tree, String query)
          Infers the orthologs (as well the "super orthologs", the "subtree neighbors", and the "ultra paralogs") for each external node of the gene Trees in multiple tree File gene_trees_file (=output of PHYLIP NEIGHBOR, for example).
 ArrayList<String> inferredOrthologsToArrayList(String seq_name, double threshold_orthologs)
          Returns an ArrayList containg the names of orthologs of the PhylogenyNode with seq name seq_name.
 StringBuffer inferredOrthologsToString(String query_name, int sort, double threshold_orthologs, double threshold_subtreeneighborings)
          Returns a String containg the names of orthologs of the PhylogenyNode with seq name query_name.
 void inferredOrthologTableToFile(File outfile)
          Writes the orthologs for each external node of the gene trees to outfile in the form of a table.
 void inferredSuperOrthologTableToFile(File outfile)
          Writes the "super orthologs" for each external nodes of the gene trees to outfile in the form of a table.
 String inferredUltraParalogsToString(String query_name, boolean return_dists, double threshold_ultra_paralogs)
          Returns a String containg the names of orthologs of the PhylogenyNode with seq name query_name.
 void readDistanceMatrix(File matrix_file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RIO

public RIO()
Default constructor.

Method Detail

getBootstraps

public final int getBootstraps()
Returns the numbers of trees analyzed.

Returns:
the numbers of trees analyzed

getDistance

public final double getDistance(String name)
Returns the distance to a sequences/taxa after a distance list file has been read in with readDistanceList(File). Throws an exception if name is not found or if no list has been read in.

Parameters:
name - a sequence name

getDistance

public final double getDistance(String name1,
                                String name2)

getExtNodesOfAnalyzedGeneTrees

public final int getExtNodesOfAnalyzedGeneTrees()
Returns the numbers of number of ext nodes in gene trees analyzed (after stripping).

Returns:
number of ext nodes in gene trees analyzed (after stripping)

getInferredOrthologs

public final HashMap<String,Integer> getInferredOrthologs(String seq_name)
Returns a HashMap containing the inferred orthologs of the external gene tree node with the sequence name seq_name. Sequence names are the keys (String), numbers of observations are the values (Int). Orthologs are to be inferred by method "inferOrthologs". Throws an exception if seq_name is not found.

Parameters:
seq_name - sequence name of a external node of the gene trees
Returns:
HashMap containing the inferred orthologs (name(String)->value(Int))

getInferredSuperOrthologs

public final HashMap<String,Integer> getInferredSuperOrthologs(String seq_name)
Returns a HashMap containing the inferred "super orthologs" of the external gene tree node with the sequence name seq_name. Sequence names are the keys (String), numbers of observations are the values (Int). Super orthologs are to be inferred by method "inferOrthologs". Throws an exception if seq_name is not found.

Parameters:
seq_name - sequence name of a external node of the gene trees
Returns:
HashMap containing the inferred super orthologs (name(String)->value(Int))

getInferredUltraParalogs

public final HashMap<String,Integer> getInferredUltraParalogs(String seq_name)
Returns a HashMap containing the inferred "ultra paralogs" of the external gene tree node with the sequence name seq_name. Sequence names are the keys (String), numbers of observations are the values (Int). "ultra paralogs" are to be inferred by method "inferOrthologs". Throws an exception if seq_name is not found.

Parameters:
seq_name - sequence name of a external node of the gene trees
Returns:
HashMap containing the inferred ultra paralogs (name(String)->value(Int))

getTime

public long getTime()
Returns the time (in ms) needed to run "inferOrthologs". Final variable TIME needs to be set to true.

Returns:
time (in ms) needed to run method "inferOrthologs"

inferOrthologs

public void inferOrthologs(File gene_trees_file,
                           Phylogeny species_tree,
                           String query)
                    throws IOException
Infers the orthologs (as well the "super orthologs", the "subtree neighbors", and the "ultra paralogs") for each external node of the gene Trees in multiple tree File gene_trees_file (=output of PHYLIP NEIGHBOR, for example). Tallies how many times each sequence is (super-) orthologous towards the query. Tallies how many times each sequence is ultra paralogous towards the query. Tallies how many times each sequence is a subtree neighbor of the query. Gene duplications are inferred using SDI. Modifies its argument species_tree. Is a little faster than "inferOrthologs(File,Phylogeny)" since orthologs are only inferred for query.

To obtain the results use the methods listed below.

Parameters:
gene_trees_file - a File containing gene Trees in NH format, which is the result of performing a bootstrap analysis in PHYLIP
species_tree - a species Phylogeny, which has species names in its species fields
query - the sequence name of the squence whose orthologs are to be inferred
Throws:
IOException

inferredOrthologsToArrayList

public ArrayList<String> inferredOrthologsToArrayList(String seq_name,
                                                      double threshold_orthologs)
Returns an ArrayList containg the names of orthologs of the PhylogenyNode with seq name seq_name.

Parameters:
seq_name - sequence name of a external node of the gene trees
threshold_orthologs - the minimal number of observations for a a sequence to be reported as orthologous as percentage (0.0-100.0%)
Returns:
ArrayList containg the names of orthologs of the PhylogenyNode with seq name seq_name

inferredOrthologsToString

public StringBuffer inferredOrthologsToString(String query_name,
                                              int sort,
                                              double threshold_orthologs,
                                              double threshold_subtreeneighborings)
Returns a String containg the names of orthologs of the PhylogenyNode with seq name query_name. The String also contains how many times a particular ortholog has been observed.

The sort priority of this is determined by sort in the following manner:

Returns "-" if no putative orthologs have been found (given threshold_orthologs).

Orthologs are to be inferred by method "inferOrthologs".

(Last modified: 05/08/01)

Parameters:
query_name - sequence name of a external node of the gene trees
sort - order and sort priority
threshold_orthologs - the minimal number of observations for a a sequence to be reported as orthologous, in percents (0.0-100.0%)
threshold_subtreeneighborings - the minimal number of observations for a a sequence to be reported as orthologous, in percents (0.0-100.0%)
Returns:
String containing the inferred orthologs, String containing "-" if no orthologs have been found null in case of error
See Also:
inferOrthologs(File,Phylogeny,String), #inferOrthologs(Phylogeny[],Phylogeny), #inferOrthologs(File,Phylogeny), getOrder(int)

inferredOrthologTableToFile

public void inferredOrthologTableToFile(File outfile)
                                 throws IOException
Writes the orthologs for each external node of the gene trees to outfile in the form of a table. Orthologs are to be inferred by method "inferOrthologs". Overwrites without asking! (Last modified: 12/07/00)

Parameters:
outfile - the File to write to
Throws:
IOException

inferredSuperOrthologTableToFile

public void inferredSuperOrthologTableToFile(File outfile)
                                      throws IOException
Writes the "super orthologs" for each external nodes of the gene trees to outfile in the form of a table. Super orthologs are to be inferred by method "inferOrthologs". Overwrites without asking!

Parameters:
outfile - the File to write to
Throws:
IOException

inferredUltraParalogsToString

public String inferredUltraParalogsToString(String query_name,
                                            boolean return_dists,
                                            double threshold_ultra_paralogs)
Returns a String containg the names of orthologs of the PhylogenyNode with seq name query_name. The String also contains how many times a particular ortholog has been observed. Returns "-" if no putative orthologs have been found (given threshold_orthologs).

Orthologs are to be inferred by method "inferOrthologs".

Parameters:
query_name - sequence name of a external node of the gene trees
return_dists -
threshold_ultra_paralogs - between 1 and 100
Returns:
String containing the inferred orthologs, String containing "-" if no orthologs have been found null in case of error

readDistanceMatrix

public final void readDistanceMatrix(File matrix_file)
                              throws IOException
Throws:
IOException

getOrder

public static final String getOrder(int sort)
Returns the order in which ortholog (o), "super ortholog" (s) and distance (d) are returned and sorted (priority of sort always goes from left to right), given sort. For the meaning of sort

Parameters:
sort - determines order and sort priority
Returns:
String indicating the order
See Also:
inferredOrthologsToString(String,int,double,double)

getOrderHelp

public static final StringBuffer getOrderHelp()