Documentation ¶
Overview ¶
Package taxon provides APIs of parsing, writing (to bolt database) and quering APIs on NCBI taxonomy data, a web server with REST API is also available for query.
Therefore, you can build a NCBI taxonomy query server that could be accessed both from local or remote server. [goTaxon](https://github.com/shenwei356/gotaxon) is one of this implemention.
Index ¶
- Variables
- func ImportDivisions(dbFile string, bucket string, dataFile string, batchSize int, force bool)
- func ImportGenCodes(dbFile string, bucket string, dataFile string, batchSize int, force bool)
- func ImportGiTaxid(dbFile string, bucket string, dataFile string, chunkSize int, force bool)
- func ImportNames(dbFile string, bucket string, dataFile string, chunkSize int, force bool)
- func ImportNodes(dbFile string, bucket string, dataFile string, batchSize int, force bool)
- func InitDatabase(dbPath string, dbFile string, force bool)
- func LoadAllDivisions(db *bolt.DB, bucket string) (map[string]nodes.Division, error)
- func LoadAllGenCodes(db *bolt.DB, bucket string) (map[string]nodes.GenCode, error)
- func LoadAllNames(db *bolt.DB, bucket string) (map[string]nodes.Name, error)
- func LoadAllNodes(db *bolt.DB, bucket string) (map[string]nodes.Node, error)
- func QueryDivisionByDivisionID(db *bolt.DB, bucket string, ids []string) ([]nodes.Division, error)
- func QueryGenCodeByGenCodeID(db *bolt.DB, bucket string, ids []string) ([]nodes.GenCode, error)
- func QueryGi2Taxid(db *bolt.DB, bucket string, gis []string) ([]string, error)
- func QueryNameByTaxID(db *bolt.DB, bucket string, taxids []string) ([]nodes.Name, error)
- func QueryNodeByTaxID(db *bolt.DB, bucket string, taxids []string) ([]nodes.Node, error)
- func QueryTaxIDByName(db *bolt.DB, bucket string, useRegexp bool, nameClass string, threads int, ...) (map[string][]string, error)
- func StartServer(dbFilePath string, port int, timeout int, threads int)
- type DBPool
- type MessageGI2TaxidMap
- type MessageLCAMap
- type MessageTaxid2TaxonMap
- type MssageName2TaxIDMap
- type TaxIDSciNameItem
Constants ¶
This section is empty.
Variables ¶
var DbFile string
DbFile is the bolt database filename
var DbPath string
DbPath is the database path
Functions ¶
func ImportDivisions ¶
ImportDivisions reads data from divisions.dmp and write to bolt database
func ImportGenCodes ¶
ImportGenCodes reads data from gencodes.dmp and write to bolt database
func ImportGiTaxid ¶
ImportGiTaxid reads gi_taxid_nucl or gi_taxid_prot file and writes the data to database
func ImportNames ¶
ImportNames reads data from names.dmp and write to bolt database
func ImportNodes ¶
ImportNodes reads data from nodes.dmp and write to bolt database
func InitDatabase ¶
InitDatabase initializes database direcotry
func LoadAllDivisions ¶
LoadAllDivisions loads all divisions into memory
func LoadAllGenCodes ¶
LoadAllGenCodes loads all gencodes into memory
func LoadAllNames ¶
LoadAllNames loads all names into memory
func LoadAllNodes ¶
LoadAllNodes loads all nodes into memory
func QueryDivisionByDivisionID ¶
QueryDivisionByDivisionID querys Division by taxid
func QueryGenCodeByGenCodeID ¶
QueryGenCodeByGenCodeID querys GenCode by taxid
func QueryGi2Taxid ¶
QueryGi2Taxid querys taxids by gis
func QueryNameByTaxID ¶
QueryNameByTaxID querys Name by taxid
func QueryNodeByTaxID ¶
QueryNodeByTaxID querys Node by taxid
Types ¶
type DBPool ¶
type DBPool struct {
// contains filtered or unexported fields
}
DBPool is bolt db connection pool
type MessageGI2TaxidMap ¶
type MessageGI2TaxidMap struct { Status string `json:"status"` Message string `json:"message"` Taxids map[string]string `json:"gi2taxid"` }
MessageGI2TaxidMap is
func RemoteQueryGi2Taxid ¶
func RemoteQueryGi2Taxid(host string, port int, dbType string, gis []string) MessageGI2TaxidMap
RemoteQueryGi2Taxid query from remote server
type MessageLCAMap ¶
type MessageLCAMap struct { Status string `json:"status"` Message string `json:"message"` LCA map[string]nodes.Taxon `json:"taxids2taxon"` }
MessageLCAMap is
func RemoteQueryLCA ¶
func RemoteQueryLCA(host string, port int, queries []string) MessageLCAMap
RemoteQueryLCA is
type MessageTaxid2TaxonMap ¶
type MessageTaxid2TaxonMap struct { Status string `json:"status"` Message string `json:"message"` Taxons map[string]nodes.Taxon `json:"taxid2taxon"` }
MessageTaxid2TaxonMap is
func RemoteQueryTaxid2Taxon ¶
func RemoteQueryTaxid2Taxon(host string, port int, taxids []string) MessageTaxid2TaxonMap
RemoteQueryTaxid2Taxon is
type MssageName2TaxIDMap ¶
type MssageName2TaxIDMap struct { Status string `json:"status"` Message string `json:"message"` TaxIDs map[string][]TaxIDSciNameItem `json:"name2taxid"` }
MssageName2TaxIDMap is
func RemoteQueryName2TaxID ¶
func RemoteQueryName2TaxID(host string, port int, useRegexp bool, nameClass string, names []string) MssageName2TaxIDMap
RemoteQueryName2TaxID is
type TaxIDSciNameItem ¶
TaxIDSciNameItem is