mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-11-22 05:19:55 +00:00
Rename reconstruct! function to reconstruct
The exclamation mark is conventionally used to mark mutating functions, but reconstruct is no longer mutating, so change the notation.
This commit is contained in:
parent
adbf0ce7f1
commit
b80dd8c950
4 changed files with 6 additions and 6 deletions
|
@ -21,7 +21,7 @@ Insertion
|
||||||
Haplotype
|
Haplotype
|
||||||
reference(::Haplotype)
|
reference(::Haplotype)
|
||||||
variations
|
variations
|
||||||
reconstruct!
|
reconstruct
|
||||||
```
|
```
|
||||||
|
|
||||||
## Variations
|
## Variations
|
||||||
|
|
|
@ -31,11 +31,11 @@ bos_human_haplotype = Haplotype(bos_human_alignment)
|
||||||
|
|
||||||
If the alternate sequence of a haplotype 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
|
case when calling variants from alignment files), then the sequence can be
|
||||||
retrieved using the [`reconstruct!`](@ref) function.
|
retrieved using the [`reconstruct`](@ref) function.
|
||||||
|
|
||||||
```@repl call_variants
|
```@repl call_variants
|
||||||
human2 = copy(bovine);
|
human2 = copy(bovine);
|
||||||
reconstruct!(human2, bos_human_haplotype)
|
reconstruct(human2, bos_human_haplotype)
|
||||||
human2 == bovine
|
human2 == bovine
|
||||||
human2 == human
|
human2 == human
|
||||||
```
|
```
|
||||||
|
|
|
@ -162,11 +162,11 @@ reference(h::Haplotype) = h.ref
|
||||||
Base.:(==)(x::Haplotype, y::Haplotype) = x.ref == y.ref && x.edits == y.edits
|
Base.:(==)(x::Haplotype, y::Haplotype) = x.ref == y.ref && x.edits == y.edits
|
||||||
|
|
||||||
"""
|
"""
|
||||||
reconstruct!(h::Haplotype)
|
reconstruct(h::Haplotype)
|
||||||
|
|
||||||
Apply the edits in `h` to the reference sequence of `h` and return the mutated sequence
|
Apply the edits in `h` to the reference sequence of `h` and return the mutated sequence
|
||||||
"""
|
"""
|
||||||
function reconstruct!(h::Haplotype)
|
function reconstruct(h::Haplotype)
|
||||||
len = length(reference(h)) + sum(edit -> _lendiff(edit), _edits(h))
|
len = length(reference(h)) + sum(edit -> _lendiff(edit), _edits(h))
|
||||||
seq = copy(reference(h))
|
seq = copy(reference(h))
|
||||||
resize!(seq, len % UInt)
|
resize!(seq, len % UInt)
|
||||||
|
|
|
@ -32,7 +32,7 @@ export Substitution
|
||||||
export Variation
|
export Variation
|
||||||
export altbases
|
export altbases
|
||||||
export mutation
|
export mutation
|
||||||
export reconstruct!
|
export reconstruct
|
||||||
export refbases
|
export refbases
|
||||||
export reference
|
export reference
|
||||||
export translate
|
export translate
|
||||||
|
|
Loading…
Reference in a new issue