use of org.broadinstitute.hellbender.cmdline.GATKPlugin.GATKReadFilterPluginDescriptor in project gatk by broadinstitute.
the class ReadFilterPluginUnitTest method testDisabledDefaultWithArgsNotProvided.
@Test
public void testDisabledDefaultWithArgsNotProvided() {
// test for disabling a default filter that has arguments, but they are not provided
GATKReadFilterPluginDescriptor rfDesc = new GATKReadFilterPluginDescriptor(Collections.singletonList(new ReadLengthReadFilter(1, 10)));
CommandLineParser clp = new CommandLineArgumentParser(new Object(), Collections.singletonList(rfDesc));
final String filterName = ReadLengthReadFilter.class.getSimpleName();
clp.parseArguments(nullMessageStream, new String[] { "-disableReadFilter", filterName });
// Make sure ReadLengthReadFilter got disabled without an exception
Assert.assertTrue(rfDesc.userArgs.getUserDisabledReadFilterNames().contains(filterName));
Assert.assertTrue(rfDesc.isDisabledFilter(filterName));
}
use of org.broadinstitute.hellbender.cmdline.GATKPlugin.GATKReadFilterPluginDescriptor in project gatk by broadinstitute.
the class ReadFilterPluginUnitTest method tesDisableNonExistentReadFilter.
@Test(expectedExceptions = CommandLineException.class)
public void tesDisableNonExistentReadFilter() {
final CommandLineParser clp = new CommandLineArgumentParser(new Object(), Collections.singletonList(new GATKReadFilterPluginDescriptor(null)));
clp.parseArguments(nullMessageStream, new String[] { "-disableReadFilter", "asdfasdf" });
}
use of org.broadinstitute.hellbender.cmdline.GATKPlugin.GATKReadFilterPluginDescriptor in project gatk by broadinstitute.
the class ReadFilterPluginUnitTest method testToolHasDefaultRequiredArgsNegative.
@Test(expectedExceptions = CommandLineException.MissingArgument.class)
public void testToolHasDefaultRequiredArgsNegative() {
CommandLineParser clp = new CommandLineArgumentParser(new Object(), Collections.singletonList(new GATKReadFilterPluginDescriptor(Collections.singletonList(new ReadGroupReadFilter()))));
// ReadGroupReadFilter has a required "keepReadGroup" arg; don't provide it and fail
String[] args = {};
clp.parseArguments(nullMessageStream, args);
}
use of org.broadinstitute.hellbender.cmdline.GATKPlugin.GATKReadFilterPluginDescriptor in project gatk by broadinstitute.
the class ReadFilterPluginUnitTest method testToolHasDefaultRequiredArgsPositive.
@Test(dataProvider = "testDefaultFilters")
public void testToolHasDefaultRequiredArgsPositive(final String[] args) {
CommandLineParser clp = new CommandLineArgumentParser(new Object(), Collections.singletonList(new GATKReadFilterPluginDescriptor(Collections.singletonList(new ReadGroupReadFilter()))));
clp.parseArguments(nullMessageStream, args);
SAMFileHeader samHeader = createHeaderWithReadGroups();
ReadFilter rf = instantiateFilter(clp, samHeader);
final GATKRead read = simpleGoodRead(samHeader);
// make sure the test read actually has this read group
Assert.assertEquals(read.getReadGroup(), readgroupName);
Assert.assertTrue(rf.test(read));
}
use of org.broadinstitute.hellbender.cmdline.GATKPlugin.GATKReadFilterPluginDescriptor in project gatk by broadinstitute.
the class ReadFilterPluginUnitTest method testEnableDisableConflict.
@Test(expectedExceptions = CommandLineException.class)
public void testEnableDisableConflict() {
CommandLineParser clp = new CommandLineArgumentParser(new Object(), Collections.singletonList(new GATKReadFilterPluginDescriptor(null)));
clp.parseArguments(nullMessageStream, new String[] { "--RF", "GoodCigarReadFilter", "--disableReadFilter", "GoodCigarReadFilter" });
}
Aggregations