Bug fix: AlleleCount stratification in VariantEval didn't support higher ploidy and was producing bad tables
This commit is contained in:
parent
dcd31e654d
commit
ab8fa8f359
|
|
@ -171,6 +171,9 @@ public class VariantEval extends RodWalker<Integer, Integer> implements TreeRedu
|
|||
@Argument(shortName="mvq", fullName="mendelianViolationQualThreshold", doc="Minimum genotype QUAL score for each trio member required to accept a site as a violation. Default is 50.", required=false)
|
||||
protected double MENDELIAN_VIOLATION_QUAL_THRESHOLD = 50;
|
||||
|
||||
@Argument(shortName="ploidy", fullName="samplePloidy", doc="Per-sample ploidy (number of chromosomes per sample)", required=false)
|
||||
protected int ploidy = VariantContextUtils.DEFAULT_PLOIDY;
|
||||
|
||||
@Argument(fullName="ancestralAlignments", shortName="aa", doc="Fasta file with ancestral alleles", required=false)
|
||||
private File ancestralAlignmentsFile = null;
|
||||
|
||||
|
|
@ -574,6 +577,7 @@ public class VariantEval extends RodWalker<Integer, Integer> implements TreeRedu
|
|||
|
||||
public double getMinPhaseQuality() { return MIN_PHASE_QUALITY; }
|
||||
|
||||
public int getSamplePloidy() { return ploidy; }
|
||||
public double getMendelianViolationQualThreshold() { return MENDELIAN_VIOLATION_QUAL_THRESHOLD; }
|
||||
|
||||
public static String getAllSampleName() { return ALL_SAMPLE_NAME; }
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ public class AlleleCount extends VariantStratifier {
|
|||
if ( getVariantEvalWalker().getEvals().size() != 1 && !getVariantEvalWalker().mergeEvals )
|
||||
throw new UserException.BadArgumentValue("AlleleCount", "AlleleCount stratification only works with a single eval vcf");
|
||||
|
||||
// There are 2 x n sample chromosomes for diploids
|
||||
// There are ploidy x n sample chromosomes
|
||||
// TODO -- generalize to handle multiple ploidy
|
||||
nchrom = getVariantEvalWalker().getSampleNamesForEvaluation().size() * 2;
|
||||
nchrom = getVariantEvalWalker().getSampleNamesForEvaluation().size() * getVariantEvalWalker().getSamplePloidy();
|
||||
if ( nchrom < 2 )
|
||||
throw new UserException.BadArgumentValue("AlleleCount", "AlleleCount stratification requires an eval vcf with at least one sample");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue