Update documentation wording to reflect new type names

master
parent 46c84b06bb
commit 1384783fcc

@ -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)
```

@ -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
```

@ -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
```

@ -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

Loading…
Cancel
Save