From c7dcc2b53bba03a2024919b467316a60dadc9de9 Mon Sep 17 00:00:00 2001 From: Menachem Fromer Date: Mon, 6 May 2013 15:47:27 -0400 Subject: [PATCH] Fix to deal with multi-generational families being allowed if only one level (one 'trio', effectively) appears in the VCF --- .../gatk/walkers/phasing/PhaseByTransmission.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java index 87e9a6ea0..7bbc4e981 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/phasing/PhaseByTransmission.java @@ -478,6 +478,16 @@ public class PhaseByTransmission extends RodWalker, HashMa ArrayList parents; for(Map.Entry> familyEntry : families.entrySet()){ family = familyEntry.getValue(); + + // Since getFamilies(vcfSamples) above still returns parents of samples in the VCF even if those parents are not in the VCF, need to subset down here: + Set familyMembersInVCF = new TreeSet(); + for(Sample familyMember : family){ + if (vcfSamples.contains(familyMember.getID())) { + familyMembersInVCF.add(familyMember); + } + } + family = familyMembersInVCF; + if(family.size()<2 || family.size()>3){ logger.info(String.format("Caution: Family %s has %d members; At the moment Phase By Transmission only supports trios and parent/child pairs. Family skipped.",familyEntry.getKey(),family.size())); } @@ -488,8 +498,7 @@ public class PhaseByTransmission extends RodWalker, HashMa if(family.containsAll(parents)) this.trios.add(familyMember); else - logger.info(String.format("Caution: Family %s skipped as it is not a trio nor a parent/child pair; At the moment Phase By Transmission only supports trios and parent/child pairs. Family skipped.",familyEntry.getKey())); - break; + logger.info(String.format("Caution: Child %s of family %s skipped as info is not provided as a complete trio nor a parent/child pair; At the moment Phase By Transmission only supports trios and parent/child pairs. Child skipped.", familyMember.getID(), familyEntry.getKey())); } } }