示例#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();
 }