From 15d5113e8b012393cea3d047f50e9d1b1337dbb1 Mon Sep 17 00:00:00 2001 From: Pavel Dimens Date: Mon, 8 Feb 2021 22:25:41 -0600 Subject: [PATCH] remove extension deps for openvcf() --- src/io/VariantCallGzLazy.jl | 8 +++----- src/io/VariantCallLazy.jl | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/io/VariantCallGzLazy.jl b/src/io/VariantCallGzLazy.jl index 161e5c3a6..4318003b0 100644 --- a/src/io/VariantCallGzLazy.jl +++ b/src/io/VariantCallGzLazy.jl @@ -2,11 +2,9 @@ using .GZip # if GZip is loaded in, overwrite openvcf to this method function openvcf(infile::String) - if endswith(infile, ".vcf") || endswith(infile, ".bcf") - return open(infile, "r") - elseif endswith(infile, ".vcf.gz") || endswith(infile, ".bcf.gz") + if endswith(infile, ".gz") return GZip.open(infile, "r") else - throw(ArgumentError("The filename must end with .vcf/.bcf or .vcf.gz/.bcf.gz")) + return open(infile, "r") end -end +end \ No newline at end of file diff --git a/src/io/VariantCallLazy.jl b/src/io/VariantCallLazy.jl index 0d52871ee..6baf5bcd4 100755 --- a/src/io/VariantCallLazy.jl +++ b/src/io/VariantCallLazy.jl @@ -4,15 +4,13 @@ export bcf, vcf """ openvcf(::String) -Open VCF file (`.vcf/.gz`, or `.bcf/.gz`) and return an `IO` stream in reading mode `"r"`. +Open VCF file (`.vcf(.gz)`, or `.bcf(.gz)`) and return an `IO` stream in reading mode `"r"`. """ function openvcf(infile::String) - if endswith(infile, ".vcf") || endswith(infile, ".bcf") - return open(infile, "r") - elseif endswith(infile, ".gz") + if endswith(infile, ".gz") throw(ArgumentError("Please load in GZip.jl with \`using GZip\`")) else - throw(ArgumentError("The filename must end with .vcf or .bcf")) + return open(infile, "r") end end