-
Notifications
You must be signed in to change notification settings - Fork 596
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
284 changes: 161 additions & 123 deletions
284
src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/FilterVariantTranches.java
Large diffs are not rendered by default.
Oops, something went wrong.
124 changes: 0 additions & 124 deletions
124
src/main/resources/org/broadinstitute/hellbender/tools/walkers/vqsr/tranches.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
...rg/broadinstitute/hellbender/tools/walkers/vqsr/FilterVariantTranchesIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
src/test/resources/large/VQSR/expected/g94982_20_1m_10m_tranched_95_99_99.9.vcf
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
src/test/resources/large/VQSR/expected/g94982_20_1m_10m_tranched_99.vcf
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
src/test/resources/large/VQSR/g94982_20_1m_10m_python_2dcnn.vcf.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions
3
src/test/resources/large/VQSR/g94982_20_1m_10m_python_2dcnn.vcf.gz.tbi
Git LFS file not shown
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.