diff --git a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariantsIntegrationTest.java b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariantsIntegrationTest.java index 5345130c2..a0e3f862b 100644 --- a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariantsIntegrationTest.java +++ b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariantsIntegrationTest.java @@ -66,17 +66,36 @@ public class LeftAlignAndTrimVariantsIntegrationTest extends WalkerTest { WalkerTestSpec spec = new WalkerTestSpec( "-T LeftAlignAndTrimVariants -o %s -R " + b37KGReference + " --variant:vcf " + privateTestDir + "forLeftAlignVariantsTest.vcf --no_cmdline_in_header", 1, - Arrays.asList("dd238fe14b4a495a489907c1e021221e")); + Arrays.asList("5d82f53b036d9a0fca170e5be68d5ab2")); executeTest("test left alignment", spec); } @Test - public void testLeftAlignmentWithTrimmingAndMultialleliecs() { + public void testLeftAlignmentDontTrim() { WalkerTestSpec spec = new WalkerTestSpec( - "-T LeftAlignAndTrimVariants -o %s -R " + b37KGReference + " --variant:vcf " + privateTestDir + "forHardLeftAlignVariantsTest.vcf --no_cmdline_in_header -trim -split", + "-T LeftAlignAndTrimVariants -o %s -R " + b37KGReference + " --variant:vcf " + privateTestDir + "forLeftAlignVariantsTest.vcf --dontTrimAlleles --no_cmdline_in_header", + 1, + Arrays.asList("dd238fe14b4a495a489907c1e021221e")); + executeTest("test left alignment, don't trim", spec); + } + + @Test + public void testLeftAlignmentWithMultialleliecs() { + WalkerTestSpec spec = new WalkerTestSpec( + "-T LeftAlignAndTrimVariants -o %s -R " + b37KGReference + " --variant:vcf " + privateTestDir + "forHardLeftAlignVariantsTest.vcf --no_cmdline_in_header -split", 1, Arrays.asList("534bea653d4a0e59e74f4107c1768558")); - executeTest("test left alignment with trimming and hard multiple alleles", spec); + executeTest("test left alignment with hard multiple alleles", spec); + + } + + @Test + public void testLeftAlignmentDontTrimWithMultialleliecs() { + WalkerTestSpec spec = new WalkerTestSpec( + "-T LeftAlignAndTrimVariants -o %s -R " + b37KGReference + " --variant:vcf " + privateTestDir + "forHardLeftAlignVariantsTest.vcf --dontTrimAlleles --no_cmdline_in_header -split", + 1, + Arrays.asList("189b8136ee62b54bf7b227e99c892440")); + executeTest("test left alignment with hard multiple alleles, don't trim", spec); } } diff --git a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariants.java b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariants.java index 70f73ac51..d62a944c9 100644 --- a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariants.java +++ b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/LeftAlignAndTrimVariants.java @@ -60,11 +60,12 @@ import java.util.*; * Left-align indels in a variant callset * *
- * LeftAlignAndTrimVariants is a tool that takes a VCF file and left-aligns the indels inside it. The same indel can often be - * placed at multiple positions and still represent the same haplotype. While the standard convention with VCF is to - * place an indel at the left-most position this doesn't always happen, so this tool can be used to left-align them. - * Note that this tool cannot handle anything other than bi-allelic, simple indels. Complex events are written out unchanged. - * Optionally, the tool will also trim common bases from indels, leaving them with a minimum representation.
+ * LeftAlignAndTrimVariants is a tool that takes a VCF file, left-aligns the indels and trims common bases from indels, + * leaving them with a minimum representation. The same indel can often be placed at multiple positions and still + * represent the same haplotype. While the standard convention with VCF is to place an indel at the left-most position + * this isn't always done, so this tool can be used to left-align them. This tool optionally splits multiallelic + * sites into biallelics and left-aligns individual alleles. Optionally, the tool will not trim common bases from indels. + * * *@@ -76,7 +77,9 @@ import java.util.*; * A left-aligned VCF. *
* - ** java -jar GenomeAnalysisTK.jar \ * -T LeftAlignAndTrimVariants \ @@ -85,6 +88,37 @@ import java.util.*; * -o output.vcf ** + *
+ * java -jar GenomeAnalysisTK.jar \ + * -T LeftAlignAndTrimVariants \ + * -R reference.fasta \ + * --variant input.vcf \ + * -o output.vcf + * --dontTrimAlleles + *+ * + *
+ * java -jar GenomeAnalysisTK.jar \ + * -T LeftAlignAndTrimVariants \ + * -R reference.fasta \ + * --variant input.vcf \ + * -o output.vcf + * --splitMultiallelics + *+ * + *
+ * java -jar GenomeAnalysisTK.jar \ + * -T LeftAlignAndTrimVariants \ + * -R reference.fasta \ + * --variant input.vcf \ + * -o output.vcf + * --splitMultiallelics + * --dontTrimAlleles + *+ * */ @DocumentedGATKFeature( groupName = HelpConstants.DOCS_CAT_VARMANIP, extraDocs = {CommandLineGATK.class} ) @Reference(window=@Window(start=-200,stop=200)) // WARNING: if this changes,MAX_INDEL_LENGTH needs to change as well! @@ -94,10 +128,10 @@ public class LeftAlignAndTrimVariants extends RodWalker