Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created "variantcalling" test group and split them off from the rest of the integration tests for runtime purposes #4984

Merged
merged 3 commits into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
- TEST_TYPE=cloud UPLOAD=true
- TEST_TYPE=integration TEST_DOCKER=true TEST_VERBOSITY=minimal
- TEST_TYPE=unit TEST_DOCKER=true TEST_VERBOSITY=minimal
- TEST_TYPE=variantcalling TEST_DOCKER=true TEST_VERBOSITY=minimal
- TEST_TYPE=python TEST_DOCKER=true TEST_VERBOSITY=minimal
- RUN_CNV_GERMLINE_WDL=true
- RUN_CNV_SOMATIC_WDL=true
Expand Down
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,22 @@ test {
includeGroups 'cloud', 'bucket'
} else if (TEST_TYPE == "integration"){
include "**/*IntegrationTest.class"
excludeGroups "cloud", "bucket", "python", "funcotatorValidation"
excludeGroups "cloud", "bucket", "python", "funcotatorValidation", "variantcalling"
} else if (TEST_TYPE == "unit") {
exclude "**/*IntegrationTest.class"
excludeGroups "cloud", "bucket", "python", "funcotatorValidation", "variantcalling"
} else if (TEST_TYPE == "variantcalling") {
includeGroups "variantcalling"
excludeGroups "cloud", "bucket", "python", "funcotatorValidation"
} else if (TEST_TYPE == "spark") {
includeGroups "spark"
excludeGroups "cloud", "bucket", "python", "funcotatorValidation"
excludeGroups "cloud", "bucket", "python", "funcotatorValidation", "variantcalling"
} else if (TEST_TYPE == "python") {
includeGroups "python"
} else if (TEST_TYPE == "all"){
//include everything
} else {
excludeGroups "cloud", "bucket", "python", "funcotatorValidation"
excludeGroups "cloud", "bucket", "python", "funcotatorValidation", "variantcalling"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the variantcalling tests should not be excluded in the else clause here, since the intention of the else clause is to include all the "normal" (unit/integration) tests, I believe.

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import org.broadinstitute.hellbender.tools.walkers.haplotypecaller.HaplotypeCallerIntegrationTest;

@Test(groups = {"variantcalling"})
public class HaplotypeCallerSparkIntegrationTest extends CommandLineProgramTest {

private static final String TEST_FILES_DIR = toolsTestDir + "haplotypecaller/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

@Test(groups = {"variantcalling"})
public class HaplotypeCallerIntegrationTest extends CommandLineProgramTest {

public static final String TEST_FILES_DIR = toolsTestDir + "haplotypecaller/";
Expand Down Expand Up @@ -398,7 +399,7 @@ public void testBamoutOnGcs() {
innerTestBamoutProducesReasonablySizedOutput(bamOutput);
}

public void innerTestBamoutProducesReasonablySizedOutput(Path bamOutput) {
private void innerTestBamoutProducesReasonablySizedOutput(Path bamOutput) {
Utils.resetRandomGenerator();

// We will test that when running with -bamout over the testInterval, we produce
Expand Down Expand Up @@ -767,7 +768,50 @@ public void testMnps() throws Exception {
"-" + HaplotypeCallerArgumentCollection.MAX_MNP_DISTANCE_SHORT_NAME, Integer.toString(maxMnpDistance));
runCommandLine(args);

Mutect2IntegrationTest.checkMnpOutput(maxMnpDistance, outputVcf);
checkMnpOutput(maxMnpDistance, outputVcf);
}
}

// this is particular to our particular artificial MNP bam -- we extract a method in order to use it for HaplotypeCaller
private static void checkMnpOutput(int maxMnpDistance, File outputVcf) {
// note that for testing HaplotypeCaller GVCF mode we will always have the symbolic <NON REF> allele
final Map<Integer, List<String>> alleles = StreamSupport.stream(new FeatureDataSource<VariantContext>(outputVcf).spliterator(), false)
.collect(Collectors.toMap(VariantContext::getStart, vc -> vc.getAlternateAlleles().stream().filter(a -> !a.isSymbolic()).map(Allele::getBaseString).collect(Collectors.toList())));

// phased, two bases apart
if (maxMnpDistance < 2) {
Assert.assertEquals(alleles.get(10019968), Arrays.asList("G"));
Assert.assertEquals(alleles.get(10019970), Arrays.asList("G"));
} else {
Assert.assertEquals(alleles.get(10019968), Arrays.asList("GAG"));
Assert.assertTrue(!alleles.containsKey(10019970));
}

// adjacent and out of phase
Assert.assertEquals(alleles.get(10020229), Arrays.asList("A"));
Assert.assertEquals(alleles.get(10020230), Arrays.asList("G"));

// 4-substitution MNP w/ spacings 2, 3, 4
if (maxMnpDistance < 2) {
Assert.assertEquals(alleles.get(10020430), Arrays.asList("G"));
Assert.assertEquals(alleles.get(10020432), Arrays.asList("G"));
Assert.assertEquals(alleles.get(10020435), Arrays.asList("G"));
Assert.assertEquals(alleles.get(10020439), Arrays.asList("G"));
} else if (maxMnpDistance < 3) {
Assert.assertEquals(alleles.get(10020430), Arrays.asList("GAG"));
Assert.assertEquals(alleles.get(10020435), Arrays.asList("G"));
Assert.assertEquals(alleles.get(10020439), Arrays.asList("G"));
} else if (maxMnpDistance < 4) {
Assert.assertEquals(alleles.get(10020430), Arrays.asList("GAGTTG"));
Assert.assertEquals(alleles.get(10020439), Arrays.asList("G"));
} else {
Assert.assertEquals(alleles.get(10020430), Arrays.asList("GAGTTGTCTG"));
}

// two out of phase DNPs that overlap and have a base in common
if (maxMnpDistance > 0) {
Assert.assertEquals(alleles.get(10020680), Arrays.asList("TA"));
Assert.assertEquals(alleles.get(10020681), Arrays.asList("AT"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/**
* Created by David Benjamin on 2/17/17.
*/
@Test(groups = {"variantcalling"})
public class CreateSomaticPanelOfNormalsIntegrationTest extends CommandLineProgramTest {

private static final File PON_VCFS_DIR = new File(toolsTestDir, "mutect/createpon/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/**
* Created by davidben on 9/1/16.
*/
@Test(groups = {"variantcalling"})
public class Mutect2IntegrationTest extends CommandLineProgramTest {
// positions 10,000,000 - 11,000,000 of chr 20 and with most annotations removed
private static final File GNOMAD = new File(largeFileTestDir, "very-small-gnomad.vcf");
Expand Down Expand Up @@ -252,7 +253,7 @@ public void testMnps() throws Exception {
}

// this is particular to our particular artificial MNP bam -- we extract a method in order to use it for HaplotypeCaller
public static void checkMnpOutput(int maxMnpDistance, File outputVcf) {
private static void checkMnpOutput(int maxMnpDistance, File outputVcf) {
// note that for testing HaplotypeCaller GVCF mode we will always have the symbolic <NON REF> allele
final Map<Integer, List<String>> alleles = StreamSupport.stream(new FeatureDataSource<VariantContext>(outputVcf).spliterator(), false)
.collect(Collectors.toMap(VariantContext::getStart, vc -> vc.getAlternateAlleles().stream().filter(a -> !a.isSymbolic()).map(Allele::getBaseString).collect(Collectors.toList())));
Expand Down