aboutsummaryrefslogtreecommitdiff
path: root/workflows
diff options
context:
space:
mode:
Diffstat (limited to 'workflows')
-rw-r--r--workflows/yamlfa2ttl/check_format.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/workflows/yamlfa2ttl/check_format.py b/workflows/yamlfa2ttl/check_format.py
index a1b1f14..4472b18 100644
--- a/workflows/yamlfa2ttl/check_format.py
+++ b/workflows/yamlfa2ttl/check_format.py
@@ -1,22 +1,18 @@
import gzip
import tempfile
-import pkg_resources
import magic
import io
-
import sys
path_fasta = sys.argv[1]
format_to_check = sys.argv[2]
path_valid_formats = sys.argv[3]
-
-# ../../bh20sequploader/validation/formats
-
-schema_resource = pkg_resources.resource_stream(__name__, path_valid_formats)
with tempfile.NamedTemporaryFile() as tmp:
- tmp.write(schema_resource.read())
+ with open(path_valid_formats, 'rb') as f:
+ tmp.write(f.read())
tmp.flush()
+
check_format = magic.Magic(magic_file=tmp.name, uncompress=False, mime=True)
with open(path_fasta, "rb") as f: