use of org.nmdp.gl.Genotype in project ImmunogeneticDataTools by nmdp-bioinformatics.
the class LinkageDisequilibriumGenotypeList method decomposeMug.
private void decomposeMug() {
String locusVal = null;
Locus locus = null;
HashMap<String, Locus> locusMap = new HashMap<String, Locus>();
List<GenotypeList> genotypeLists = mug.getGenotypeLists();
for (GenotypeList gl : genotypeLists) {
List<Genotype> genotypes = gl.getGenotypes();
for (Genotype genotype : genotypes) {
List<Haplotype> haplotypes = genotype.getHaplotypes();
for (Haplotype haplotype : haplotypes) {
List<AlleleList> alleleLists = haplotype.getAlleleLists();
for (AlleleList alleleList : alleleLists) {
List<Allele> alleles = alleleList.getAlleles();
List<String> alleleStrings = new ArrayList<String>();
for (Allele allele : alleles) {
alleleStrings.add(allele.getGlstring());
locusVal = allele.getLocus().toString();
}
if (locusMap.containsKey(locusVal)) {
locus = locusMap.get(locusVal);
} else {
locus = Locus.normalizeLocus(Locus.lookup(locusVal));
locusMap.put(locusVal, locus);
}
setAlleles(locus, alleleStrings);
}
}
}
}
}
Aggregations