Add docstring for Variant

This commit is contained in:
Thomas A. Christensen II 2022-12-30 15:48:47 -06:00
parent f1baf27865
commit f49220782b

View file

@ -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}}