protected ObjectArrayList<? extends GenotypeCount> getAllCounts(BaseInformationRecords.BaseInformationOrBuilder record, GenotypeCountFactory factory, boolean isTumor, boolean sort) {
int sampleIndex = isTumor ? 1 : 0;
ObjectArrayList<GenotypeCount> list = new ObjectArrayList<>();
int genotypeIndex = 0;
for (int i = 0; i < record.getSamples(0).getCountsCount(); i++) {
int germCount = record.getSamples(0).getCounts(i).getGenotypeCountForwardStrand() + record.getSamples(0).getCounts(i).getGenotypeCountReverseStrand();
BaseInformationRecords.CountInfo genoInfo = record.getSamples(sampleIndex).getCounts(i);
int forwCount = genoInfo.getGenotypeCountForwardStrand();
int revCount = genoInfo.getGenotypeCountReverseStrand();
GenotypeCount count = factory.create();
count.set(forwCount, revCount, genoInfo.getToSequence(), i, germCount);
initializeCount(record.getSamples(sampleIndex).getCounts(i), count);
list.add(count);
}
int genotypeIndexFor_Ns = N_GENOTYPE_INDEX;
while (list.size() < MAX_GENOTYPES) {
final GenotypeCount genotypeCount = getGenotypeCountFactory().create();
genotypeCount.set(0, 0, "N", genotypeIndexFor_Ns, 0);
list.add(genotypeCount);
}
if (sort) {
Collections.sort(list);
}
list.trim(MAX_GENOTYPES);
return list;
}