mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-11-25 22:59:56 +00:00
wip: formatting glitches from git absorb
This commit is contained in:
parent
43a2708a1e
commit
21b0a4f526
1 changed files with 8 additions and 8 deletions
16
src/Edit.jl
16
src/Edit.jl
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue