bio

package
Version: v0.0.0-...-eeaf01f Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: GPL-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package bio provides functions related to the genetic code.

Index

Constants

This section is empty.

Variables

View Source
var GeneticCodes = map[int]*GeneticCode{
	1: newGeneticCode(1,
		"Standard",
		"SGC0",
		"FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"---M---------------M---------------M----------------------------"),
	2: newGeneticCode(2,
		"Vertebrate Mitochondrial",
		"SGC1",
		"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSS**VVVVAAAADDEEGGGG",
		"--------------------------------MMMM---------------M------------"),
	3: newGeneticCode(3,
		"Yeast Mitochondrial",
		"SGC2",
		"FFLLSSSSYY**CCWWTTTTPPPPHHQQRRRRIIMMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"----------------------------------MM----------------------------"),
	4: newGeneticCode(4,
		"Mold Mitochondrial; Protozoan Mitochondrial; Coelenterate Mitochondrial; Mycoplasma; Spiroplasma",
		"SGC3",
		"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"--MM---------------M------------MMMM---------------M------------"),
	5: newGeneticCode(5,
		"Invertebrate Mitochondrial",
		"SGC4",
		"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSSSSVVVVAAAADDEEGGGG",
		"---M----------------------------MMMM---------------M------------"),
	6: newGeneticCode(6,
		"Ciliate Nuclear; Dasycladacean Nuclear; Hexamita Nuclear",
		"SGC5",
		"FFLLSSSSYYQQCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"-----------------------------------M----------------------------"),
	9: newGeneticCode(9,
		"Echinoderm Mitochondrial; Flatworm Mitochondrial",
		"SGC8",
		"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG",
		"-----------------------------------M---------------M------------"),
	10: newGeneticCode(10,
		"Euplotid Nuclear",
		"SGC9",
		"FFLLSSSSYY**CCCWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"-----------------------------------M----------------------------"),
	11: newGeneticCode(11,
		"Bacterial, Archaeal and Plant Plastid",
		"",
		"FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"---M---------------M------------MMMM---------------M------------"),
	12: newGeneticCode(12,
		"Alternative Yeast Nuclear",
		"",
		"FFLLSSSSYY**CC*WLLLSPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"-------------------M---------------M----------------------------"),
	13: newGeneticCode(13,
		"Ascidian Mitochondrial",
		"",
		"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSSGGVVVVAAAADDEEGGGG",
		"---M------------------------------MM---------------M------------"),
	14: newGeneticCode(14,
		"Alternative Flatworm Mitochondrial",
		"",
		"FFLLSSSSYYY*CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG",
		"-----------------------------------M----------------------------"),
	15: newGeneticCode(15,
		"Blepharisma Macronuclear",
		"",
		"FFLLSSSSYY*QCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"-----------------------------------M----------------------------"),
	16: newGeneticCode(16,
		"Chlorophycean Mitochondrial",
		"",
		"FFLLSSSSYY*LCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"-----------------------------------M----------------------------"),
	21: newGeneticCode(21,
		"Trematode Mitochondrial",
		"",
		"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNNKSSSSVVVVAAAADDEEGGGG",
		"-----------------------------------M---------------M------------"),
	22: newGeneticCode(22,
		"Scenedesmus obliquus Mitochondrial",
		"",
		"FFLLSS*SYY*LCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"-----------------------------------M----------------------------"),
	23: newGeneticCode(23,
		"Thraustochytrium Mitochondrial",
		"",
		"FF*LSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"--------------------------------M--M---------------M------------"),
	24: newGeneticCode(24,
		"Pterobranchia Mitochondrial",
		"",
		"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSSKVVVVAAAADDEEGGGG",
		"---M---------------M---------------M---------------M------------"),
	25: newGeneticCode(25,
		"Candidate Division SR1 and Gracilibacteria",
		"",
		"FFLLSSSSYY**CCGWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"---M-------------------------------M---------------M------------"),
	26: newGeneticCode(26,
		"Pachysolen tannophilus Nuclear",
		"",
		"FFLLSSSSYY**CC*WLLLAPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG",
		"-------------------M---------------M----------------------------"),
}

GeneticCodes is a map holding genetic codes. This file was generated using gcode program from NCBI genetic codes file.

Functions

func GetCodons

func GetCodons() <-chan string

GetCodons returns a channel with every codon (64).

func Wrap

func Wrap(seq string, n int) (s string)

Wrap inputs a string and wraps it so string length is n characters or less.

Types

type GeneticCode

type GeneticCode struct {
	// Id according to NCBI.
	ID int
	// Genetic code name.
	Name string
	// Short name (if present).
	ShortName string
	// Map from codon to amino acid or '*' for stop codon.
	Map map[string]byte
	// NCodon is total number of codons (61 for the standard code).
	NCodon int
	// CodonNum translates codon into its' number.
	CodonNum map[string]byte
	// NumCodon translates codon number to its' string.
	NumCodon map[byte]string
}

GeneticCode is a structure holding genetic code.

func (*GeneticCode) IsStopCodon

func (gcode *GeneticCode) IsStopCodon(codon string) bool

IsStopCodon tests if the string is a stop-codon (DNA alphabet, capital letters).

func (*GeneticCode) Translate

func (gcode *GeneticCode) Translate(nseq string) (string, error)

Translate translates nucleotide sequence string into the protein string. Error is returned is sequence is not divisible by three, non-terminal stop-codon is found or wrong codon is encountered.

type Sequence

type Sequence struct {
	Name     string
	Sequence string
}

Sequence is a type which is intended for storing nucleotide or protein sequence with it's name.

func (Sequence) String

func (seq Sequence) String() (s string)

String returns a sequence in FASTA format.

type Sequences

type Sequences []Sequence

Sequences stores multiple sequences. E.g. a sequence alignment.

func ParseFasta

func ParseFasta(rd io.Reader) (seqs Sequences, err error)

ParseFasta parses FASTA sequences from a reader.

func (Sequences) String

func (seqs Sequences) String() (s string)

String returns sequences in FASTA format.

Source Files

Jump to

Keyboard shortcuts

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