use of org.dash.valid.gl.haplo.HaplotypePair in project ImmunogeneticDataTools by nmdp-bioinformatics.
the class HaplotypePairWriter method formatDetectedLinkages.
public static String formatDetectedLinkages(DetectedLinkageFindings findings) {
StringBuffer sb = new StringBuffer("Id: " + findings.getGLId() + GLStringConstants.NEWLINE + "GL String: " + findings.getGLString());
sb.append(GLStringConstants.NEWLINE + GLStringConstants.NEWLINE + "HLA DB Version: " + findings.getHladb() + GLStringConstants.NEWLINE);
sb.append(GLStringConstants.NEWLINE + "Frequencies: " + findings.getFrequencies() + GLStringConstants.NEWLINE);
for (EnumSet<Locus> findingSought : findings.getFindingsSought()) {
if (findings.hasLinkedPairs(findingSought) && findings.getFirstPair(findingSought) != null) {
sb.append(GLStringConstants.NEWLINE + "First " + findingSought + " Haplotype pair:" + GLStringConstants.NEWLINE + findings.getFirstPair(findingSought));
} else {
sb.append(GLStringConstants.NEWLINE + "WARNING - No " + findingSought + " haplotype pairs detected." + GLStringConstants.NEWLINE);
}
}
for (HaplotypePair pair : findings.getLinkedPairs()) {
if (findings.getFirstPairs().contains(pair)) {
continue;
} else {
sb.append(GLStringConstants.NEWLINE + "Possible " + pair.getLoci() + " Haplotype Pair:" + GLStringConstants.NEWLINE);
}
sb.append(pair);
}
sb.append(GLStringConstants.NEWLINE + "***************************************" + GLStringConstants.NEWLINE);
return sb.toString();
}
Aggregations