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:
  • Field Details

  • Constructor Details

  • 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