The Ribosome package is a Go library designed for efficient transcription and translation of DNA and RNA sequences, inspired by the real processes in living cells. The package provides an easy-to-use API for handling DNA, RNA, and Protein sequences, as well as functionality to work with different genetic code translation tables.
Disclaimer: Go language is not a popular choice for bioinformatics library such as this and there are much better solutions written in other languages. This library was written just for fun and as proof of concept.
- DNA, RNA, and Protein sequence handling
- Support for ambiguous nucleotides and amino acids
- Transcription of DNA to RNA
- Translation of RNA to Protein
- Genetic code translation tables with custom codon usage modification
- ORF finding
- GC-content calculation
To install the Ribosome package, use the following command:
go get github.com/dissipative/ribosome
Import the Ribosome package in your Go project:
import "github.com/dissipative/ribosome"
Create a DNA sequence:
dna, err := sequence.NewDNASequence("ATGCGAATTCAG")
Transcribe a DNA sequence to RNA:
rna, err := dna.Transcribe()
Get a translation table by its ID:
codonTable, err := ribosome.GetCodonTable(1) // Get the standard genetic code (table 1)
Translate an RNA sequence to a Protein sequence:
protein, err := rna.Translate(&codonTable)
customCodons := map[string]ribosome.AminoAcid{
"ATA": 'M', // Change ATA codon to Methionine
}
err = table.ModifyCodonUsage(customCodons)
The Ribosome package handles ambiguous nucleotides and amino acids with ease. For example, you can transcribe DNA sequences with ambiguous bases and translate RNA sequences with ambiguous codons to protein sequences with ambiguous amino acids.