diff --git a/src/Variant.jl b/src/Variant.jl index a0b1dfa..0b38153 100644 --- a/src/Variant.jl +++ b/src/Variant.jl @@ -1,5 +1,22 @@ -# Edits are applied sequentially from first to last pos. -# The vector must always be sorted by pos. +""" + Variant{S<:BioSequence,T<:BioSymbol} + +A set of variations within a given sequence that are all found together. Depending on the +field, it might also be referred to as a "genotype," "haplotype," or "strain." + +# Constructors + + Variant(ref::S, edits::Vector{Edit{S,T}}) where {S<:BioSequence,T<:BioSymbol} + Variant(ref::S, vars::Vector{Variation{S,T}}) where {S<:BioSequence,T<:BioSymbol} + Variant( + aln::PairwiseAlignment{T,T} + ) where {T<:LongSequence{<:Union{BS.AminoAcidAlphabet,BS.NucleicAcidAlphabet}}} + +When constructing a `Variant` from a vector of [`Edit`](@ref)s or [`Variation`](@ref)s, the +edits are applied sequentially from first to last position, therefore the vector must always +be sorted by position. These edits are sorted automatically if constructing from an +alignment. +""" struct Variant{S<:BioSequence,T<:BioSymbol} ref::S edits::Vector{Edit{S,T}}