Variation Methods
These methods extend the functionality of SequenceVariation.Variation
for calculation of data related to Variation
s created from NGS read alignments.
HapLink.quality
— Methodquality(v::Variation, r::Union{SAM.Record,BAM.Record}) -> Float64
Get the phred-scalled basecall quality of v
within the sequencing read of r
.
HapLink.relativepos
— Methodrelativepos(v::Variation, r::Union{SAM.Record,BAM.Record})
Calculates the fractional position of v
within the sequence of r
. If v
is out-of-bounds of r
, then will return 0
for positions before r
and 1
for positions after r
.
HapLink.seqpos
— Methodseqpos(v::Variation, a::Union{Alignment,AlignedSequence,PairwiseAlignment})
Get the position of v
in the sequence of a
.
Example
using BioAlignments, BioSequences, SequenceVariation
v = Variation(dna"AAAAA", "A3T")
a = Alignment("2=1X2=", 1, 1)
seqpos(v, a)
# output
3
HapLink.subconsensus_variations
— Methodsubconsensus_variations(vcf::Union{AbstractPath,AbstractString}, consensus::Haplotype)
Get a Vector{Variation}
with passing variant calls from vcf
that do not appear in consensus
HapLink.variation
— Methodvariation(r::VCF.Record, refseq::NucleotideSeq)
Construct a Variation
from r
applying to refseq
. There is no validation that r
's actually describes a mutation in refseq
.