downloaddb

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NCBI_refseq_ftp_host = "ftp.ncbi.nlm.nih.gov:21"
	NCBI_refseq_ftp_path = "/refseq/release/"
	NCBI_eutil_api_path  = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/"
)
View Source
const (
	Uniprot_ftp_host           = "ftp.uniprot.org:21"
	Uniprot_ftp_taxonomic_path = "/pub/databases/uniprot/current_release/knowledgebase/taxonomic_divisions/"
)

Variables

View Source
var (
	BIOCYC_API = "https://websvc.biocyc.org"
)
View Source
var (
	KEGG_API = "http://rest.kegg.jp"
)
View Source
var (
	NCBI_refseq_valid = map[string]bool{
		"archaea":              true,
		"bacteria":             true,
		"fungi":                true,
		"invertebrate":         true,
		"mitochondrion":        true,
		"plant":                true,
		"plasmid":              true,
		"plastid":              true,
		"protozoa":             true,
		"viral":                true,
		"vertebrate_mammalian": true,
		"vertebrate_other":     true,
	}
)
View Source
var (
	Uniprot_ftp_taxonomic_valid = map[string]bool{
		"archaea":       true,
		"bacteria":      true,
		"fungi":         true,
		"human":         true,
		"invertebrates": true,
		"mammals":       true,
		"plants":        true,
		"rodents":       true,
		"vertebrates":   true,
		"viruses":       true,
	}
)

Functions

func DownloadBiocyc

func DownloadBiocyc(dbPath string)

func DownloadGenbankGenome

func DownloadGenbankGenome(genomeId string)

func DownloadKEGG

func DownloadKEGG(dbPath string)

func DownloadRefseq

func DownloadRefseq(outputFile string, taxon string)

func DownloadUniprot

func DownloadUniprot(outputFile string, taxon string)

func GetBiocycPathway

func GetBiocycPathway(id string) []string

func GetKeggPathway

func GetKeggPathway(id string) []string

func IODownloadFTP

func IODownloadFTP(dstFile *os.File, host string, path string)

func IODownloadHTTP

func IODownloadHTTP(dstFile *os.File, url string)

func IOListFTP

func IOListFTP(host string, path string) []*ftp.Entry

func ParseGenbank

func ParseGenbank(gbkFile string)

Types

type Pathway

type Pathway struct {
	XMLName xml.Name `xml:"Pathway"`
	ID      string   `xml:"ID,attr"`
	Name    string   `xml:"common-name"`
}

type WriteCounter

type WriteCounter struct {
	Total uint64
}

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func (WriteCounter) PrintProgress

func (wc WriteCounter) PrintProgress()

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

type XMLRoot

type XMLRoot struct {
	XMLName  xml.Name  `xml:"ptools-xml"`
	Version  xml.Attr  `xml:"ptools-version,attr"`
	Pathways []Pathway `xml:"Pathway"`
}

Jump to

Keyboard shortcuts

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