From 2df146b8fc4578e9631def931bb6441575603b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20O=27Mara?= Date: Sun, 2 Feb 2020 22:44:55 +1100 Subject: [PATCH] Use FormatSpecimens --- Project.toml | 4 ++-- test/runtests.jl | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index 2f31d67..18608d4 100644 --- a/Project.toml +++ b/Project.toml @@ -26,8 +26,8 @@ Indexes = "0.1" julia = "1.1" [extras] +FormatSpecimens = "3372ea36-2a1a-11e9-3eb7-996970b6ffbd" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" [targets] -test = ["Test", "YAML"] +test = ["FormatSpecimens", "Test"] diff --git a/test/runtests.jl b/test/runtests.jl index 7594e1c..ffb2669 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,11 +2,11 @@ using Test using GenomicFeatures using XAM import BioAlignments: Alignment, AlignmentAnchor, OP_START, OP_MATCH, OP_DELETE +using FormatSpecimens import BGZFStreams: BGZFStream import BioCore.Exceptions: MissingFieldException -import BioCore.Testing.get_bio_fmt_specimens import BioSequences: @dna_str, @aa_str -import YAML + import BioCore: header, @@ -32,7 +32,7 @@ function randrange(range) end @testset "SAM" begin - samdir = joinpath(get_bio_fmt_specimens("master", false, true), "SAM") + samdir = path_of_format("SAM") @testset "MetaInfo" begin metainfo = SAM.MetaInfo() @@ -172,8 +172,8 @@ end end return true end - for specimen in YAML.load_file(joinpath(samdir, "index.yml")) - filepath = joinpath(samdir, specimen["filename"]) + for specimen in list_valid_specimens("SAM") + filepath = joinpath(samdir, filename(specimen)) mktemp() do path, io # copy reader = open(SAM.Reader, filepath) @@ -192,7 +192,7 @@ end end @testset "BAM" begin - bamdir = joinpath(get_bio_fmt_specimens("master", false), "BAM") + bamdir = path_of_format("BAM") @testset "AuxData" begin auxdata = BAM.AuxData(UInt8[]) @@ -370,11 +370,11 @@ end end @testset "Round trip" begin - for specimen in YAML.load_file(joinpath(bamdir, "index.yml")) - filepath = joinpath(bamdir, specimen["filename"]) + for specimen in list_valid_specimens("BAM") + filepath = joinpath(bamdir, filename(specimen)) mktemp() do path, _ # copy - if occursin("bai", get(specimen, "tags", "")) + if hastags(specimen) && in("bai", tags(specimen)) reader = open(BAM.Reader, filepath, index=filepath * ".bai") else reader = open(BAM.Reader, filepath)