BioVossEncoder.VossEncoder
— Typestruct VossEncoder{A<:NucleicAcidAlphabet, B<:BitMatrix}
The VossEncoder
struct represents a binary matrix encoding a sequence of nucleic acids. This is also called the Voss representation of a sequence.
Fields
alphabet::A
: The nucleic acid alphabet used for encoding.bitmatrix::B
: The binary matrix representing the encoded sequence.
Constructors
VossEncoder(sequence::SeqOrView{A})
: Constructs aVossEncoder
from a sequence of nucleic acids.
Arguments
sequence::SeqOrView{A}
: The sequence of nucleic acids to be encoded.
BioVossEncoder.vossmatrix
— Methodvossmatrix(VossEncoder::VossEncoder{A, B}) where {A <: NucleicAcidAlphabet, B <: BitMatrix}
vossmatrix(sequence::NucleicSeqOrView{A}) where {A <: NucleicAcidAlphabet}
vossmatrix(sequence::SeqOrView{AminoAcidAlphabet}) where {A <: AminoAcidAlphabet}
Create a binary sequence matrix from a given nucleic acid sequence.
Arguments
sequence
: A nucleic acid sequence.
Returns
The binary sequence matrix.
Examples
julia> vossmatrix(aa"IANRMWRDTIED")
20×12 BitMatrix:
0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
BioVossEncoder.vossvector
— Methodvossvector(sequence::NucleicSeqOrView{A}, molecule::T) where {A <: NucleicAcidAlphabet, T <: BioSymbol}
vossvector(sequence::SeqOrView{AminoAcidAlphabet}, molecule::T) where {T <: BioSymbol}
vossvector(sequence::SeqOrView{A}, molecules::Tuple{Vararg{T}}) where {A <: Alphabet, T <: BioSymbol}
Converts a sequence of nucleotides into a binary representation.
Arguments
sequence::SeqOrView{A}
: The input sequence of nucleotides.molecule::BioSymbol
: The nucleotide to be encoded as 1, while others are encoded as 0.molecules::Tuple{Vararg{T}}
: The nucleotides to be encoded as 1, while others are encoded as 0.
Returns
A BitVector
representing the binary encoding of the input sequence, where 1 indicates the presence of the specified nucleotide and 0 indicates the absence in the ith position of the sequence.
Examples
julia> vossvector(dna"ACGT", DNA_A)
4-element view(::BitMatrix, 1, :) with eltype Bool:
1
0
0
0