Package org.broadinstitute.gatk.engine

Examples of org.broadinstitute.gatk.engine.GenomeAnalysisEngine


        final MalformedReadFilter filter = new MalformedReadFilter();

        final SAMFileHeader h = getHeader();
        final SAMDataSource ds =  getDataSource();

        final GenomeAnalysisEngine gae = new GenomeAnalysisEngine() {
            @Override
            public SAMFileHeader getSAMFileHeader() {
                return h;
            }
View Full Code Here


        final VCFHeader header = new VCFHeader();

        final Walker walker1 = new VCFHeaderTestWalker();
        final Walker walker2 = new VCFHeaderTest2Walker();

        final GenomeAnalysisEngine testEngine1 = new GenomeAnalysisEngine();
        testEngine1.setWalker(walker1);

        final GenomeAnalysisEngine testEngine2 = new GenomeAnalysisEngine();
        testEngine2.setWalker(walker2);

        final VCFHeaderLine line1 = GATKVCFUtils.getCommandLineArgumentHeaderLine(testEngine1, Collections.EMPTY_LIST);
        logger.warn(line1);
        Assert.assertNotNull(line1);
        Assert.assertEquals(line1.getKey(), GATKVCFUtils.GATK_COMMAND_LINE_KEY);
View Full Code Here

    private class ATDTestCommandLineProgram extends CommandLineProgram {
        public int execute() { return 0; }

        @Override
        public Collection<ArgumentTypeDescriptor> getArgumentTypeDescriptors() {
            final GenomeAnalysisEngine engine = new GenomeAnalysisEngine();
            return Arrays.asList( new SAMFileWriterArgumentTypeDescriptor(engine, System.out),
                    new OutputStreamArgumentTypeDescriptor(engine, System.out),
                    new VCFWriterArgumentTypeDescriptor(engine, System.out, null));
        }
View Full Code Here

        Assert.assertEquals(actual, data.expected, description);
    }

    @Test(expectedExceptions=UserException.BadArgumentValue.class)
    public void testExceptionUponLegacyIntervalSyntax() throws Exception {
        GenomeAnalysisEngine toolkit = new GenomeAnalysisEngine();
        toolkit.setGenomeLocParser(new GenomeLocParser(new CachingIndexedFastaSequenceFile(new File(BaseTest.hg19Reference))));

        // Attempting to use the legacy -L "interval1;interval2" syntax should produce an exception:
        IntervalBinding<Feature> binding = new IntervalBinding<Feature>("1;2");
        binding.getIntervals(toolkit);
    }
View Full Code Here

    /**
     * The initialize function.
     */
    public void initialize() {
        final GenomeAnalysisEngine toolkit = getToolkit();

        if ( toolkit != null )
            readTransformers = toolkit.getReadTransformers();

        //Sample names are case-insensitive
        final TreeSet<String> samplesToChoose = new TreeSet<>(new Comparator<String>() {
            @Override
            public int compare(String a, String b) {
                return a.compareToIgnoreCase(b);
            }
        });
        Collection<String> samplesFromFile;
        if (!sampleFile.isEmpty())  {
            samplesFromFile = SampleUtils.getSamplesFromFiles(sampleFile);
            samplesToChoose.addAll(samplesFromFile);
        }

        if (!sampleNames.isEmpty())
            samplesToChoose.addAll(sampleNames);

        random = GenomeAnalysisEngine.getRandomGenerator();

        if (toolkit != null) {
            final SAMFileHeader outputHeader = toolkit.getSAMFileHeader().clone();
            readGroupsToKeep = determineReadGroupsOfInterest(outputHeader, samplesToChoose);

            //If some read groups are to be excluded, remove them from the output header
            pruneReadGroups(outputHeader);

            //Add the program record (if appropriate) and set up the writer
            final boolean preSorted = true;
            if (toolkit.getArguments().BQSR_RECAL_FILE != null && !NO_PG_TAG ) {
                Utils.setupWriter(out, toolkit, outputHeader, preSorted, this, PROGRAM_RECORD_NAME);
            } else {
                out.writeHeader(outputHeader);
                out.setPresorted(preSorted);
            }
View Full Code Here

    @BeforeMethod
    public void doBefore() {
        header = ArtificialSAMUtils.createArtificialSamHeader(1, 1, 1000);
        genomeLocParser =new GenomeLocParser(header.getSequenceDictionary());

        engine = new GenomeAnalysisEngine();
        engine.setReferenceDataSource(refFile);
        engine.setGenomeLocParser(genomeLocParser);
       
        obj.initialize(engine, null);
    }
View Full Code Here

        catch(FileNotFoundException ex) {
            throw new UserException.CouldNotReadInputFile(refFile,ex);
        }
        genomeLocParser = new GenomeLocParser(ref);

        engine = new GenomeAnalysisEngine();
        engine.setReferenceDataSource(refFile);
        engine.setGenomeLocParser(genomeLocParser);
    }
View Full Code Here

        return record;
    }

    private List<LocusShardDataProvider> createDataProviders(TraverseActiveRegions traverseActiveRegions, final Walker walker, List<GenomeLoc> intervals, File bamFile) {
        GenomeAnalysisEngine engine = new GenomeAnalysisEngine();
        engine.setGenomeLocParser(genomeLocParser);

        Collection<SAMReaderID> samFiles = new ArrayList<SAMReaderID>();
        SAMReaderID readerID = new SAMReaderID(bamFile, new Tags());
        samFiles.add(readerID);

        SAMDataSource dataSource = new SAMDataSource(samFiles, new ThreadAllocation(), null, genomeLocParser,
                false,
                ValidationStringency.STRICT,
                null,
                null,
                new ValidationExclusion(),
                new ArrayList<ReadFilter>(),
                new ArrayList<ReadTransformer>(),
                false, (byte)30, false, true, null, IntervalMergingRule.ALL);

        engine.setReadsDataSource(dataSource);
        final Set<String> samples = SampleUtils.getSAMFileSamples(dataSource.getHeader());

        traverseActiveRegions.initialize(engine, walker);
        List<LocusShardDataProvider> providers = new ArrayList<LocusShardDataProvider>();
        for (Shard shard : dataSource.createShardIteratorOverIntervals(new GenomeLocSortedSet(genomeLocParser, intervals), new ActiveRegionShardBalancer())) {
View Full Code Here

    @BeforeClass
    public void setup() throws Exception {
        walker = new CountReads();
        exception = new IllegalArgumentException("javaException");
        engine = new GenomeAnalysisEngine();
        engine.setArguments(new GATKArgumentCollection());

        Properties awsProperties = new Properties();
        awsProperties.load(new FileInputStream(AWS_DOWNLOADER_CREDENTIALS_PROPERTIES_FILE));
        downloaderAccessKey = awsProperties.getProperty("accessKey");
View Full Code Here

        final Exception noException = null;
        final Exception javaException = new IllegalArgumentException("javaException");
        final Exception stingException = new ReviewedGATKException("GATKException");
        final Exception userException = new UserException("userException");

        final GenomeAnalysisEngine engine = new GenomeAnalysisEngine();
        engine.setArguments(new GATKArgumentCollection());

        for ( final Walker walker : Arrays.asList(readWalker, lociWalker, rodWalker, artWalker) ) {
            for ( final Exception exception : Arrays.asList(noException,  javaException, stingException, userException) ) {
                tests.add(new Object[]{walker, exception, engine});
            }
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.engine.GenomeAnalysisEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.