wip: formatting glitches from git absorb

This commit is contained in:
Thomas A. Christensen II 2024-10-01 11:36:03 -05:00
parent 43a2708a1e
commit 21b0a4f526
Signed by: millironx
GPG key ID: B7044A3432851F64

View file

@ -61,13 +61,13 @@ BioGenerics.leftposition(d::DeletionEdit) = d.position
BioGenerics.rightposition(d::DeletionEdit) = leftposition(d) + length(d) - 1 BioGenerics.rightposition(d::DeletionEdit) = leftposition(d) + length(d) - 1
_lendiff(d::DeletionEdit) = -1 * length(d) _lendiff(d::DeletionEdit) = -1 * length(d)
struct InsertionEdit{S<:BioSequence} <: Edit struct InsertionEdit{S,T} <: Edit{S,T}
position::UInt position::UInt
struct InsertionEdit{S,T} <: Edit{S,T} where {S<:BioSequence,T<:BioSymbol} seq::S
function InsertionEdit{S}(position::UInt, seq::S) where {S<:BioSequence}
iszero(position) && error("Insertion cannot be at a position outside the sequence")
function InsertionEdit{S,T}(position::UInt, seq::S) where {S<:BioSequence,T<:BioSymbol} function InsertionEdit{S,T}(position::UInt, seq::S) where {S<:BioSequence,T<:BioSymbol}
iszero(position) && error("Insertion cannot be at a position outside the sequence")
isempty(seq) && error("Insertion must be at least 1 symbol")
return new(position, seq) return new(position, seq)
end end
end end
@ -78,15 +78,15 @@ BioGenerics.leftposition(i::InsertionEdit) = i.position
BioGenerics.rightposition(i::InsertionEdit) = leftposition(i) + 1 BioGenerics.rightposition(i::InsertionEdit) = leftposition(i) + 1
_lendiff(i::InsertionEdit) = length(i) _lendiff(i::InsertionEdit) = length(i)
struct SubstitutionEdit{T} <: Edit where {T<:BioSymbol} struct SubstitutionEdit{S,T} <: Edit{S,T}
position::UInt position::UInt
struct SubstitutionEdit{S,T} <: Edit{S,T} where {S<:BioSequence,T<:BioSymbol} base::T
function SubstitutionEdit{T}(position::UInt, base::T) where {T<:BioSymbol}
iszero(position) &&
function SubstitutionEdit{S,T}( function SubstitutionEdit{S,T}(
position::UInt, base::T position::UInt, base::T
) where {S<:BioSequence,T<:BioSymbol} ) where {S<:BioSequence,T<:BioSymbol}
iszero(position) &&
error("Substitution cannot be at a position outside the sequence")
return new(position, base) return new(position, base)
end end
end end