From f49220782b8c6535d864ae55815c11389c605e9f Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:48:47 -0600 Subject: [PATCH] Add docstring for Variant --- src/Variant.jl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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}}