Fixed bug reported on the forum where using the --exclude_sample_file argument in SV was giving bad results.
Added integration test. https://www.pivotaltracker.com/s/projects/793457/stories/47399245
This commit is contained in:
parent
43f1746eb9
commit
360e2ba87e
|
|
@ -144,7 +144,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSampleExclusion() {
|
public void testSampleExclusionFromFileAndSeparateSample() {
|
||||||
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
|
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
|
||||||
String samplesFile = validationDataLocation + "SelectVariants.samples.txt";
|
String samplesFile = validationDataLocation + "SelectVariants.samples.txt";
|
||||||
|
|
||||||
|
|
@ -158,6 +158,21 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
|
||||||
executeTest("testSampleExclusion--" + testfile, spec);
|
executeTest("testSampleExclusion--" + testfile, spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSampleExclusionJustFromFile() {
|
||||||
|
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
|
||||||
|
String samplesFile = validationDataLocation + "SelectVariants.samples.txt";
|
||||||
|
|
||||||
|
WalkerTestSpec spec = new WalkerTestSpec(
|
||||||
|
"-T SelectVariants -R " + b36KGReference + " -L 1:1-1000000 -o %s --no_cmdline_in_header -xl_sf " + samplesFile + " --variant " + testfile,
|
||||||
|
1,
|
||||||
|
Arrays.asList("875d7e00ac8081e87ab9fb1b20c83677")
|
||||||
|
);
|
||||||
|
spec.disableShadowBCF();
|
||||||
|
|
||||||
|
executeTest("testSampleExclusion--" + testfile, spec);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSampleInclusionWithNonexistingSamples() {
|
public void testSampleInclusionWithNonexistingSamples() {
|
||||||
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
|
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
|
||||||
|
|
|
||||||
|
|
@ -377,10 +377,10 @@ public class SelectVariants extends RodWalker<Integer, Integer> implements TreeR
|
||||||
}
|
}
|
||||||
|
|
||||||
// now, exclude any requested samples
|
// now, exclude any requested samples
|
||||||
Collection<String> XLsamplesFromFile = SampleUtils.getSamplesFromFiles(XLsampleFiles);
|
final Collection<String> XLsamplesFromFile = SampleUtils.getSamplesFromFiles(XLsampleFiles);
|
||||||
samples.removeAll(XLsamplesFromFile);
|
samples.removeAll(XLsamplesFromFile);
|
||||||
samples.removeAll(XLsampleNames);
|
samples.removeAll(XLsampleNames);
|
||||||
NO_SAMPLES_SPECIFIED = NO_SAMPLES_SPECIFIED && XLsampleNames.isEmpty();
|
NO_SAMPLES_SPECIFIED = NO_SAMPLES_SPECIFIED && XLsampleNames.isEmpty() && XLsamplesFromFile.isEmpty();
|
||||||
|
|
||||||
if ( samples.size() == 0 && !NO_SAMPLES_SPECIFIED )
|
if ( samples.size() == 0 && !NO_SAMPLES_SPECIFIED )
|
||||||
throw new UserException("All samples requested to be included were also requested to be excluded.");
|
throw new UserException("All samples requested to be included were also requested to be excluded.");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue