Пример #1
0
        private static void VerifyFlow(List <ReadPair> reads, GeminiOptions geminiOptions, int expectedRegions)
        {
            var batchBlockFactory          = BatchBlockFactory();
            var classificationBlockFactory = new Mock <IClassificationBlockProvider>();
            var classifierBlockFactory     = ClassifierBlockFactory();
            var blockFactory = BlockFactory(batchBlockFactory, classifierBlockFactory, classificationBlockFactory);

            var alignments            = new List <BamAlignment>();
            var mockDataOutputFactory = DataflowMocks.MockDataOutputFactory(alignments);

            var mockReader            = DataflowMocks.MockReader();
            var mockReadPairSource    = DataflowMocks.MockDataSource(reads);
            var mockDataSourceFactory = DataflowMocks.MockDataSourceFactory(mockReader, mockReadPairSource);


            var dataflowEvaluator = new DataflowReadEvaluator(geminiOptions, mockDataSourceFactory.Object,
                                                              new GeminiSampleOptions()
            {
                OutputFolder = "outfoldersample"
            }, mockDataOutputFactory.Object, blockFactory.Object);

            dataflowEvaluator.ProcessBam();

            VerifyCallNumbers(batchBlockFactory, classifierBlockFactory, classificationBlockFactory, mockDataSourceFactory,
                              blockFactory, expectedRegions);
        }
Пример #2
0
        private static void Execute(List <BamAlignment> alignments, List <ReadPair> reads, GeminiOptions geminiOptions, StitcherOptions stitcherOptions, List <ReadPair> lonerpairs = null)
        {
            var mockOutcomesWriter    = new Mock <IOutcomesWriter>();
            var mockDataOutputFactory = DataflowMocks.MockDataOutputFactory(alignments);
            var mockTextWriter        = new Mock <ITextWriter>();

            mockDataOutputFactory.Setup(x => x.GetTextWriter(It.IsAny <string>()))
            .Returns(mockTextWriter.Object);
            var mockReader            = DataflowMocks.MockReader();
            var mockReadPairSource    = DataflowMocks.MockDataSource(reads, lonerpairs);
            var mockDataSourceFactory = DataflowMocks.MockDataSourceFactory(mockReader, mockReadPairSource);
            var mockSamtoolsWrapper   = new Mock <ISamtoolsWrapper>();
            var geminiSampleOptions   = new GeminiSampleOptions()
            {
                RefId = 1, OutputFolder = "OutFolder"
            };

            var geminiWorkflow = new GeminiWorkflow(mockDataSourceFactory.Object, mockDataOutputFactory.Object,
                                                    geminiOptions, geminiSampleOptions, new RealignmentOptions(), stitcherOptions, "outdir",
                                                    new RealignmentAssessmentOptions(), new IndelFilteringOptions(), mockSamtoolsWrapper.Object);

            geminiWorkflow.Execute();
        }