kegg

package
v0.0.0-...-77310ea Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: MIT Imports: 15 Imported by: 0

README

KEGG

Fetch data from KEGG using the KEGG HTTP REST API. All requests are cached so rest.kegg.jp will be queried at most one time.

Tools

There are some tools in the tools directory. Go have a look.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneIdFromName

func GeneIdFromName(name string) string

func GeneJSON

func GeneJSON(g Gene) string

func GetImage

func GetImage(keggId string) image.Image

func GiveMeSomePathways

func GiveMeSomePathways() []string

func PathwaysJSON

func PathwaysJSON(pws GenePathways) string

func ReadablePathwayName

func ReadablePathwayName(id string) string

func ReadablePathwayNames

func ReadablePathwayNames(ids []string) []string

func SortPathwayIds

func SortPathwayIds(ids []string) []string

func StoreImage

func StoreImage(path, filename string, image image.Image) error

Types

type ByName

type ByName []Pathway

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

func (ByName) Swap

func (a ByName) Swap(i, j int)

type Compound

type Compound struct {
	Entry      string
	Name       []string
	Formula    string
	Exact_Mass string
	Mol_Weight string
	Remark     string
	Comment    string
	Reaction   []string
	Pathway    []string
	Module     string
	Enzyme     []string
	Brite      string
	DBLinks    map[string]string
	Atom       []string
	Bond       []string
}

func GetCompound

func GetCompound(id string) Compound

func (Compound) JSON

func (c Compound) JSON() string

func (Compound) Print

func (c Compound) Print()

type Edge

type Edge struct {
	Source int `json:"source"`
	Target int `json:"target"`
	Index  int `json:"index"`
	Weight int `json:"weight"`
}

type Gene

type Gene struct {
	Id          string
	Name        string
	Definition  string
	Orthology   string
	Organism    string
	Pathways    []string
	Modules     []string
	Diseases    []string
	Drug_Target []string
	Classes     []string
	Position    string
	Motif       string
	DBLinks     map[string]string
	Structure   string
	AASEQ       Sequence
	NTSEQ       Sequence
}

func GetGene

func GetGene(id string) Gene

func (Gene) JSON

func (g Gene) JSON() string

func (Gene) Print

func (g Gene) Print()

type GenePathways

type GenePathways struct {
	GeneId   string
	Pathways []string
}

func Pathways

func Pathways(g Gene) GenePathways

Fetch pathways for a specific gene

type Genes

type Genes []Gene

func GetAllHumanGenes

func GetAllHumanGenes() Genes

func SortGenes

func SortGenes(ids []string) Genes

func (Genes) Len

func (g Genes) Len() int

func (Genes) Less

func (g Genes) Less(i, j int) bool

func (Genes) Swap

func (g Genes) Swap(i, j int)

type Graph

type Graph struct {
	Nodes []Node `json:"nodes"`
	Edges []Edge `json:"edges"`
}

func PathwayGraph

func PathwayGraph(keggId string) Graph

type KeggEntry

type KeggEntry struct {
	Id       string       `xml:"id,attr"`
	Name     string       `xml:"name,attr"`
	Type     string       `xml:"type,attr"`
	Link     string       `xml:"link,attr"`
	Graphics KeggGraphics `xml:"graphics"`
}

type KeggGraphics

type KeggGraphics struct {
	Name    string `xml:"name,attr"`
	Fgcolor string `xml:"fgcolor,attr"`
	Bgcolor string `xml:"bgcolor,attr"`
	Type    string `xml:"type,attr"`
	X       string `xml:"x,attr"`
	Y       string `xml:"y,attr"`
	Width   string `xml:"width,attr"`
	Height  string `xml:"height,attr"`
}

type KeggPathway

type KeggPathway struct {
	XMLName   xml.Name       `xml:"pathway"`
	Name      string         `xml:"name,attr"`
	Org       string         `xml:"org,attr"`
	Number    string         `xml:"number,attr"`
	Title     string         `xml:"title,attr"`
	Image     string         `xml:"image,attr"`
	Link      string         `xml:"link,attr"`
	Entries   []KeggEntry    `xml:"entry"`
	Relations []KeggRelation `xml:"relation"`
}

func NewKeggPathway

func NewKeggPathway(keggId string) *KeggPathway

func (*KeggPathway) Print

func (pathway *KeggPathway) Print()

type KeggRelation

type KeggRelation struct {
	Entry1   string        `xml:"entry1,attr"`
	Entry2   string        `xml:"entry2,attr"`
	Type     string        `xml:"type,attr"`
	Subtypes []KeggSubtype `xml:"relation>subtype"`
}

type KeggSubtype

type KeggSubtype struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

type Node

type Node struct {
	Id              int    `json:"id"`
	Name            string `json:"name"`
	Type            int    `json:"type"`
	Size            int    `json:"size"`
	Description     string `json:"description"`
	ForegroundColor string `json:"fgcolor"`
	BackgroundColor string `json:"bgcolor"`
	Shape           string `json:"shape"`
	X               int    `json:"x"`
	Y               int    `json:"y"`
	Height          int    `json:"height"`
	Width           int    `json:"width"`
	Fc              string `json:"fc"`
	Pvalue          string `json:"pvalue"`
}

type Pathway

type Pathway struct {
	Id          string
	Name        string
	Description string
	Class       string
	Pathway_Map string
	Diseases    []string
	Drugs       []string
	DBLinks     []string
	Organism    string
	Genes       []string
	Compounds   []string
}

func GetAllHumanPathways

func GetAllHumanPathways() []Pathway

func GetPathway

func GetPathway(id string) Pathway

func (Pathway) JSON

func (p Pathway) JSON() string

func (Pathway) Print

func (p Pathway) Print()

type Sequence

type Sequence struct {
	Sequence string
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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