diff --git a/src/Variation.jl b/src/Variation.jl index 9ee1eba..1c6c40a 100644 --- a/src/Variation.jl +++ b/src/Variation.jl @@ -1,3 +1,25 @@ +""" + Variation{S<:BioSequence,T<:BioSymbol} + +A single change to a biological sequence. A general wrapper that can represent a +sequence-specific [`Substitution`](@ref), [`Deletion`](@ref) or [`Insertion`](@ref). +`Variation` is more robust than [`Edit`](@ref), due to inclusion of the reference sequence +and built-in validation. + +# Constructors + + Variation(ref::S, e::Edit{S,T}) where {S<:BioSequence,T<:BioSymbol} + Variation(ref::S, edit::AbstractString) where {S<:BioSequence} + +Generally speaking, the `Edit` constructor should be avoided to ensure corectness: use of +[`variations(::Variant)`](@ref) is encouraged, instead. + +Constructing a `Variation` from an `AbstractString` will parse the from `edit` using the +following syntax: +- Substitution: `""`, e.g. `"G16C"` +- Deletion: `"Δ-"`, e.g. `"Δ1-2"` +- Insertion: `""`, e.g. `"11T"` +""" struct Variation{S<:BioSequence,T<:BioSymbol} ref::S edit::Edit{S,T}