test: Add tests for cigar(::Haplotype)

This commit is contained in:
Thomas A. Christensen II 2023-04-04 11:36:27 -05:00
parent 719a123992
commit 95ef4fdc62
Signed by: millironx
GPG key ID: 09335146883990B9

View file

@ -31,7 +31,8 @@ using BioAlignments:
pairalign,
Alignment,
AlignedSequence,
PairwiseAlignment
PairwiseAlignment,
cigar
using BioSequences: BioSequence, @dna_str, ungap!
using BioSymbols: DNA_A
using SequenceVariation
@ -127,6 +128,25 @@ end
@test Variation(seq2, "A3T") < Variation(seq2, "T4A")
end
@testset "CIGAR" begin
reference = dna"TGATGCGTGTAGCAACACTTATAGCG"
reference_genotype = Haplotype(
reference, Variation{typeof(reference),eltype(reference)}[]
)
genotype = Haplotype(
reference,
[
Variation(reference, "Δ1-2"),
Variation(reference, "10T"),
Variation(reference, "Δ17-18"),
Variation(reference, "A23C"),
],
)
@test cigar(reference_genotype) == "26M"
@test cigar(genotype) == "2D7M1I7M2D8M"
end
@testset "HaplotypeTranslation" begin
ref1 = seq2
ref2 = seq3