Skip to content

Commit b0dcf74

Browse files
committed
last check
1 parent 78c226d commit b0dcf74

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/main/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ protected GenomicsDBOptions getGenomicsDBOptions() {
545545
return genomicsDBOptions;
546546
}
547547
// We do not output the vcf entries in the order they arrive, as trimming alleles may change the start position
548-
// (e.g. in an multiallelic site, see #6444).
548+
// (e.g. at a multiallelic site, see #6444).
549549
final private PriorityQueue<VariantContext> pendingVariants = new PriorityQueue<>(Comparator.comparingInt(VariantContext::getStart));
550550
/**
551551
* Set up the VCF writer, the sample expressions and regexs, filters inputs, and the JEXL matcher
@@ -578,7 +578,7 @@ public void onTraversalStart() {
578578
IntStream.range(0, selectGenotypeExpressions.size()).forEach(i -> selectGenotypeNames.add(String.format("genotype-select-%d", i)));
579579

580580
// These are maps of type (name, JEXL expression class)
581-
// Note that infoJexls could also contain JEXL expressions that access genotype fields via the VariantContext object vc
581+
// Note that infoJexls could also contain JEXL expressions that access genotype fields via the VariantContext object
582582
infoJexls = VariantContextUtils.initializeMatchExps(selectNames, selectExpressions);
583583
genotypeJexls = VariantContextUtils.initializeMatchExps(selectGenotypeNames, selectGenotypeExpressions);
584584

@@ -689,7 +689,7 @@ variant record locations can move to the right due to allele trimming if preserv
689689
// 2. the only remaining alternate allele is spanning deletion (*)
690690
// If this is the case, we call it a non-variant and remove it from the output based on {@code excludeNonVariants}
691691
if (excludeNonVariants) {
692-
// It would be cleaner to write "if (excludeNonVariants && nonVariant) {...}", but isPolymorphicInSamples() could be relatively expensive,
692+
// It would be cleaner to say "if (excludeNonVariants && nonVariant) {...}", but isPolymorphicInSamples() could be relatively expensive,
693693
// when we have many samples, so we call it only when excludeNonVariants is set to true.
694694
final boolean nonVariant = ! result.isPolymorphicInSamples() || GATKVariantContextUtils.isSpanningDeletionOnly(result);
695695
if (nonVariant) {
@@ -782,8 +782,7 @@ private boolean passesJexlFilters(final VariantContext vc){
782782
// Note that this is not equivalent to "!(AF > 0.01 || ReadPosRankSum < -20.0)"
783783

784784
// Notice here that calling the match method without the genotype g leads to genotype g being set to null,
785-
// which is fine since infoJexls should not refer to genotype fields (unless using vc.getGenotype(), in which case
786-
// JEXL can access genotype fields via vc)
785+
// which is fine since infoJexls should not refer to genotype fields (except via vc.getGenotype())
787786
if (invertLogic(VariantContextUtils.match(vc, jexl), invertSelect)){
788787
return true;
789788
}

src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariantsIntegrationTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,9 @@ public void testFORMATFieldGivenToSelect() {
695695

696696
@Test
697697
public void testSelectRandomFraction() {
698-
final File testOutput = createTempFile("jexl_genotype_info_test", "vcf");
699698
beforeJexlTest();
700-
699+
final File testOutput = createTempFile("jexl_genotype_info_test", "vcf");
700+
// There are 80 variants in this vcf
701701
final File inputVcf = getTestFile("tetraploid-multisample-sac.g.vcf");
702702
final int numInputVariants = VariantContextTestUtils.readEntireVCFIntoMemory(inputVcf.getAbsolutePath()).getRight().size();
703703
final double fractionToKeep = 0.5;

0 commit comments

Comments
 (0)