[][src]Crate nucleobases

Standardized nucleobase data type

Type Nucleobase represents a digital version of a physical nucleotide base in a ribonucleic acid structure (DNA, RNA, mRNA, etc.).

The Nucleobase enum has 5 variants just as nucleobases that exist in nature. There's:

No Compromises

Astute eyes will notice the fact that Thymine and Uracil have separate enumerations from one another despite being nearly identical in every practical scenario. This is a conscious choice intended to stand in-line with the Rust philosophy of having the least amount of compromises in code. The goal is to allow users to determine how they handle Thymine and Uracil without making asumptions about implementation inside of the library itself.

Helper Methods

For that reason, helper methods that determine whether or not a nucleobase is a deoxyribonucleotide base or a ribonucleotide base have been included for those who desire that functionality without limiting those who do not care.

In addition to the methods indicating whether or not a base is a ribonucleotide base or a deoxyribonucleotide base, there are helper methods for determining whether or not the base is a:

Binary Serialization

With the three sets of binary property methods provided the exact identity of a nucleobase can be determined and serialized following the chart below.

PyrimidineThymine / UracilCytosine

Whether a base is Thymine or Uracil comes down to whether it is a deoxyribonucleotide base or a ribonucleotide base.



The error type for conversions between Nucleobase and other types


The Nucleobase type. See the module level documentation for more.