예제 #1
0
 private int allele(BitSet bits, int bitsPerAllele, int sample) {
   if (sample >= samples.nSamples()) {
     throw new IndexOutOfBoundsException(String.valueOf(sample));
   }
   int start = bitsPerAllele * sample;
   int end = start + bitsPerAllele;
   int allele = 0;
   int mask = 1;
   for (int j = start; j < end; ++j) {
     if (bits.get(j)) {
       allele += mask;
     }
     mask <<= 1;
   }
   return allele;
 }
예제 #2
0
 @Override
 public int nHapPairs() {
   return samples.nSamples();
 }
예제 #3
0
 @Override
 public int nHaps() {
   return 2 * samples.nSamples();
 }