1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-14 22:33:14 +00:00

Use FormatSpecimens

This commit is contained in:
Ciarán O'Mara 2020-02-02 22:44:55 +11:00
parent 1a3c986152
commit 2df146b8fc
2 changed files with 11 additions and 11 deletions

View file

@ -26,8 +26,8 @@ Indexes = "0.1"
julia = "1.1" julia = "1.1"
[extras] [extras]
FormatSpecimens = "3372ea36-2a1a-11e9-3eb7-996970b6ffbd"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
[targets] [targets]
test = ["Test", "YAML"] test = ["FormatSpecimens", "Test"]

View file

@ -2,11 +2,11 @@ using Test
using GenomicFeatures using GenomicFeatures
using XAM using XAM
import BioAlignments: Alignment, AlignmentAnchor, OP_START, OP_MATCH, OP_DELETE import BioAlignments: Alignment, AlignmentAnchor, OP_START, OP_MATCH, OP_DELETE
using FormatSpecimens
import BGZFStreams: BGZFStream import BGZFStreams: BGZFStream
import BioCore.Exceptions: MissingFieldException import BioCore.Exceptions: MissingFieldException
import BioCore.Testing.get_bio_fmt_specimens
import BioSequences: @dna_str, @aa_str import BioSequences: @dna_str, @aa_str
import YAML
import BioCore: import BioCore:
header, header,
@ -32,7 +32,7 @@ function randrange(range)
end end
@testset "SAM" begin @testset "SAM" begin
samdir = joinpath(get_bio_fmt_specimens("master", false, true), "SAM") samdir = path_of_format("SAM")
@testset "MetaInfo" begin @testset "MetaInfo" begin
metainfo = SAM.MetaInfo() metainfo = SAM.MetaInfo()
@ -172,8 +172,8 @@ end
end end
return true return true
end end
for specimen in YAML.load_file(joinpath(samdir, "index.yml")) for specimen in list_valid_specimens("SAM")
filepath = joinpath(samdir, specimen["filename"]) filepath = joinpath(samdir, filename(specimen))
mktemp() do path, io mktemp() do path, io
# copy # copy
reader = open(SAM.Reader, filepath) reader = open(SAM.Reader, filepath)
@ -192,7 +192,7 @@ end
end end
@testset "BAM" begin @testset "BAM" begin
bamdir = joinpath(get_bio_fmt_specimens("master", false), "BAM") bamdir = path_of_format("BAM")
@testset "AuxData" begin @testset "AuxData" begin
auxdata = BAM.AuxData(UInt8[]) auxdata = BAM.AuxData(UInt8[])
@ -370,11 +370,11 @@ end
end end
@testset "Round trip" begin @testset "Round trip" begin
for specimen in YAML.load_file(joinpath(bamdir, "index.yml")) for specimen in list_valid_specimens("BAM")
filepath = joinpath(bamdir, specimen["filename"]) filepath = joinpath(bamdir, filename(specimen))
mktemp() do path, _ mktemp() do path, _
# copy # copy
if occursin("bai", get(specimen, "tags", "")) if hastags(specimen) && in("bai", tags(specimen))
reader = open(BAM.Reader, filepath, index=filepath * ".bai") reader = open(BAM.Reader, filepath, index=filepath * ".bai")
else else
reader = open(BAM.Reader, filepath) reader = open(BAM.Reader, filepath)