API Reference

Edits

SequenceVariation.InsertionType
Insertion{S <: BioSequence}

Represents the insertion of a S into a sequence. The location of the insertion is stored outside the struct.

source

Variants

SequenceVariation.HaplotypeType
Haplotype{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" or "strain."

Constructors

Haplotype(ref::S, edits::Vector{Edit{S,T}}) where {S<:BioSequence,T<:BioSymbol}
Haplotype(ref::S, vars::Vector{Variation{S,T}}) where {S<:BioSequence,T<:BioSymbol}
Haplotype(
    aln::PairwiseAlignment{T,T}
) where {T<:LongSequence{<:Union{BS.AminoAcidAlphabet,BS.NucleicAcidAlphabet}}}

When constructing a Haplotype from a vector of Edits or Variations, 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.

source

Variations

SequenceVariation.VariationType
Variation{S<:BioSequence,T<:BioSymbol}

A single change to a biological sequence. A general wrapper that can represent a sequence-specific Substitution, Deletion or Insertion. Variation is more robust than Edit, 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(::Haplotype) is encouraged, instead.

Constructing a Variation from an AbstractString will parse the from edit using the following syntax:

  • Substitution: "<REFBASE><POS><ALTBASE>", e.g. "G16C"
  • Deletion: "Δ<STARTPOS>-<ENDPOS>", e.g. "Δ1-2"
  • Insertion: "<POS><ALTBASES>", e.g. "11T"
source
SequenceVariation.translateMethod
translate(var::Variation{S,T}, aln::PairwiseAlignment{S,S}) where {S,T}

Convert the difference in var to a new reference sequence based upon aln. aln is the alignment of the old reference (aln.b) and the new reference sequence (aln.seq). Returns the new Variation.

source

Private API

Edits

SequenceVariation.EditType
Edit{S <: BioSequence, T <: BioSymbol}

An edit of either Substitution{T}, Insertion{S} or Deletion at a position. If deletion: Deletion of length L at ref pos pos:pos+L-1 If insertion: Insertion of length L b/w ref pos pos:pos+1

source

Variants

SequenceVariation._is_validMethod
_is_valid(h::Haplotype{S,T}) where {S,T}

Validate h. h is invalid if any of its operations are out of bounds, or the same position is affected by multiple edits.

source

Variations