Class GenotypeVector

  • All Implemented Interfaces:
    java.io.Serializable

    public class GenotypeVector
    extends java.lang.Object
    implements java.io.Serializable
    A vector of genotypes in a 'compact' structure Note: Genotypes 0/0, 0/1, 1/0, 1/1 are stored in 2 bits. WARNIGN: Other genotypes are ignored or silently converted to 0/0
    Author:
    pcingola
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static byte[] mask  
      static byte[] reverseMask  
    • Constructor Summary

      Constructors 
      Constructor Description
      GenotypeVector​(int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int get​(int sampleNum)  
      void set​(int sampleNum, int code)
      Set genotype code Codes {0, 1, 2, 3} => Genotypes { 0/0, 0/1, 1/0, 1/1 }
      void set​(int sampleNum, VcfGenotype vg)
      Set genotype
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mask

        public static final byte[] mask
      • reverseMask

        public static final byte[] reverseMask
    • Constructor Detail

      • GenotypeVector

        public GenotypeVector​(int size)
    • Method Detail

      • get

        public int get​(int sampleNum)
      • set

        public void set​(int sampleNum,
                        int code)
        Set genotype code Codes {0, 1, 2, 3} => Genotypes { 0/0, 0/1, 1/0, 1/1 }
        Parameters:
        sampleNum -
        code -
      • set

        public void set​(int sampleNum,
                        VcfGenotype vg)
        Set genotype
        Parameters:
        sampleNum -
        vg -
      • size

        public int size()