IMPACT
Class ResultsSummary

java.lang.Object
  extended by IMPACT.ResultsSummary

public class ResultsSummary
extends java.lang.Object

Implementation of several methods to present a summary of results.
These are based in R output file, MSA file, and 3D location (created by user).

Author:
Emanuel Maldonado / Rute Fonseca (original python scripts)
See Also:
ResultsView, FileFormatConverter

Field Summary
static java.lang.String aminoacidLbl
          aminoacidLbl Label for column id indicating current AA of site
static java.lang.String domainLbl
          domainLbl Label for column id indicating domain of site
static java.lang.String truesiteLbl
          truesiteLbl Label for column id indicating true value of site
 
Constructor Summary
ResultsSummary(java.lang.String msaFile, java.lang.String msaFormat, java.lang.String csvRFile, java.lang.String domFile, java.lang.String outpFile, Utilities utilities)
          Initialize results summary.
 
Method Summary
 boolean buildSummary(java.lang.String selecColumn, java.lang.String selecLevel, boolean[] selecTaxa)
          Build Summary in CSV format (header and body).
 int countSelected(boolean[] selectedSeq)
          Count selected sequences.
 java.lang.Object[][] getMSATaxaNames()
          Get taxa names for table model deselected.
 boolean initResultsSummary()
          Initialize structures for MSA and CSV files.
Used after constructor.
 void summaryToFile()
          Write Summary to file.
Also creates a companion file for this file with extension '.rs.info', which provides the information used to build the summary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

truesiteLbl

public static final java.lang.String truesiteLbl
truesiteLbl Label for column id indicating true value of site

See Also:
Constant Field Values

aminoacidLbl

public static final java.lang.String aminoacidLbl
aminoacidLbl Label for column id indicating current AA of site

See Also:
Constant Field Values

domainLbl

public static final java.lang.String domainLbl
domainLbl Label for column id indicating domain of site

See Also:
Constant Field Values
Constructor Detail

ResultsSummary

public ResultsSummary(java.lang.String msaFile,
                      java.lang.String msaFormat,
                      java.lang.String csvRFile,
                      java.lang.String domFile,
                      java.lang.String outpFile,
                      Utilities utilities)
Initialize results summary.

Parameters:
msaFile - MSA file from which R results were produced.
msaFormat - MSA file format.
csvRFile - R resulting file, if not null or empty. (not from positive selection)
domFile - three dimensional structure file for adding 3D location, if not null or empty.
outpFile - output file where to write summary, if not null or empty.
utilities - utilities
Method Detail

initResultsSummary

public boolean initResultsSummary()
Initialize structures for MSA and CSV files.
Used after constructor.

Returns:
true if sucess; false, otherwise.

getMSATaxaNames

public java.lang.Object[][] getMSATaxaNames()
Get taxa names for table model deselected.

Returns:
table elements.

buildSummary

public boolean buildSummary(java.lang.String selecColumn,
                            java.lang.String selecLevel,
                            boolean[] selecTaxa)
Build Summary in CSV format (header and body).

Parameters:
selecColumn - column to use from where to produce summary.
selecLevel - summary limited to level.
selecTaxa - selected sequences.
Returns:
true if summary was successfully built; false, otherwise.

summaryToFile

public void summaryToFile()
Write Summary to file.
Also creates a companion file for this file with extension '.rs.info', which provides the information used to build the summary.

See Also:
buildSummary(java.lang.String, java.lang.String, boolean[])

countSelected

public int countSelected(boolean[] selectedSeq)
Count selected sequences.

Parameters:
selectedSeq - array of selected sequences.
Returns:
count.