Public Documentation

Documentation for BioSymbols.jl's public interface.

See Internal Documentation for internal package docs.

Contents

Index

Public Interface

BioSymbols.BioSymbolsModule

A package to define types for amino acids and nucleic acids and to perform operations on these types. For more information see:

  • Amino Acid Symbols: https://github.com/BioJulia/BioSymbols.jl/blob/master/docs/src/aminoacids.md
  • Nucleic Acid Symbols: https://github.com/BioJulia/BioSymbols.jl/blob/master/docs/src/nucleicacids.md
  • Creating Sequences: https://github.com/BioJulia/BioSymbols.jl/blob/master/docs/src/sequences.md

Functions:

  • alphabet
  • compatbits
  • gap
  • isGC
  • isambiguous
  • iscertain
  • iscompatible
  • isgap
  • ispurine
  • ispyrimidine
source
BioSymbols.ACGTNConstant
ACGTN

Unambiguous DNA and DNA_N.

Examples

julia> ACGTN
(DNA_A, DNA_C, DNA_G, DNA_T, DNA_N)
source
BioSymbols.ACGUNConstant
ACGUN

Unambiguous RNA and RNA_N.

Examples

julia> ACGUN
(RNA_A, RNA_C, RNA_G, RNA_U, RNA_N)
source
BioSymbols.BioSymbolType

The BioSymbol type is an abstract type that represents any kind of biological symbol that may appear in data such as biological sequences, SNP datasets and more.

Every abstract or concrete subtype of BioSymbol is expected to have the following methods defined:

isterm bytemask prefix type_text

source
BioSymbols.alphabetMethod
alphabet(AminoAcid)

Get all symbols of AminoAcid in sorted order.

Examples

julia> alphabet(AminoAcid)
(AA_A, AA_R, AA_N, AA_D, AA_C, AA_Q, AA_E, AA_G, AA_H, AA_I, AA_L, AA_K, AA_M, AA_F, AA_P, AA_S, AA_T, AA_W, AA_Y, AA_V, AA_O, AA_U, AA_B, AA_J, AA_Z, AA_X, AA_Term, AA_Gap)

julia> issorted(alphabet(AminoAcid))
true
source
BioSymbols.alphabetMethod
alphabet(DNA)

Get all symbols of DNA in sorted order.

Examples

julia> alphabet(DNA)
(DNA_Gap, DNA_A, DNA_C, DNA_M, DNA_G, DNA_R, DNA_S, DNA_V, DNA_T, DNA_W, DNA_Y, DNA_H, DNA_K, DNA_D, DNA_B, DNA_N)

julia> issorted(alphabet(DNA))
true
source
BioSymbols.alphabetMethod
alphabet(RNA)

Get all symbols of RNA in sorted order.

Examples

julia> alphabet(RNA)
(RNA_Gap, RNA_A, RNA_C, RNA_M, RNA_G, RNA_R, RNA_S, RNA_V, RNA_U, RNA_W, RNA_Y, RNA_H, RNA_K, RNA_D, RNA_B, RNA_N)

julia> issorted(alphabet(RNA))
true
source
BioSymbols.compatbitsMethod
compatbits(aa::AminoAcid)

Return the compatibility bits of aa as UInt32. The resulting UInt32 has one bit set per amino acid it is compatible with.

For example, J is compatible with I (bit 10) and L (bit 11), and so is 0x00000600.

Examples

julia> compatbits(AA_A)
0x00000001

julia> compatbits(AA_E)
0x00000040

julia> compatbits(AA_J)
0x00000600

julia> compatbits(AA_X)
0x003fffff

julia> compatbits(AA_Gap)
0x00000000
source
BioSymbols.compatbitsMethod
compatbits(nt::NucleicAcid)

Return the compatibility bits of nt as UInt8. The resulting UInt8 has the lower four bits set if nt is compatible with A, C, G and T/U, respectively.

Hence, RNA_Gap is 0x00 (not compatible with any nucleotide), and DNA_W is 0x09 (compatible with A and T)

Examples

julia> compatbits(DNA_A)
0x01

julia> compatbits(DNA_C)
0x02

julia> compatbits(DNA_N)
0x0f

julia> compatbits(DNA_W)
0x09

julia> compatbits(RNA_Gap)
0x00
source
BioSymbols.complementMethod
complement(nt::NucleicAcid)

Return the complementary nucleotide of nt.

This function returns the union of all possible complementary nucleotides.

Examples

julia> complement(DNA_A)
DNA_T

julia> complement(DNA_N)
DNA_N

julia> complement(RNA_U)
RNA_A
source
BioSymbols.gapFunction
gap(::Type{T})::T

Return the gap (indel) representation of T. By default, gap is defined for DNA, RNA, AminoAcid and Char.

Examples

julia> gap(RNA)
RNA_Gap

julia> gap(Char)
'-': ASCII/Unicode U+002D (category Pd: Punctuation, dash)
source
BioSymbols.iscompatibleMethod
iscompatible(x::S, y::S) where S <: BioSymbol

Test if x and y are compatible with each other.

Examples

julia> iscompatible(AA_A, AA_R)
false

julia> iscompatible(AA_A, AA_X)
true

julia> iscompatible(DNA_A, DNA_A)
true

julia> iscompatible(DNA_C, DNA_N)  # DNA_N can be DNA_C
true

julia> iscompatible(DNA_C, DNA_R)  # DNA_R (A or G) cannot be DNA_C
false
source
BioSymbols.stringbyteFunction
stringbyte(::BioSymbol)::UInt8

For biosymbol types that can be represented as ASCII characters, stringbyte(x) returns the printable ASCII byte that represents the character in a string.

Examples

julia> stringbyte(DNA_A) == UInt8('A')
true

julia> stringbyte(AA_Gap) == UInt8('-')
true
source