bug fixes
This commit is contained in:
parent
f26ffeaea0
commit
bb85f232b9
|
|
@ -326,15 +326,11 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
|
|||
}
|
||||
else {
|
||||
if (SELECT_RANDOM_FRACTION && KEEP_AF_SPECTRUM ) {
|
||||
Collection<VariantContext> compVCs = tracker.getVariantContexts(ref, inputAFRodName, null, context.getLocation(), true, false);
|
||||
if (compVCs.isEmpty())
|
||||
return 0;
|
||||
|
||||
// ok we have a comp VC and we need to match the AF spectrum of inputAFRodName.
|
||||
// We then pick a variant with probablity AF*desiredFraction
|
||||
for (VariantContext compVC : compVCs) {
|
||||
if ( compVC.hasAttribute(VCFConstants.ALLELE_FREQUENCY_KEY) ) {
|
||||
String afo = compVC.getAttributeAsString(VCFConstants.ALLELE_FREQUENCY_KEY);
|
||||
|
||||
if ( sub.hasAttribute(VCFConstants.ALLELE_FREQUENCY_KEY) ) {
|
||||
String afo = sub.getAttributeAsString(VCFConstants.ALLELE_FREQUENCY_KEY);
|
||||
|
||||
double af;
|
||||
double afBoost = 1.0;
|
||||
|
|
@ -375,8 +371,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
|
|||
if (GenomeAnalysisEngine.getRandomGenerator().nextDouble() < fractionRandom * af * afBoost)
|
||||
vcfWriter.add(sub, ref.getBase());
|
||||
}
|
||||
break; // do only one vc
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue