diff --git a/test/runtests.jl b/test/runtests.jl index 18ba9f1..5a5ca1b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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