BioSequences.@rna_str
— MacroThe LongRNA{4}
equivalent to @dna_str
Examples
julia> rna"UCGUGAUGC"
+"TAGA"
diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json
index 0cff6d87..d67aef0b 100644
--- a/dev/.documenter-siteinfo.json
+++ b/dev/.documenter-siteinfo.json
@@ -1 +1 @@
-{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-22T16:18:36","documenter_version":"1.7.0"}}
\ No newline at end of file
+{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-22T16:41:41","documenter_version":"1.7.0"}}
\ No newline at end of file
diff --git a/dev/construction/index.html b/dev/construction/index.html
index 41438b63..ce5d1f8b 100644
--- a/dev/construction/index.html
+++ b/dev/construction/index.html
@@ -135,11 +135,11 @@
"TAGA"
julia> string(push!(f(), DNA_A))
-"TAGA"source The Examples The Examples The Examples The ExamplesBioSequences.@rna_str
— MacroLongRNA{4}
equivalent to @dna_str
julia> rna"UCGUGAUGC"
+"TAGA"
BioSequences.@rna_str
— MacroLongRNA{4}
equivalent to @dna_str
julia> rna"UCGUGAUGC"
9nt RNA Sequence:
-UCGUGAUGC
BioSequences.@aa_str
— MacroAminoAcidAlphabet
equivalent to @dna_str
julia> aa"PKLEQC"
+UCGUGAUGC
BioSequences.@aa_str
— MacroAminoAcidAlphabet
equivalent to @dna_str
julia> aa"PKLEQC"
6aa Amino Acid Sequence:
-PKLEQC
As of version 3.2.0, BioSequences.jl provide the bioseq
function, which can be used to build a LongSequence
from a string (or an AbstractVector{UInt8}
) without knowing the correct Alphabet
.
julia> bioseq("ATGTGCTGA")
+PKLEQC
sourceAs of version 3.2.0, BioSequences.jl provide the bioseq
function, which can be used to build a LongSequence
from a string (or an AbstractVector{UInt8}
) without knowing the correct Alphabet
.
julia> bioseq("ATGTGCTGA")
9nt DNA Sequence:
ATGTGCTGA
The function will prioritise 2-bit alphabets over 4-bit alphabets, and prefer smaller alphabets (like DNAAlphabet{4}
) over larger (like AminoAcidAlphabet
). If the input cannot be encoded by any of the built-in alphabets, an error is thrown:
julia> bioseq("0!(CC!;#&&%")
ERROR: cannot encode 0x30 in AminoAcidAlphabet
@@ -153,7 +153,7 @@
julia> bioseq("PKMW#3>>0;kL")
ERROR: cannot encode 0x23 in AminoAcidAlphabet
-[...]
sourceBioSequences.guess_alphabet
— Functionguess_alphabet(s::Union{AbstractString, AbstractVector{UInt8}}) -> Union{Integer, Alphabet}
Pick an Alphabet
that can encode input s
. If no Alphabet
can, return the index of the first byte of the input which is not encodable in any alphabet. This function only knows about the alphabets listed below. If multiple alphabets are possible, pick the first from the order below (i.e. DNAAlphabet{2}()
if possible, otherwise RNAAlphabet{2}()
etc).
DNAAlphabet{2}()
RNAAlphabet{2}()
DNAAlphabet{4}()
RNAAlphabet{4}()
AminoAcidAlphabet()
The functions bioseq
and guess_alphabet
are intended for use in interactive sessions, and are not suitable for use in packages or non-ephemeral work. They are type unstable, and their heuristics are subject to change in minor versions.
Examples
julia> guess_alphabet("AGGCA")
+[...]
BioSequences.guess_alphabet
— Functionguess_alphabet(s::Union{AbstractString, AbstractVector{UInt8}}) -> Union{Integer, Alphabet}
Pick an Alphabet
that can encode input s
. If no Alphabet
can, return the index of the first byte of the input which is not encodable in any alphabet. This function only knows about the alphabets listed below. If multiple alphabets are possible, pick the first from the order below (i.e. DNAAlphabet{2}()
if possible, otherwise RNAAlphabet{2}()
etc).
DNAAlphabet{2}()
RNAAlphabet{2}()
DNAAlphabet{4}()
RNAAlphabet{4}()
AminoAcidAlphabet()
The functions bioseq
and guess_alphabet
are intended for use in interactive sessions, and are not suitable for use in packages or non-ephemeral work. They are type unstable, and their heuristics are subject to change in minor versions.
Examples
julia> guess_alphabet("AGGCA")
DNAAlphabet{2}()
julia> guess_alphabet("WKLQSTV")
@@ -163,10 +163,10 @@
5
julia> guess_alphabet("UAGCSKMU")
-RNAAlphabet{4}()
Following Base standards, BioSequences do not compare equal to other containers even if they have the same elements. To e.g. compare a BioSequence with a vector of DNA, compare the elements themselves:
julia> seq = dna"GAGCTGA"; vec = collect(seq);
+RNAAlphabet{4}()
sourceFollowing Base standards, BioSequences do not compare equal to other containers even if they have the same elements. To e.g. compare a BioSequence with a vector of DNA, compare the elements themselves:
julia> seq = dna"GAGCTGA"; vec = collect(seq);
julia> seq == vec, isequal(seq, vec)
(false, false)
julia> length(seq) == length(vec) && all(i == j for (i, j) in zip(seq, vec))
-true
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 22 October 2024. Using Julia version 1.11.1.