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); }
private LiteVcfReader GetVcfReader() { var useStdInput = ConfigurationSettings.VcfPath == "-"; var peekStream = new PeekStream(useStdInput ? Console.OpenStandardInput() : FileUtilities.GetReadStream(ConfigurationSettings.VcfPath)); return(new LiteVcfReader(GZipUtilities.GetAppropriateStream(peekStream))); }
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); }
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); }
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); }
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); }
private static GeneAnnotationsParser GetGeneAnnotationsParserFromCustomTsvStream(PersistentStream customTsvStream) { var(entrezGeneIdToSymbol, ensemblGeneIdToSymbol) = GeneUtilities.ParseUniversalGeneArchive(null, LambdaUrlHelper.GetUgaUrl()); return(GeneAnnotationsParser.Create(new StreamReader(GZipUtilities.GetAppropriateStream(customTsvStream)), entrezGeneIdToSymbol, ensemblGeneIdToSymbol)); }