Back to

Package cellosaurus

Latest Go to latest

The latest major version is .

Published: Dec 9, 2017 | License: MIT | Module:


Package cellosaurus is an API for the Cellosaurus database.

The Cellosaurus is publicly accessible at:


This API, and all its usage documentation, are available at:




const (
	GET    string = "GET"
	HEAD   string = "HEAD"
	POST   string = "POST"
	PUT    string = "PUT"
	DELETE string = "DELETE"
	OPTION string = "OPTION"
	PATCH  string = "PATCH"

HTTP methods.

func BadRequest

func BadRequest(c *gin.Context)

BadRequest responds with error status code 400, Bad Request.

func Database

func Database() (*sql.DB, error)

Database creates a new database connection.

func FindCell

func FindCell(c *gin.Context)

FindCell handles GET requests for /cell-lines/:id.

func GetReleaseInfo

func GetReleaseInfo(c *gin.Context)

GetReleaseInfo returns release information for current version of database.

func Init

func Init(c Context)

Init server.

func InternalServerError

func InternalServerError(c *gin.Context)

InternalServerError responds with error status code 500, Internal Server Error.

func ListCells

func ListCells(c *gin.Context)

ListCells handles GET requests for /cell-lines.

func ListReferences

func ListReferences(c *gin.Context)

ListReferences handles GET requests for /references.

func ListTerminologies

func ListTerminologies(c *gin.Context)

ListTerminologies returns a list of terminologies used in database.

func NotFound

func NotFound(c *gin.Context)

NotFound responds with error status code 404, Not Found.

func Render

func Render(c *gin.Context, indent bool, obj interface{})

Render applies indentation settings to response.

func SetMysqlConf

func SetMysqlConf()

SetMysqlConf updates mysqlConf using environment variables.

type Accession

type Accession struct {
	Pri string   `json:"primary"`
	Sec []string `json:"secondary,omitempty"`

Accession contains primary and secondary accession number(s).

type CC

type CC struct {
	Category string `json:"category,omitempty"`
	Comment  string `json:"comment,omitemtpy"`

CC is a comments data.

type Cell

type Cell struct {
	ID string    `json:"identifier"`
	AC Accession `json:"accession"`
	SY []string  `json:"synonyms,omitempty"`
	CA string    `json:"category,omitempty"`
	SX string    `json:"sex,omitempty"`
	DR []DR      `json:"cross-references,omitempty"`
	RX []string  `json:"reference-identifiers,omitempty"`
	WW []string  `json:"web-pages,omitempty"`
	CC []CC      `json:"comments,omitempty"`
	ST ST        `json:"str-profile-data,omitempty"`
	DI []DI      `json:"diseases,omitempty"`
	OX []OX      `json:"species-of-origin,omitempty"`
	HI []HI      `json:"hierarchy,omitempty"`
	OI []OI      `json:"same-origin-as,omitempty"`

Cell is a cell line model.

func (*Cell) Find

func (cell *Cell) Find() error

Find finds and updates a cell line with all its attributes.

type Cells

type Cells struct {
	Meta cellMeta `json:"meta"`
	Data []Cell   `json:"data"`

Cells is a list of cell lines.

func (*Cells) List

func (cells *Cells) List() error

List returns a list of paginated cell lines.

type Context

type Context struct {
	Mode string
	Port string

Context contains router mode and server port information.

type DI

type DI struct {
	Terminology string `json:"terminology,omitempty"`
	Accession   string `json:"accession,omitempty"`
	Disease     string `json:"disease,omitempty"`

DI is a disease data.

type DR

type DR struct {
	Database  string `json:"database,omitempty"`
	Accession string `json:"accession,omitempty"`

DR is a cross references data.

type Error

type Error struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Message string `json:"message"`

Error is a custom error structure.

type HI

type HI struct {
	Terminology string `json:"terminology,omitempty"`
	Accession   string `json:"accession,omitempty"`
	DF          string `json:"derived-from,omitempty"`

HI is a hierarchy data.

type Marker

type Marker struct {
	ID      string `json:"id,omitempty"`
	Alleles string `json:"alleles,omitempty"`

Marker is an str profile data marker.

type OI

type OI struct {
	Terminology string `json:"terminology,omitempty"`
	Accession   string `json:"accession,omitempty"`
	Identifier  string `json:"identifier,omitempty"`

OI is a same-origin-as data.

type OX

type OX struct {
	Terminology string `json:"terminology,omitempty"`
	Accession   string `json:"accession,omitempty"`
	Species     string `json:"species,omitempty"`

OX is a species of origin data.

type Reference

type Reference struct {
	RX []string `json:"identifier"`
	RA []string `json:"authors,omitempty"`
	RG []string `json:"group/consortium,omitempty"`
	RT string   `json:"title"`
	RL string   `json:"citation"`

Reference contains reference data for the Cellosaurus.

type References

type References struct {
	Meta refMeta     `json:"meta"`
	Data []Reference `json:"data"`

References is a list of Reference.

func (*References) List

func (refs *References) List() error

List returns a list of paginated references.

type Release

type Release struct {
	Name        string  `json:"database"`
	Description string  `json:"description"`
	Stat        relStat `json:"release-information"`

Release models release specific information for the Cellosaurus.

func (*Release) Create

func (rel *Release) Create() error

Create returns release information for the Cellosaurus.

type Route

type Route struct {
	Method   string
	Endpoint string
	Handler  gin.HandlerFunc

Route is a routing model.

type Routes

type Routes []Route

Routes is a collection of Route.

type ST

type ST struct {
	Sources []string `json:"sources,omitempty"`
	Markers []Marker `json:"markers,omitempty"`

ST is an str profile data.

type Terminologies

type Terminologies []Terminology

Terminologies is a list of Terminology.

func (*Terminologies) List

func (terms *Terminologies) List() error

List returns a list of terminologies.

type Terminology

type Terminology struct {
	Name        string `json:"name"`
	Source      string `json:"source"`
	Description string `json:"description"`
	URL         string `json:"url"`

Terminology models terminology information contained in database.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier