mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-11-22 13:29:56 +00:00
feat: Add alignment(::Haplotype) function
This commit is contained in:
parent
95ef4fdc62
commit
4817c8016a
2 changed files with 20 additions and 1 deletions
|
@ -250,6 +250,17 @@ function BioAlignments.cigar(hap::Haplotype{S,T}) where {S,T}
|
||||||
return join(cigar_string, "")
|
return join(cigar_string, "")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
"""
|
||||||
|
alignment(hap::Haplotype)
|
||||||
|
|
||||||
|
Gets a `PairwiseAlignment` of the mutated sequence of `hap` mapped to its refernce sequence
|
||||||
|
"""
|
||||||
|
function BioAlignments.alignment(hap::Haplotype)
|
||||||
|
return PairwiseAlignment(
|
||||||
|
AlignedSequence(reconstruct(hap), Alignment(cigar(hap))), reference(hap)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
"""
|
"""
|
||||||
translate(hap::Haplotype{S,T}, aln::PairwiseAlignment{S,S}) where {S,T}
|
translate(hap::Haplotype{S,T}, aln::PairwiseAlignment{S,S}) where {S,T}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,15 @@ TODO now:
|
||||||
* Add tests
|
* Add tests
|
||||||
"""
|
"""
|
||||||
|
|
||||||
using BioAlignments: BioAlignments, PairwiseAlignment, OP_SOFT_CLIP, cigar, sequence
|
using BioAlignments:
|
||||||
|
BioAlignments,
|
||||||
|
Alignment,
|
||||||
|
AlignedSequence,
|
||||||
|
PairwiseAlignment,
|
||||||
|
OP_SOFT_CLIP,
|
||||||
|
alignment,
|
||||||
|
cigar,
|
||||||
|
sequence
|
||||||
using BioGenerics: BioGenerics, leftposition, rightposition
|
using BioGenerics: BioGenerics, leftposition, rightposition
|
||||||
using BioSequences: BioSequences, BioSequence, NucleotideSeq, LongSequence, isgap
|
using BioSequences: BioSequences, BioSequence, NucleotideSeq, LongSequence, isgap
|
||||||
using BioSymbols: BioSymbol
|
using BioSymbols: BioSymbol
|
||||||
|
|
Loading…
Reference in a new issue