public final class GATKReportTable
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GATKReportTable.Sorting |
protected static class |
GATKReportTable.TableDataHeaderFields |
protected static class |
GATKReportTable.TableNameHeaderFields |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INVALID_TABLE_NAME_REGEX
REGEX that matches any table with an invalid name
|
Constructor and Description |
---|
GATKReportTable(java.io.BufferedReader reader,
GATKReportVersion version)
Construct a new GATK report table from the reader
Note that the row ID mappings are just the index -> index
|
GATKReportTable(java.lang.String tableName,
java.lang.String tableDescription,
int numColumns)
Construct a new GATK report table with the specified name and description
Sorting will be done with
GATKReportTable.Sorting.SORT_BY_ROW |
GATKReportTable(java.lang.String tableName,
java.lang.String tableDescription,
int numColumns,
GATKReportTable.Sorting sortingWay)
Construct a new GATK report table with the specified name and description and whether to sort rows by the row ID.
|
Modifier and Type | Method and Description |
---|---|
void |
addColumn(java.lang.String columnName,
java.lang.String format)
Add a column to the report and the format string used to display the data.
|
void |
addRowID(java.lang.String ID,
boolean populateFirstColumn)
Add a mapping from ID to the index of a new row added to the table.
|
void |
addRowIDMapping(java.lang.Object ID,
int index,
boolean populateFirstColumn)
Add a mapping from ID to row index.
|
void |
addRowIDMapping(java.lang.String ID,
int index)
Add a mapping from ID to row index.
|
void |
concat(GATKReportTable table)
Concatenates the rows from the table to this one
|
boolean |
equals(GATKReportTable table)
Checks that the tables are exactly the same.
|
java.lang.Object |
get(int rowIndex,
int columnIndex)
Get a value from the given position in the table
|
java.lang.Object |
get(int rowIndex,
java.lang.String columnName)
Get a value from the given position in the table
|
java.lang.Object |
get(java.lang.Object rowID,
java.lang.String columnName)
Get a value from the given position in the table
|
java.util.List<GATKReportColumn> |
getColumnInfo() |
int |
getNumColumns() |
int |
getNumRows() |
java.lang.Object[] |
getRow(int rowIndex)
Get entire row from the given row index in the table
|
java.lang.String |
getTableDescription() |
java.lang.String |
getTableName() |
void |
increment(java.lang.Object rowID,
java.lang.String columnName)
Increment the value for a given position in the table.
|
boolean |
isSameFormat(GATKReportTable table)
Returns whether or not the two tables have the same format including columns and everything in between.
|
void |
set(int rowIndex,
int colIndex,
java.lang.Object value)
Set the value for a given position in the table.
|
void |
set(java.lang.Object rowID,
java.lang.String columnName,
java.lang.Object value)
Set the value for a given position in the table.
|
public static final java.lang.String INVALID_TABLE_NAME_REGEX
public GATKReportTable(java.io.BufferedReader reader, GATKReportVersion version)
reader
- the readerversion
- the GATK report versionpublic GATKReportTable(java.lang.String tableName, java.lang.String tableDescription, int numColumns)
GATKReportTable.Sorting.SORT_BY_ROW
tableName
- the name of the tabletableDescription
- the description of the tablenumColumns
- the number of columns in this tablepublic GATKReportTable(java.lang.String tableName, java.lang.String tableDescription, int numColumns, GATKReportTable.Sorting sortingWay)
tableName
- the name of the tabletableDescription
- the description of the tablenumColumns
- the number of columns in this tablesortingWay
- in what way to sort rows (instead of the order in which they were added)public void addRowID(java.lang.String ID, boolean populateFirstColumn)
ID
- the unique IDpopulateFirstColumn
- should we automatically populate the first column with the row's ID?public void addRowIDMapping(java.lang.String ID, int index)
ID
- the unique IDindex
- the index associated with the IDpublic void addRowIDMapping(java.lang.Object ID, int index, boolean populateFirstColumn)
ID
- the unique IDindex
- the index associated with the IDpopulateFirstColumn
- should we automatically populate the first column with the row's ID?public void addColumn(java.lang.String columnName, java.lang.String format)
columnName
- the name of the columnformat
- the format string used to display datapublic void set(java.lang.Object rowID, java.lang.String columnName, java.lang.Object value)
rowID
- the row IDcolumnName
- the name of the columnvalue
- the value to setpublic void set(int rowIndex, int colIndex, java.lang.Object value)
rowIndex
- the row indexcolIndex
- the column indexvalue
- the value to setpublic void increment(java.lang.Object rowID, java.lang.String columnName)
rowID
- the row IDcolumnName
- the name of the columnpublic java.lang.Object get(java.lang.Object rowID, java.lang.String columnName)
rowID
- the row IDcolumnName
- the name of the columnpublic java.lang.Object[] getRow(int rowIndex)
rowIndex
- the index of the columnpublic java.lang.Object get(int rowIndex, java.lang.String columnName)
rowIndex
- the row IDcolumnName
- the name of the columnpublic java.lang.Object get(int rowIndex, int columnIndex)
rowIndex
- the index of the rowcolumnIndex
- the index of the columnpublic int getNumRows()
public int getNumColumns()
public java.util.List<GATKReportColumn> getColumnInfo()
public java.lang.String getTableName()
public java.lang.String getTableDescription()
public void concat(GATKReportTable table)
table
- another GATK tablepublic boolean isSameFormat(GATKReportTable table)
table
- another GATK tablepublic boolean equals(GATKReportTable table)
table
- another GATK report