Add documentation for haplotype reference switching

This commit is contained in:
Thomas A. Christensen II 2023-01-05 14:58:27 -06:00
parent ecaa995d2b
commit d0f55742d6

View file

@ -38,3 +38,18 @@ human2 = reconstruct(bos_human_haplotype)
human2 == bovine human2 == bovine
human2 == human human2 == human
``` ```
## Reference switching
All variations within a haplotype can be mapped to a new reference sequence
given an alignment between the new and old references using the
[`translate`](@ref translate(::Haplotype{S,T}, ::PairwiseAlignment{S,S}) where {S,T})
function. This could be useful if variants were called against a reference
sequence for the entire species, but need to be analyzed as variants of a
subtype later.
```@repl call_variants
ovis_human_alignment =
PairwiseAlignment(AlignedSequence(human, Alignment("32M", 1, 1)), ovine)
SequenceVariation.translate(bos_ovis_haplotype, ovis_human_alignment)
```