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

VCF Tranche filtering in java #4800

Merged
merged 3 commits into from
Jun 21, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected void onStartup() {

@Override
protected Object doWork() {
final Resource pythonScriptResource = new Resource("training.py", FilterVariantTranches.class);
final Resource pythonScriptResource = new Resource("training.py", CNNVariantTrain.class);
List<String> arguments = new ArrayList<>(Arrays.asList(
"--data_dir", inputTensorDir,
"--output_dir", outputDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected void onStartup() {

@Override
protected Object doWork() {
final Resource pythonScriptResource = new Resource("training.py", FilterVariantTranches.class);
final Resource pythonScriptResource = new Resource("training.py", CNNVariantWriteTensors.class);
List<String> arguments = new ArrayList<>(Arrays.asList(
"--reference_fasta", reference,
"--input_vcf", inputVcf,
Expand Down

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ public void testTranches() {
args.add("FilterVariantTranches")
.addArgument(StandardArgumentDefinitions.VARIANT_LONG_NAME, trancheVCF)
.addArgument(StandardArgumentDefinitions.OUTPUT_LONG_NAME, outputVCF.getAbsolutePath())
.addArgument("snp-truth-vcf", snpTruthVCF)
.addArgument("indel-truth-vcf", indelTruthVCF)
.addArgument("resource", snpTruthVCF)
.addArgument("resource", indelTruthVCF)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test doesn't really need to be assigned to the python group anymore.

.addArgument("tranche", "99.0")
.addArgument("tranche", "95.0")
.addArgument("max-sites", "2000")
.addArgument("info-key", "VQSLOD");

new Main().instanceMain(args.getArgsArray());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package org.broadinstitute.hellbender.tools.walkers.vqsr;

import org.broadinstitute.hellbender.CommandLineProgramTest;
import org.broadinstitute.hellbender.utils.test.ArgumentsBuilder;
import org.broadinstitute.hellbender.utils.test.IntegrationTestSpec;
import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions;

import org.testng.annotations.Test;

import java.util.Arrays;
import java.io.IOException;

public class FilterVariantTranchesIntegrationTest extends CommandLineProgramTest {


/**
* Run the tool on a small test VCF.
*/
@Test
public void testTrancheFiltering() throws IOException {
final String trancheVCF = largeFileTestDir + "VQSR/g94982_20_1m_10m_python_2dcnn.vcf.gz";
final String indelTruthVCF = largeFileTestDir + "VQSR/ALL.wgs.indels_mills_devine_hg19_leftAligned_collapsed_double_hit.sites.20.1M-10M.vcf";
final String snpTruthVCF = largeFileTestDir + "VQSR/Omni25_sites_1525_samples.b37.20.1M-10M.vcf";

final ArgumentsBuilder argsBuilder = new ArgumentsBuilder();
argsBuilder.addArgument(StandardArgumentDefinitions.VARIANT_LONG_NAME, trancheVCF)
.addArgument(StandardArgumentDefinitions.OUTPUT_LONG_NAME, "%s")
.addArgument("resource", snpTruthVCF)
.addArgument("resource", indelTruthVCF)
.addArgument("tranche", "99.0")
.addArgument("info-key", "MIX_SMALL_2D_W_DROPOUT")
.addArgument(StandardArgumentDefinitions.ADD_OUTPUT_VCF_COMMANDLINE, "false");

final IntegrationTestSpec spec = new IntegrationTestSpec(argsBuilder.toString(),
Arrays.asList(largeFileTestDir + "VQSR/expected/g94982_20_1m_10m_tranched_99.vcf"));
spec.executeTest("testTrancheFiltering", this);

}

@Test
public void testTrancheFilteringDuplicate() throws IOException {
final String trancheVCF = largeFileTestDir + "VQSR/g94982_20_1m_10m_python_2dcnn.vcf.gz";
final String indelTruthVCF = largeFileTestDir + "VQSR/ALL.wgs.indels_mills_devine_hg19_leftAligned_collapsed_double_hit.sites.20.1M-10M.vcf";
final String snpTruthVCF = largeFileTestDir + "VQSR/Omni25_sites_1525_samples.b37.20.1M-10M.vcf";

final ArgumentsBuilder argsBuilder = new ArgumentsBuilder();
argsBuilder.addArgument(StandardArgumentDefinitions.VARIANT_LONG_NAME, trancheVCF)
.addArgument(StandardArgumentDefinitions.OUTPUT_LONG_NAME, "%s")
.addArgument("resource", snpTruthVCF)
.addArgument("resource", indelTruthVCF)
.addArgument("tranche", "99.0")
.addArgument("tranche", "99.0")
.addArgument("info-key", "MIX_SMALL_2D_W_DROPOUT")
.addArgument(StandardArgumentDefinitions.ADD_OUTPUT_VCF_COMMANDLINE, "false");

final IntegrationTestSpec spec = new IntegrationTestSpec(argsBuilder.toString(),
Arrays.asList(largeFileTestDir + "VQSR/expected/g94982_20_1m_10m_tranched_99.vcf"));
spec.executeTest("testTrancheFilteringDuplicate", this);
}

@Test
public void testTrancheFilteringTranches() throws IOException {
final String trancheVCF = largeFileTestDir + "VQSR/g94982_20_1m_10m_python_2dcnn.vcf.gz";
final String indelTruthVCF = largeFileTestDir + "VQSR/ALL.wgs.indels_mills_devine_hg19_leftAligned_collapsed_double_hit.sites.20.1M-10M.vcf";
final String snpTruthVCF = largeFileTestDir + "VQSR/Omni25_sites_1525_samples.b37.20.1M-10M.vcf";

final ArgumentsBuilder argsBuilder = new ArgumentsBuilder();
argsBuilder.addArgument(StandardArgumentDefinitions.VARIANT_LONG_NAME, trancheVCF)
.addArgument(StandardArgumentDefinitions.OUTPUT_LONG_NAME, "%s")
.addArgument("resource", snpTruthVCF)
.addArgument("resource", indelTruthVCF)
.addArgument("tranche", "95.0")
.addArgument("tranche", "99.0")
.addArgument("tranche", "99.9")
.addArgument("info-key", "MIX_SMALL_2D_W_DROPOUT")
.addArgument(StandardArgumentDefinitions.ADD_OUTPUT_VCF_COMMANDLINE, "false");

final IntegrationTestSpec spec = new IntegrationTestSpec(argsBuilder.toString(),
Arrays.asList(largeFileTestDir + "VQSR/expected/g94982_20_1m_10m_tranched_95_99_99.9.vcf"));
spec.executeTest("testTrancheFilteringTranches", this);
}

@Test
public void testTrancheFilteringTranchesOrder() throws IOException {
final String trancheVCF = largeFileTestDir + "VQSR/g94982_20_1m_10m_python_2dcnn.vcf.gz";
final String indelTruthVCF = largeFileTestDir + "VQSR/ALL.wgs.indels_mills_devine_hg19_leftAligned_collapsed_double_hit.sites.20.1M-10M.vcf";
final String snpTruthVCF = largeFileTestDir + "VQSR/Omni25_sites_1525_samples.b37.20.1M-10M.vcf";
final ArgumentsBuilder argsBuilder = new ArgumentsBuilder();
argsBuilder.addArgument(StandardArgumentDefinitions.VARIANT_LONG_NAME, trancheVCF)
.addArgument(StandardArgumentDefinitions.OUTPUT_LONG_NAME, "%s")
.addArgument("resource", snpTruthVCF)
.addArgument("resource", indelTruthVCF)
.addArgument("tranche", "99.9")
.addArgument("tranche", "95.0")
.addArgument("tranche", "99.0")
.addArgument("info-key", "MIX_SMALL_2D_W_DROPOUT")
.addArgument(StandardArgumentDefinitions.ADD_OUTPUT_VCF_COMMANDLINE, "false");

final IntegrationTestSpec spec = new IntegrationTestSpec(argsBuilder.toString(),
Arrays.asList(largeFileTestDir + "VQSR/expected/g94982_20_1m_10m_tranched_95_99_99.9.vcf"));
spec.executeTest("testTrancheFilteringTranchesOrder", this);
}

}
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown