예제 #1
0
        private static VariantAnnotationsParser GetVariantAnnotationsParserFromCustomTsvStream(PersistentStream customTsvStream)
        {
            var parser = VariantAnnotationsParser.Create(new StreamReader(GZipUtilities.GetAppropriateStream(customTsvStream)));

            parser.SequenceProvider = new ReferenceSequenceProvider(PersistentStreamUtils.GetReadStream(LambdaUrlHelper.GetRefUrl(parser.Assembly)));

            return(parser);
        }
예제 #2
0
        private LiteVcfReader GetVcfReader()
        {
            var useStdInput = ConfigurationSettings.VcfPath == "-";

            var peekStream =
                new PeekStream(useStdInput
                    ? Console.OpenStandardInput()
                    : FileUtilities.GetReadStream(ConfigurationSettings.VcfPath));

            return(new LiteVcfReader(GZipUtilities.GetAppropriateStream(peekStream)));
        }
예제 #3
0
        private static AnnotationResources GetAnnotationResources()
        {
            var annotationResources = new AnnotationResources(_refSequencePath, _inputCachePrefix, SupplementaryAnnotationDirectories, null, _pluginDirectory, _disableRecomposition, _forceMitochondrialAnnotation);

            if (SupplementaryAnnotationDirectories.Count == 0)
            {
                return(annotationResources);
            }

            using (var preloadVcfStream = GZipUtilities.GetAppropriateStream(
                       new PersistentStream(PersistentStreamUtils.GetReadStream(_vcfPath),
                                            ConnectUtilities.GetFileConnectFunc(_vcfPath), 0)))
            {
                annotationResources.GetVariantPositions(preloadVcfStream, null);
            }
            return(annotationResources);
        }
예제 #4
0
        public void GetAppropriateStream_Handle_PeekStream()
        {
            string observedString;

            using (var ms = new MemoryStream())
            {
                using (var writer = new BinaryWriter(new BlockGZipStream(ms, CompressionMode.Compress, true)))
                {
                    writer.Write(ExpectedString);
                }

                ms.Position = 0;

                using (var peekStream = new PeekStream(ms))
                    using (var reader = new BinaryReader(GZipUtilities.GetAppropriateStream(peekStream)))
                    {
                        observedString = reader.ReadString();
                    }
            }

            Assert.Equal(ExpectedString, observedString);
        }
예제 #5
0
        public void GetAppropriateStream_PeekStream_WithTextFile()
        {
            string observedString;

            using (var ms = new MemoryStream())
            {
                using (var writer = new StreamWriter(ms, Encoding.UTF8, 1024, true))
                {
                    writer.WriteLine(ExpectedString);
                }

                ms.Position = 0;

                using (var peekStream = new PeekStream(ms))
                    using (var reader = new StreamReader(GZipUtilities.GetAppropriateStream(peekStream)))
                    {
                        observedString = reader.ReadLine();
                    }
            }

            Assert.Equal(ExpectedString, observedString);
        }
예제 #6
0
        private static AnnotationResources GetAnnotationResources()
        {
            if (_outputFileName == "-")
            {
                Logger.Silence();
            }
            var metrics = new PerformanceMetrics();

            var annotationResources = new AnnotationResources(_refSequencePath, _inputCachePrefix,
                                                              SupplementaryAnnotationDirectories, null, _customStrTsv,
                                                              _disableRecomposition, _forceMitochondrialAnnotation, _useLegacyVids, metrics);

            if (SupplementaryAnnotationDirectories.Count == 0)
            {
                return(annotationResources);
            }

            using (var preloadVcfStream = GZipUtilities.GetAppropriateStream(PersistentStreamUtils.GetReadStream(_vcfPath)))
            {
                annotationResources.GetVariantPositions(preloadVcfStream, null);
            }

            return(annotationResources);
        }
예제 #7
0
 private static GeneAnnotationsParser GetGeneAnnotationsParserFromCustomTsvStream(PersistentStream customTsvStream)
 {
     var(entrezGeneIdToSymbol, ensemblGeneIdToSymbol) = GeneUtilities.ParseUniversalGeneArchive(null, LambdaUrlHelper.GetUgaUrl());
     return(GeneAnnotationsParser.Create(new StreamReader(GZipUtilities.GetAppropriateStream(customTsvStream)), entrezGeneIdToSymbol, ensemblGeneIdToSymbol));
 }