diff --git a/docs/src/compare.md b/docs/src/compare.md index 3717498..19f3053 100644 --- a/docs/src/compare.md +++ b/docs/src/compare.md @@ -4,7 +4,7 @@ CurrentModule = SequenceVariation # Comparing variations in sequences -## Checking for variations in a known variant +## Checking for variations in a known haplotype Looking for a known [`Variation`](@ref) within a [`Haplotype`](@ref) is efficiently accomplished using the `in` operator. @@ -21,27 +21,27 @@ bos_ovis_alignment = bos_human_alignment = PairwiseAlignment(AlignedSequence(human, Alignment("32M", 1, 1)), bovine); -bos_ovis_variant = Haplotype(bos_ovis_alignment) -bos_human_variant = Haplotype(bos_human_alignment) +bos_ovis_haplotype = Haplotype(bos_ovis_alignment) +bos_human_haplotype = Haplotype(bos_human_alignment) ``` ```@example call_variants println("\tOvis aires\tHomo sapiens") -for v in vcat(variations(bos_ovis_variant), variations(bos_human_variant)) - is_sheep = v in bos_ovis_variant - is_human = v in bos_human_variant +for v in vcat(variations(bos_ovis_haplotype), variations(bos_human_haplotype)) + is_sheep = v in bos_ovis_haplotype + is_human = v in bos_human_haplotype println("$v\t$is_sheep\t\t$is_human") end ``` -## Constructing new variants based on other variations +## Constructing new haplotypes based on other variations -New variants can be constructed using variations. This might be useful to pool -variations found on different reads or to filter variations from a variant -that aren't validated by another variant. +New haplotypes can be constructed using variations. This might be useful to pool +variations found on different reads or to filter variations from a haplotype +that aren't validated by another haplotype. ```@repl call_variants -sheeple = vcat(variations(bos_ovis_variant), variations(bos_human_variant)); +sheeple = vcat(variations(bos_ovis_haplotype), variations(bos_human_haplotype)); Haplotype(bovine, sheeple) reconstruct!(bovine, ans) ``` diff --git a/docs/src/haplotypes.md b/docs/src/haplotypes.md index 805e1f3..251670a 100644 --- a/docs/src/haplotypes.md +++ b/docs/src/haplotypes.md @@ -2,13 +2,14 @@ CurrentModule = SequenceVariation ``` -# Working with variants +# Working with haplotypes ## Calling variants The first step in working with sequence variation is to identify (call) -variations. SequenceVariation can directly call variants using the -`Haplotype(::PairwiseAlignment)` constructor of the [`Haplotype`](@ref) type. +variations between two sequences. SequenceVariation can directly call variants +using the `Haplotype(::PairwiseAlignment)` constructor of the +[`Haplotype`](@ref) type. ```@repl call_variants using SequenceVariation, BioAlignments, BioSequences @@ -22,19 +23,19 @@ bos_ovis_alignment = bos_human_alignment = PairwiseAlignment(AlignedSequence(human, Alignment("32M", 1, 1)), bovine); -bos_ovis_variant = Haplotype(bos_ovis_alignment) -bos_human_variant = Haplotype(bos_human_alignment) +bos_ovis_haplotype = Haplotype(bos_ovis_alignment) +bos_human_haplotype = Haplotype(bos_human_alignment) ``` ## Sequence reconstruction -If the alternate sequence of a variant is no longer available (as is often the +If the alternate sequence of a haplotype is no longer available (as is often the case when calling variants from alignment files), then the sequence can be retrieved using the [`reconstruct!`](@ref) function. ```@repl call_variants human2 = copy(bovine); -reconstruct!(human2, bos_human_variant) +reconstruct!(human2, bos_human_haplotype) human2 == bovine human2 == human ``` diff --git a/docs/src/variations.md b/docs/src/variations.md index d374f0d..46d2e79 100644 --- a/docs/src/variations.md +++ b/docs/src/variations.md @@ -42,13 +42,13 @@ bos_ovis_alignment = bos_human_alignment = PairwiseAlignment(AlignedSequence(human, Alignment("32M", 1, 1)), bovine); -bos_ovis_variant = Haplotype(bos_ovis_alignment) -bos_human_variant = Haplotype(bos_human_alignment) +bos_ovis_haplotype = Haplotype(bos_ovis_alignment) +bos_human_haplotype = Haplotype(bos_human_alignment) ``` ```@repl call_variants -variations(bos_ovis_variant) -variations(bos_human_variant) +variations(bos_ovis_haplotype) +variations(bos_human_haplotype) ``` ## Reference switching @@ -59,8 +59,8 @@ alignment between the new and old references using the [`translate`](@ref). ```@repl call_variants ovis_human_alignment = PairwiseAlignment(AlignedSequence(human, Alignment("32M", 1, 1)), ovine) -human_variation = first(variations(bos_ovis_variant)) +human_variation = first(variations(bos_ovis_haplotype)) reference(ans) == bovine -SequenceVariation.translate(human_variation, ovis_human_alignment) +SequenceVariation.translate(human_variation, ovis_human_haplotype) reference(ans) == bovine ``` diff --git a/src/Haplotype.jl b/src/Haplotype.jl index 945200d..7412331 100644 --- a/src/Haplotype.jl +++ b/src/Haplotype.jl @@ -2,7 +2,7 @@ Haplotype{S<:BioSequence,T<:BioSymbol} A set of variations within a given sequence that are all found together. Depending on the -field, it might also be referred to as a "genotype," "haplotype," or "strain." +field, it might also be referred to as a "genotype" or "strain." # Constructors