Search in sources :

Example 6 with CommandLineParser

use of org.broadinstitute.barclay.argparser.CommandLineParser in project gatk by broadinstitute.

the class ReadInputArgumentCollectionTest method testOptionalIsOptional.

@Test
public void testOptionalIsOptional() {
    Object req = new Object() {

        @ArgumentCollection
        private ReadInputArgumentCollection ric = new OptionalReadInputArgumentCollection();
    };
    CommandLineParser clp = new CommandLineArgumentParser(req);
    String[] args = {};
    clp.parseArguments(System.out, args);
}
Also used : CommandLineArgumentParser(org.broadinstitute.barclay.argparser.CommandLineArgumentParser) CommandLineParser(org.broadinstitute.barclay.argparser.CommandLineParser) Test(org.testng.annotations.Test)

Example 7 with CommandLineParser

use of org.broadinstitute.barclay.argparser.CommandLineParser in project gatk by broadinstitute.

the class ReferenceInputArgumentCollectionTest method testOptionalIsOptional.

@Test
public void testOptionalIsOptional() {
    String[] args = {};
    WithOptionalReferenceCollection optional = new WithOptionalReferenceCollection();
    CommandLineParser clp = new CommandLineArgumentParser(optional);
    clp.parseArguments(System.out, args);
}
Also used : CommandLineArgumentParser(org.broadinstitute.barclay.argparser.CommandLineArgumentParser) CommandLineParser(org.broadinstitute.barclay.argparser.CommandLineParser) Test(org.testng.annotations.Test)

Example 8 with CommandLineParser

use of org.broadinstitute.barclay.argparser.CommandLineParser in project gatk by broadinstitute.

the class FeatureInputArgumentCollectionTest method testRequiredIsRequired.

@Test(expectedExceptions = CommandLineException.class)
public void testRequiredIsRequired() {
    Object req = new Object() {

        @ArgumentCollection
        private RequiredFeatureInputArgumentCollection ric = new RequiredFeatureInputArgumentCollection();
    };
    CommandLineParser clp = new CommandLineArgumentParser(req);
    String[] args = {};
    clp.parseArguments(System.out, args);
}
Also used : CommandLineArgumentParser(org.broadinstitute.barclay.argparser.CommandLineArgumentParser) CommandLineParser(org.broadinstitute.barclay.argparser.CommandLineParser) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 9 with CommandLineParser

use of org.broadinstitute.barclay.argparser.CommandLineParser in project gatk by broadinstitute.

the class IntervalArgumentCollectionTest method testOptionalIsOptional.

@Test
public void testOptionalIsOptional() {
    WithOptionalIntervals opt = new WithOptionalIntervals();
    CommandLineParser clp = new CommandLineArgumentParser(opt);
    String[] args = {};
    clp.parseArguments(System.out, args);
}
Also used : CommandLineArgumentParser(org.broadinstitute.barclay.argparser.CommandLineArgumentParser) CommandLineParser(org.broadinstitute.barclay.argparser.CommandLineParser) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 10 with CommandLineParser

use of org.broadinstitute.barclay.argparser.CommandLineParser in project gatk by broadinstitute.

the class GATKToolUnitTest method testBestSequenceDictionary_fromReads.

@Test
public void testBestSequenceDictionary_fromReads() throws Exception {
    final GATKTool tool = new TestGATKToolWithReads();
    final CommandLineParser clp = new CommandLineArgumentParser(tool);
    final File bamFile = new File(publicTestDir + "org/broadinstitute/hellbender/engine/reads_data_source_test1.bam");
    final String[] args = { "-I", bamFile.getCanonicalPath() };
    clp.parseArguments(System.out, args);
    tool.onStartup();
    //read the dict back in and compare to bam dict
    final SAMSequenceDictionary toolDict = tool.getBestAvailableSequenceDictionary();
    try (final SamReader open = SamReaderFactory.makeDefault().open(bamFile)) {
        final SAMSequenceDictionary bamDict = open.getFileHeader().getSequenceDictionary();
        toolDict.assertSameDictionary(bamDict);
        bamDict.assertSameDictionary(toolDict);
        Assert.assertEquals(toolDict, bamDict);
    }
}
Also used : SamReader(htsjdk.samtools.SamReader) CommandLineArgumentParser(org.broadinstitute.barclay.argparser.CommandLineArgumentParser) CommandLineParser(org.broadinstitute.barclay.argparser.CommandLineParser) File(java.io.File) IndexedFastaSequenceFile(htsjdk.samtools.reference.IndexedFastaSequenceFile) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Aggregations

CommandLineArgumentParser (org.broadinstitute.barclay.argparser.CommandLineArgumentParser)47 CommandLineParser (org.broadinstitute.barclay.argparser.CommandLineParser)47 Test (org.testng.annotations.Test)44 GATKReadFilterPluginDescriptor (org.broadinstitute.hellbender.cmdline.GATKPlugin.GATKReadFilterPluginDescriptor)25 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)13 File (java.io.File)11 IndexedFastaSequenceFile (htsjdk.samtools.reference.IndexedFastaSequenceFile)9 GATKRead (org.broadinstitute.hellbender.utils.read.GATKRead)7 SAMFileHeader (htsjdk.samtools.SAMFileHeader)6 SAMSequenceDictionary (htsjdk.samtools.SAMSequenceDictionary)6 ArrayList (java.util.ArrayList)6 List (java.util.List)3 ArgumentsBuilder (org.broadinstitute.hellbender.utils.test.ArgumentsBuilder)3 Assert (org.testng.Assert)3 SamReader (htsjdk.samtools.SamReader)2 VariantContext (htsjdk.variant.variantcontext.VariantContext)2 VCFFileReader (htsjdk.variant.vcf.VCFFileReader)2 Iterator (java.util.Iterator)2 Argument (org.broadinstitute.barclay.argparser.Argument)2 CommandLineProgramProperties (org.broadinstitute.barclay.argparser.CommandLineProgramProperties)2