data

package module
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: GPL-2.0 Imports: 34 Imported by: 3

README

data

Build Status Go Report Card GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func IterEntry

func IterEntry(d DataManager) chan Entry

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func ParseSimpleWb

func ParseSimpleWb(xlFile *SimpleWorkbook) ([]dataIndex, error)

JSON -> Simple Workbook parsed already

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func SaveIndex

func SaveIndex(uri string, root string) error

Types

type Band

type Band struct {
	Chr   string `json:"chr"`
	Start int    `json:"start"`
	End   int    `json:"end"`
	Id    string `json:"id"`
	Value string `json:"value"`
}

type Bed3

type Bed3 interface {
	Chr() string
	Start() int
	End() int
}

type Bed4

type Bed4 struct {
	// contains filtered or unexported fields
}

func (Bed4) Chr

func (b Bed4) Chr() string

func (Bed4) End

func (b Bed4) End() int

func (Bed4) Id

func (b Bed4) Id() string

func (Bed4) Start

func (b Bed4) Start() int

type BigBedManager

type BigBedManager struct {
	// contains filtered or unexported fields
}

func InitBigBedManager

func InitBigBedManager(dbname string, root string) *BigBedManager

func NewBigBedManager

func NewBigBedManager(uri string, dbname string, root string) *BigBedManager

func (*BigBedManager) Add

func (m *BigBedManager) Add(key string, reader io.ReadSeeker, uri string) error

func (*BigBedManager) AddURI

func (bb *BigBedManager) AddURI(uri string, key string) error

func (*BigBedManager) Del

func (m *BigBedManager) Del(key string) error

func (*BigBedManager) Get

func (m *BigBedManager) Get(key string) (string, bool)

func (*BigBedManager) GetAttr

func (m *BigBedManager) GetAttr(key string) (map[string]interface{}, bool)

func (*BigBedManager) List

func (m *BigBedManager) List() []string

func (*BigBedManager) Move

func (m *BigBedManager) Move(key1 string, key2 string) bool

func (*BigBedManager) ServeTo

func (m *BigBedManager) ServeTo(router *mux.Router)

func (*BigBedManager) SetAttr

func (m *BigBedManager) SetAttr(key string, value map[string]interface{}) error

type BigWigManager

type BigWigManager struct {
	// contains filtered or unexported fields
}

func InitBigWigManager

func InitBigWigManager(dbname string, indexRoot string) *BigWigManager

func NewBigWigManager

func NewBigWigManager(uri string, dbname string, indexRoot string) *BigWigManager

func (*BigWigManager) Add

func (m *BigWigManager) Add(key string, reader io.ReadSeeker, uri string) error

func (*BigWigManager) AddURI

func (m *BigWigManager) AddURI(uri string, key string) error

func (*BigWigManager) Del

func (m *BigWigManager) Del(key string) error

func (*BigWigManager) Get

func (m *BigWigManager) Get(key string) (string, bool)

func (*BigWigManager) GetAttr

func (m *BigWigManager) GetAttr(key string) (map[string]interface{}, bool)

func (*BigWigManager) List

func (m *BigWigManager) List() []string

func (*BigWigManager) Move

func (m *BigWigManager) Move(key1 string, key2 string) bool

func (*BigWigManager) ServeTo

func (m *BigWigManager) ServeTo(router *mux.Router)

TODO ls Add Attr

func (*BigWigManager) SetAttr

func (m *BigWigManager) SetAttr(key string, value map[string]interface{}) error

type CytoBand

type CytoBand struct {
	// contains filtered or unexported fields
}

type CytoBandManager

type CytoBandManager struct {
	// contains filtered or unexported fields
}

func InitCytoBandManager

func InitCytoBandManager(id string) *CytoBandManager

func NewCytoBandManager

func NewCytoBandManager(id string) *CytoBandManager

func (*CytoBandManager) Add

func (m *CytoBandManager) Add(genome string) error

func (*CytoBandManager) AddURI

func (m *CytoBandManager) AddURI(uri string, key string) error

func (*CytoBandManager) Del

func (m *CytoBandManager) Del(genome string) error

func (*CytoBandManager) Get

func (m *CytoBandManager) Get(genome string) (string, bool)

func (*CytoBandManager) List

func (m *CytoBandManager) List() []string

func (*CytoBandManager) Move

func (m *CytoBandManager) Move(key1 string, key2 string) bool

func (*CytoBandManager) ServeTo

func (m *CytoBandManager) ServeTo(router *mux.Router)

type DataLoader

type DataLoader interface {
	Load(interface{}) error
}

type DataManager

type DataManager interface {
	DataRouter
	AddURI(uri string, key string) error
	Del(string) error
	List() []string
	Get(string) (string, bool)
	Move(key1 string, key2 string) bool
}

type DataRouter

type DataRouter interface {
	ServeTo(*mux.Router)
}

type DataServer

type DataServer interface {
	DataRouter
	DataLoader
}

type Entry

type Entry struct {
	Name string
	URI  string
}

type FileManager

type FileManager struct {
	// contains filtered or unexported fields
}

func InitFileManager

func InitFileManager(dbname string) *FileManager

func NewFileManager

func NewFileManager(uri string, dbname string) *FileManager

func (*FileManager) AddURI

func (m *FileManager) AddURI(uri string, key string) error

func (*FileManager) Del

func (m *FileManager) Del(key string) error

func (*FileManager) Get

func (m *FileManager) Get(key string) (string, bool)

func (*FileManager) List

func (m *FileManager) List() []string

func (*FileManager) Move

func (m *FileManager) Move(key1 string, key2 string) bool

func (*FileManager) ServeTo

func (m *FileManager) ServeTo(router *mux.Router)

type HicManager

type HicManager struct {
	// contains filtered or unexported fields
}

func InitHicManager

func InitHicManager(dbname string) *HicManager

func NewHicManager

func NewHicManager(uri string, dbname string) *HicManager

func (*HicManager) Add

func (m *HicManager) Add(key string, reader io.ReadSeeker, uri string) error

func (*HicManager) AddURI

func (m *HicManager) AddURI(uri string, key string) error

func (*HicManager) Del

func (m *HicManager) Del(key string) error

func (*HicManager) Get

func (m *HicManager) Get(key string) (string, bool)

func (*HicManager) GetAttr

func (m *HicManager) GetAttr(key string) (map[string]interface{}, bool)

func (*HicManager) List

func (m *HicManager) List() []string

func (*HicManager) Move

func (m *HicManager) Move(key1 string, key2 string) bool

func (*HicManager) ServeTo

func (m *HicManager) ServeTo(router *mux.Router)

func (*HicManager) SetAttr

func (m *HicManager) SetAttr(key string, value map[string]interface{}) error

type IndexEntry

type IndexEntry struct {
	Genome string
	Id     string
	Type   string
	Nc     int
	Vc     []int
}

TODO THIS add more interface

type Loader

type Loader struct {
	IndexRoot string
	Plugins   map[string]func(string, interface{}) (DataRouter, error)
	Data      map[string]DataRouter
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(root string) *Loader

func (*Loader) AddDataMiddleware

func (m *Loader) AddDataMiddleware(uri string, h http.Handler) http.Handler

func (*Loader) AddLoader

func (e *Loader) AddLoader(format string, f func(string, interface{}) (DataRouter, error)) error

func (*Loader) Factory

func (e *Loader) Factory(dbname string, data interface{}, format string) func(string, interface{}) (DataRouter, error)

func (*Loader) Load

func (m *Loader) Load(uri string, router *mux.Router) error

func (*Loader) LoadWorkbook

func (m *Loader) LoadWorkbook(wb *SimpleWorkbook, router *mux.Router) error

func (*Loader) Refresh

func (e *Loader) Refresh(dbname string, data interface{}, format string) error

func (*Loader) Reload

func (m *Loader) Reload(uri string) error

type Manager

type Manager interface {
	DataManager
	Add(key string, reader io.ReadSeeker, uri string) error
	SetAttr(key string, values map[string]interface{}) error
	GetAttr(key string) (map[string]interface{}, bool)
}

type MapManager

type MapManager struct {
	// contains filtered or unexported fields
}

func InitMapManager

func InitMapManager(name string) *MapManager

func NewMapManager

func NewMapManager(uri string, name string) *MapManager

func (*MapManager) AddURI

func (m *MapManager) AddURI(uri string, key string) error

func (*MapManager) Del

func (m *MapManager) Del(key string) error

func (*MapManager) Get

func (m *MapManager) Get(key string) (string, bool)

func (*MapManager) List

func (m *MapManager) List() []string

func (*MapManager) Move

func (m *MapManager) Move(key1 string, key2 string) bool

func (*MapManager) ServeTo

func (m *MapManager) ServeTo(router *mux.Router)

type NamedIndexEntry

type NamedIndexEntry struct {
	Genome string
	Id     string
	Type   string
	Nid    string
	Vids   []string
}

type ShortBed

type ShortBed interface {
	Chr() string
	Start() int
	End() int
}

type SimpleWorkbook

type SimpleWorkbook struct {
	SheetNames []string
	Sheets     map[string][][]string
}

type TabixManager

type TabixManager struct {
	// contains filtered or unexported fields
}

func InitTabixManager

func InitTabixManager(dbname string) *TabixManager

func NewTabixManager

func NewTabixManager(uri string, dbname string) *TabixManager

func (*TabixManager) AddURI

func (T *TabixManager) AddURI(uri string, key string) error

func (*TabixManager) Del

func (m *TabixManager) Del(key string) error

func (*TabixManager) Get

func (m *TabixManager) Get(key string) (string, bool)

func (*TabixManager) GetAttr

func (m *TabixManager) GetAttr(key string) (map[string]interface{}, bool)

func (*TabixManager) List

func (m *TabixManager) List() []string

func (*TabixManager) Move

func (m *TabixManager) Move(key1 string, key2 string) bool

func (*TabixManager) ServeTo

func (T *TabixManager) ServeTo(router *mux.Router)

func (*TabixManager) SetAttr

func (m *TabixManager) SetAttr(key string, value map[string]interface{}) error

type TrackManager

type TrackManager struct {
	// contains filtered or unexported fields
}

func InitTrackManager

func InitTrackManager(dbname string, root string) *TrackManager

func NewTrackManager

func NewTrackManager(uri string, dbname string, root string) *TrackManager

func (*TrackManager) Add

func (m *TrackManager) Add(key string, reader io.ReadSeeker, uri string) error

func (*TrackManager) AddURI

func (m *TrackManager) AddURI(uri string, key string) error

func (*TrackManager) Del

func (m *TrackManager) Del(k string) error

func (*TrackManager) Get

func (m *TrackManager) Get(key string) (string, bool)

func (*TrackManager) GetAttr

func (m *TrackManager) GetAttr(key string) (map[string]interface{}, bool)

func (*TrackManager) List

func (m *TrackManager) List() []string

func (*TrackManager) Move

func (m *TrackManager) Move(key1 string, key2 string) bool

func (*TrackManager) ServeTo

func (m *TrackManager) ServeTo(router *mux.Router)

func (*TrackManager) SetAttr

func (m *TrackManager) SetAttr(key string, values map[string]interface{}) error

Jump to

Keyboard shortcuts

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