From d0f55742d6d9b258c9d2f3da1a6e9477667ae57e Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:58:27 -0600 Subject: [PATCH] Add documentation for haplotype reference switching --- docs/src/haplotypes.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/src/haplotypes.md b/docs/src/haplotypes.md index e11755d..4694b45 100644 --- a/docs/src/haplotypes.md +++ b/docs/src/haplotypes.md @@ -38,3 +38,18 @@ human2 = reconstruct(bos_human_haplotype) human2 == bovine 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) +```