use of org.dash.valid.gl.haplo.Haplotype in project ImmunogeneticDataTools by nmdp-bioinformatics.
the class LinkageDisequilibriumAnalyzer method detectLinkages.
/**
* @param glStrings
* @throws IOException
* @throws SecurityException
*/
private static List<Sample> detectLinkages(List<LinkageDisequilibriumGenotypeList> glStrings) {
List<Sample> samplesList = new ArrayList<Sample>();
int idx = 1;
for (LinkageDisequilibriumGenotypeList linkedGLString : glStrings) {
List<Haplotype> knownHaplotypes = GLStringUtilities.buildHaplotypes(linkedGLString);
LOGGER.info("Processing gl string " + idx + " of " + glStrings.size() + " (" + (idx * 100) / glStrings.size() + "%)");
idx++;
if (knownHaplotypes.size() > 0) {
samplesList.add(HLALinkageDisequilibrium.hasLinkageDisequilibrium(linkedGLString, knownHaplotypes));
} else {
boolean homozygousOnly = Boolean.TRUE.equals(new Boolean(System.getProperty("org.dash.homozygous"))) ? Boolean.TRUE : Boolean.FALSE;
if (!linkedGLString.checkAmbiguitiesThresholds()) {
LOGGER.info("GL String contains an unusual number of ambiguities, proteins and/or uncommon alleles");
}
if (homozygousOnly && !linkedGLString.hasHomozygous(LinkagesLoader.getInstance().getLoci())) {
LOGGER.info("Only checking for homozygous. GL String contains no homozygous typings for the loci in question. Bypassing record.");
continue;
}
samplesList.add(detectLinkages(linkedGLString));
}
}
return samplesList;
}
Aggregations