1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-23 02:09:55 +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"
[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"]

View file

@ -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)