Add VCF spec tests for reference and alternate bases

This commit is contained in:
Thomas A. Christensen II 2022-07-07 10:38:15 -05:00
parent b8e44c7b81
commit 97e1d193a6
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -69,3 +69,33 @@ end
sub = Variation(refseq, "A4T") sub = Variation(refseq, "A4T")
@test first(variations(var)) == sub @test first(variations(var)) == sub
end 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