Comparing variations in sequences
Checking for variations in a known haplotype
Looking for a known Variation
within a Haplotype
is efficiently accomplished using the in
operator.
println("\tOvis aires\tHomo sapiens")
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
Ovis aires Homo sapiens
C22T true false
G29A true false
C4A false true
T13C false true
C14A false true
G17A false true
C19A false true
T20G false true
G25T false true
Constructing new haplotypes based on other variations
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.
julia> sheeple = vcat(variations(bos_ovis_haplotype), variations(bos_human_haplotype));
julia> Haplotype(bovine, sheeple)
Haplotype{BioSequences.LongSequence{BioSequences.DNAAlphabet{4}}, BioSymbols.DNA} with 9 edits: C4A T13C C14A G17A C19A T20G C22T G25T G29A
julia> reconstruct!(bovine, ans)
ERROR: UndefVarError: reconstruct! not defined