Exemple #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;
 }
Exemple #2
0
 @Override
 public int nHapPairs() {
   return samples.nSamples();
 }
Exemple #3
0
 @Override
 public int nHaps() {
   return 2 * samples.nSamples();
 }