alphabet

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package alphabet defines the abstract interface for a biological alphabet.

Index

Constants

View Source
const (
	// GapLetter is the character used to represent a sequence gap.
	GapLetter = "-"

	// IupacLetters are the IUPAC ambiguous encodings
	IupacLetters = "RYSWKM" + "BDHV" + "N"

	// DnaLetters is the strict four-letter representation of DNA.
	//	ATGC: Any of one nucleotide codes (i.e., 4 choose 1)
	DnaLetters = "ATGC"

	// DnaIupacLetters is the IUPAC representation of DNA.
	//  -: Any of zero nucleotide codes (i.e., 4 choose 0)
	// 	ATGC: Any of one nucleotide codes (i.e., 4 choose 1)
	//	RYSWKM: Any of two nucleotide codes (i.e., 4 choose 2)
	//	BDHV: Any of three nucleotide codes (i.e., 4 choose 3)
	//  N: Any of four nucleotide codes (i.e., 4 choose 4)
	DnaIupacLetters = DnaLetters + IupacLetters + GapLetter

	// RnaLetters is the strict four-letter representation of DNA.
	//	AUGC: Any of one nucleotide codes (i.e., 4 choose 1)
	RnaLetters = "AUGC"

	// RnaIupacLetters is the IUPAC representation of RNA.
	//  -: Any of zero nucleotide codes (i.e., 4 choose 0)
	//  AUGC: Any of one nucleotide codes (i.e., 4 choose 1)
	//	RYSWKM: Any of two nucleotide codes (i.e., 4 choose 2)
	//	BDHV: Any of three nucleotide codes (i.e., 4 choose 3)
	//  N: Any of four nucleotide codes (i.e., 4 choose 4)
	RnaIupacLetters = RnaLetters + IupacLetters + GapLetter

	// ProteinLetters is the gapless standard protein letters.
	ProteinLetters = "ACDEFGHIKLMNPQRSTVWY"
)

Variables

This section is empty.

Functions

func TestExcludesSingleLetters

func TestExcludesSingleLetters(letters []byte) []byte

TestExcludesSingleLetters a test helper that returns all ASCII letters not in the input set

func TestHasExpectedLetter

func TestHasExpectedLetter(a Interface, c string) func(t *testing.T)

TestHasExpectedLetter is a test helper to wrap a check for an alphabet.Interface implementation having a given letter

func TestIsExpectedLength

func TestIsExpectedLength(a Interface, n int) func(t *testing.T)

TestIsExpectedLength is a test helper to wrap a check for an alphabet.Interface implementation having the correct number of letters

Types

type Complementer

type Complementer interface {
	Complement(string) string
}

Complementer is any alphabet that has complementing characters

type Interface

type Interface interface {
	// Must be stringable
	fmt.Stringer

	// Contains checks that the given elements are in the Alphabet
	Contains(...string) []bool

	// Length is the number of letters in the Alphabet
	Length() int
}

Interface is the abstract representation of a finite-letter alphabet where validity of a given letter can be checked.

Directories

Path Synopsis
Package hashmap is a collection of defined biological alphabets such as DNA, RNA, and Protein
Package hashmap is a collection of defined biological alphabets such as DNA, RNA, and Protein

Jump to

Keyboard shortcuts

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