Search in sources :

Example 6 with HaplotypePair

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();
}
Also used : HaplotypePair(org.dash.valid.gl.haplo.HaplotypePair) Locus(org.dash.valid.Locus)

Aggregations

HaplotypePair (org.dash.valid.gl.haplo.HaplotypePair)6 HaplotypePairSet (org.dash.valid.gl.haplo.HaplotypePairSet)5 HaplotypePairComparator (org.dash.valid.gl.haplo.HaplotypePairComparator)4 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 Locus (org.dash.valid.Locus)3 LinkageDisequilibriumGenotypeList (org.dash.valid.gl.LinkageDisequilibriumGenotypeList)3 Haplotype (org.dash.valid.gl.haplo.Haplotype)3 MultiLocusHaplotype (org.dash.valid.gl.haplo.MultiLocusHaplotype)3 DetectedDisequilibriumElement (org.dash.valid.report.DetectedDisequilibriumElement)3 HashMap (java.util.HashMap)2 List (java.util.List)2 DetectedLinkageFindings (org.dash.valid.report.DetectedLinkageFindings)2 EnumSet (java.util.EnumSet)1 Set (java.util.Set)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 LinkageElementsSet (org.dash.valid.LinkageElementsSet)1 RelativeFrequencyByRace (org.dash.valid.race.RelativeFrequencyByRace)1 RelativeFrequencyByRaceComparator (org.dash.valid.race.RelativeFrequencyByRaceComparator)1 RelativeFrequencyByRaceSet (org.dash.valid.race.RelativeFrequencyByRaceSet)1