-
Notifications
You must be signed in to change notification settings - Fork 0
/
Consts.jl
44 lines (33 loc) · 1.02 KB
/
Consts.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using BioSequences, FASTX
export SubSeq, Seq, DnaSeq, DnaBits, Kfv
const SubSeq = BioSequences.LongSubSeq{DNAAlphabet{4}}
const Seq = BioSequences.LongSequence{DNAAlphabet{4}}
const DnaSeq = Union{Seq, SubSeq}
const DnaBits = Dict{BioSequences.DNA, UInt}
const Kfv = Union{Vector{Int64}, Vector{Float64}}
const BinInput = Union{MVector, Vector{Int}, Vector{Float64}}
const JuliaPalette = Dict{String, String}(
"purple" => "#9358A4",
"red" => "#CB392E",
"green" => "#369844",
"blue" => "#4C64B0"
)
export JuliaPalette
const NUCLEOTIDE_BITS = Dict{BioSequences.DNA, UInt}(
DNA_A => unsigned(0),
DNA_C => unsigned(1),
DNA_G => unsigned(2),
DNA_T => unsigned(3),
DNA_N => unsigned(3) # somehow has worked wonders.
)
export NUCLEOTIDE_BITS
"""
getSeq(sequence::FASTA.Record)
Alias to get the dna longsequence of a fasta record
"""
function getSeq(sequence::FASTX.FASTA.Record)
return FASTX.FASTA.sequence(Seq, sequence)
end
export getSeq
getK(KFV::Kfv) = Int(log(4, length(KFV)))
export getK