Package org.snpsift.annotate.mem.dataFrame

# Class DataFrame

java.lang.Object
org.snpsift.annotate.mem.dataFrame.DataFrame

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `DataFrameDel`, `DataFrameIns`, `DataFrameMixed`, `DataFrameMnp`, `DataFrameOther`, `DataFrameSnp`

public class DataFrame extends Object implements Serializable
A set of DataColumns, indexed by position This is used to store data for a chromosome

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`MAX_ROWS_TO_SHOW`

## Constructor Summary

Constructors
Constructor
Description
`DataFrame(VariantTypeCounter variantTypeCounter, VariantCategory variantCategory, boolean hasRefs, boolean hasAlts)`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(DataFrameRow row)`
Add a row to the data frame
`void`
`check()`
`Iterable<String>`
`columnNames()`
`protected DataFrameColumn<?>`
`createColumn(org.snpeff.vcf.VcfHeaderInfo vcfHeaderInfo)`
Create a column of a given type
`protected void`
`createColumns()`
Create columns based on fields
`protected boolean`
`eq(int idx, int pos, String ref, String alt)`
Does the entry at possition 'idx' match the given (pos, ref, alt) values?
`protected int`
`find(int pos, String ref, String alt)`
Get data from a column index by searching by position, reference and alternative alleles.
`protected Object`
`get(String columnName, int idx)`
Get data from a column by searching by position, reference and alternative alleles.
`DataFrameColumn<?>`
`getColumn(String name)`
Get a column
`DataFrameRow`
`getRow(int pos, String ref, String alt)`
Get a 'row' from the data frame.
`boolean`
`hasEntry(int pos, String ref, String alt)`
Get data from a column by searching by position, reference and alternative alleles.
`void`
`resize()`
Resize and memory optimize the data
`protected void`
`set(String columnName, int idx, Object value)`
Set data in a column
`long`
`sizeBytes()`
Memory size of this object
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### MAX_ROWS_TO_SHOW

public static final int MAX_ROWS_TO_SHOW

See Also:
  - Constant Field Values

## Constructor Details

### DataFrame

public DataFrame(VariantTypeCounter variantTypeCounter, VariantCategory variantCategory, boolean hasRefs, boolean hasAlts)

## Method Details

### add

public void add(DataFrameRow row)
Add a row to the data frame

### check

public void check()

### columnNames

public Iterable<String> columnNames()

### createColumn

protected DataFrameColumn<?> createColumn(org.snpeff.vcf.VcfHeaderInfo vcfHeaderInfo)
Create a column of a given type

### createColumns

protected void createColumns()
Create columns based on fields

### eq

protected boolean eq(int idx, int pos, String ref, String alt)
Does the entry at possition 'idx' match the given (pos, ref, alt) values?

### get

protected Object get(String columnName, int idx)
Get data from a column by searching by position, reference and alternative alleles. Note: The value can be null

### getColumn

public DataFrameColumn<?> getColumn(String name)
Get a column

### getRow

public DataFrameRow getRow(int pos, String ref, String alt)
Get a 'row' from the data frame.

Parameters:
  `pos` - : Position
  `ref` - : Reference allele
  `alt` - : Alternative allele
Returns:
  A data frame row if found, or null if not found

### find

protected int find(int pos, String ref, String alt)
Get data from a column index by searching by position, reference and alternative alleles.

Returns:
  The index of the row in the data frame, or -1 if not found

### hasEntry

public boolean hasEntry(int pos, String ref, String alt)
Get data from a column by searching by position, reference and alternative alleles. Note: The value can be null

### resize

public void resize()
Resize and memory optimize the data

### set

protected void set(String columnName, int idx, Object value)
Set data in a column

### sizeBytes

public long sizeBytes()
Memory size of this object

### toString

public String toString()

Overrides:
  `toString` in class `Object`