From 97e1d193a64b06f298c990076dc83aeaf3b87e44 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Thu, 7 Jul 2022 10:38:15 -0500 Subject: [PATCH] Add VCF spec tests for reference and alternate bases --- test/runtests.jl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index cad0d7f..9982a55 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -69,3 +69,33 @@ end sub = Variation(refseq, "A4T") @test first(variations(var)) == sub end + +@testset "VariationBases" begin + # Test substition bases + @test refbases(Variation(dna"ATCGA", "C3G")) == dna"C" + @test altbases(Variation(dna"ATCGA", "C3G")) == dna"G" + + # Test single deletion bases + @test refbases(Variation(dna"ATCGA", "Δ3-3")) == dna"TC" + @test altbases(Variation(dna"ATCGA", "Δ3-3")) == dna"T" + + # Test multiple deletion bases + @test refbases(Variation(dna"ATCGA", "Δ3-4")) == dna"TCG" + @test altbases(Variation(dna"ATCGA", "Δ3-4")) == dna"T" + + # Test first position deletion + @test refbases(Variation(dna"ATCGA", "Δ1-1")) == dna"AT" + @test altbases(Variation(dna"ATCGA", "Δ1-1")) == dna"T" + + # Test single insertion bases + @test refbases(Variation(dna"ATCGA", "3A")) == dna"C" + @test altbases(Variation(dna"ATCGA", "3A")) == dna"CA" + + # Test multiple insertion bases + @test refbases(Variation(dna"ATCGA", "3TAG")) == dna"C" + @test altbases(Variation(dna"ATCGA", "3TAG")) == dna"CTAG" + + # Test first position insertion + @test refbases(Variation(dna"ATCGA", "1C")) == dna"A" + @test altbases(Variation(dna"ATCGA", "1C")) == dna"CA" +end