Search in sources :

Example 6 with Haplotype

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;
}
Also used : LinkageDisequilibriumGenotypeList(org.dash.valid.gl.LinkageDisequilibriumGenotypeList) ArrayList(java.util.ArrayList) Haplotype(org.dash.valid.gl.haplo.Haplotype)

Aggregations

Haplotype (org.dash.valid.gl.haplo.Haplotype)6 LinkageDisequilibriumGenotypeList (org.dash.valid.gl.LinkageDisequilibriumGenotypeList)4 MultiLocusHaplotype (org.dash.valid.gl.haplo.MultiLocusHaplotype)4 ArrayList (java.util.ArrayList)3 HaplotypePair (org.dash.valid.gl.haplo.HaplotypePair)3 HaplotypePairComparator (org.dash.valid.gl.haplo.HaplotypePairComparator)3 HaplotypePairSet (org.dash.valid.gl.haplo.HaplotypePairSet)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Locus (org.dash.valid.Locus)2 DetectedDisequilibriumElement (org.dash.valid.report.DetectedDisequilibriumElement)2 Test (org.junit.Test)2 List (java.util.List)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 Sample (org.dash.valid.Sample)1 SingleLocusHaplotype (org.dash.valid.gl.haplo.SingleLocusHaplotype)1 DetectedLinkageFindings (org.dash.valid.report.DetectedLinkageFindings)1