nodes

package
v0.0.0-...-fd9d89b Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package nodes a

Package nodes a

Package nodes a

Package nodes a

Package nodes a

Index

Constants

This section is empty.

Variables

View Source
var Divisions map[string]Division

Divisions is a map storing all divisions

View Source
var GenCodes map[string]GenCode

GenCodes is a map storing all divisions

View Source
var Names map[string]Name

Names is a map storing all names

View Source
var Nodes map[string]Node

Nodes is a map storing all nodes

Functions

func SetDivisions

func SetDivisions(divisions map[string]Division)

SetDivisions sets Nodes

func SetGenCodes

func SetGenCodes(divisions map[string]GenCode)

SetGenCodes sets GenCodes

func SetNames

func SetNames(names map[string]Name)

SetNames sets Names

func SetNodes

func SetNodes(nodes map[string]Node)

SetNodes sets Nodes

Types

type Division

type Division struct {
	DivisionID   string `json:"DivisionID"`
	DivisionCode string `json:"DivisionCode"`
	DivisionName string `json:"DivisionName"`
	Comments     string `json:"Comments"`
}

Division defines the NCBI taxonomy division

func DivisionFromArgs

func DivisionFromArgs(items []string) Division

DivisionFromArgs is used when importing data from divisions.dmp

func DivisionFromJSON

func DivisionFromJSON(s string) (Division, error)

DivisionFromJSON return node object from JSON string

func (Division) ToJSON

func (division Division) ToJSON() (string, error)

ToJSON get the JSON string of a division

type GenCode

type GenCode struct {
	GenCodeID        string `json:"GenCodeID"`
	Abbreviation     string `json:"Abbreviation"`
	Name             string `json:"Name"`
	TranslationTable string `json:"TranslationTable"`
	StartCodons      string `json:"StartCodons"`
}

GenCode defines the NCBI taxonomy division

func GenCodeFromArgs

func GenCodeFromArgs(items []string) GenCode

GenCodeFromArgs is used when importing data from divisions.dmp

func GenCodeFromJSON

func GenCodeFromJSON(s string) (GenCode, error)

GenCodeFromJSON return node object from JSON string

func (GenCode) ToJSON

func (gencode GenCode) ToJSON() (string, error)

ToJSON get the JSON string of a gencode

type GeneticCodeItem

type GeneticCodeItem struct {
	GCId   int
	GCName string
}

GeneticCodeItem is

type LineageExItem

type LineageExItem struct {
	TaxId          int
	ScientificName string
	Rank           string
}

LineageExItem is

type MitoGeneticCodeItem

type MitoGeneticCodeItem struct {
	MGCId   int
	MGCName string
}

MitoGeneticCodeItem is

type Name

type Name struct {
	TaxID string     `json:"TaxID"`
	Names []NameItem `json:"Names"`
}

Name includes all names for a taxid

func MergeNames

func MergeNames(names ...Name) Name

MergeNames is used when importing data from names.dmp

func NameFromArgs

func NameFromArgs(items []string) Name

NameFromArgs is used when importing data from names.dmp

func NameFromJSON

func NameFromJSON(s string) (Name, error)

NameFromJSON return Name object from JSON string

func (Name) ToJSON

func (name Name) ToJSON() (string, error)

ToJSON transforms Name to JSON string

type NameItem

type NameItem struct {
	Name       string `json:"Name"`
	UniqueName string `json:"UniqueName"`
	NameClass  string `json:"NameClass"`
}

NameItem defines

type Node

type Node struct {
	TaxID  string `json:"TaxID"`
	PTaxID string `json:"PTaxID"`
	Rank   string `json:"Rank"`

	EMBLCode string `json:"EMBLCode"`

	DivisionID       string `json:"DivisionID"`
	InheritedDivFlag bool   `json:"InheritedDivFlag"`

	GeneticCodeID   string `json:"GeneticCodeID"`
	InheritedGCFlag bool   `json:"InheritedGCFlag"`

	MitochondrialGCID string `json:"MitochondrialGCID"`
	InheritedMGCFlag  bool   `json:"InheritedMGCFlag"`

	GenBankHiddenFlag     bool `json:"GenBankHiddenFlag"`
	HiddenSubtreeRootFlag bool `json:"HiddenSubtreeRootFlag"`

	Comments string `json:"Comments"`
}

Node defines the NCBI taxonomy node

func LCA

func LCA(nodes map[string]Node, taxids []string) (Node, error)

LCA return the lowest common ancestor for a list of taxids

func NodeFromArgs

func NodeFromArgs(items []string) Node

NodeFromArgs is used when importing data from nodes.dmp

func NodeFromJSON

func NodeFromJSON(s string) (Node, error)

NodeFromJSON return node object from JSON string

func (Node) ToJSON

func (node Node) ToJSON() (string, error)

ToJSON get the JSON string of a node

type Taxon

type Taxon struct {
	TaxId           int `json:"TaxId"`
	ScientificName  string
	OtherNames      []TaxonNameItem
	ParentTaxId     int
	Rank            string
	Division        string
	GeneticCode     GeneticCodeItem
	MitoGeneticCode MitoGeneticCodeItem
	Lineage         string
	LineageEx       []LineageExItem
}

Taxon is for json output

func GetTaxonByTaxID

func GetTaxonByTaxID(taxid string) (Taxon, error)

GetTaxonByTaxID return Taxon obejct by taxid

func (Taxon) ToJSON

func (taxon Taxon) ToJSON() (string, error)

type TaxonNameItem

type TaxonNameItem struct {
	ClassCDE string
	DispName string
}

TaxonNameItem is

Jump to

Keyboard shortcuts

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