random

package
v0.31.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package random provides functions to generate random DNA, RNA, and protein sequences.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DNASequence

func DNASequence(length int, seed int64) (string, error)

DNASequence returns a random DNA sequence string of a given length and seed.

Example
// RandomDNASequence builds a DNA Sequence by only passing through arguments a length and a seed that will be use to generate a randomly the sequence. The length needs to be greater than two because every sequence already have a start and stop codon. Seed makes this test deterministic.
randomDNA, _ := DNASequence(15, 2)
fmt.Println(randomDNA)
Output:

TTAAATTAGATGCAA

func ProteinSequence

func ProteinSequence(length int, seed int64) (string, error)

ProteinSequence returns a random protein sequence string of a given length and seed. All returned sequences start M (Methionine) and end with * (stop codon).

Example
// RandomProteinSequence builds a Protein Sequence by only passing through arguments a length and a seed that will be use to generate a randomly the sequence. The length needs to be greater than two because every sequence already have a start and stop codon. Seed makes this test deterministic.
randomProtein, _ := ProteinSequence(15, 2)
fmt.Println(randomProtein)
Output:

MHHPAFRMFNTMYG*

func RNASequence

func RNASequence(length int, seed int64) (string, error)

RNASequence returns a random DNA sequence string of a given length and seed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL