records

package
v0.0.0-...-e065fbe Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package records interfaces the protobuf definitions with Scribe

Package records interfaces the protobuf definitions with Scribe

Package records interfaces the protobuf definitions with Scribe

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned by operations that can't locate the required project
	ErrNotFound = errors.New("project not found")
)

error messages

View Source
var Status_name = map[int32]string{
	0: "UN_INITIALIZED",
	1: "untagged",
	2: "tagged",
	3: "announced",
}
View Source
var Status_value = map[string]int32{
	"UN_INITIALIZED": 0,
	"untagged":       1,
	"tagged":         2,
	"announced":      3,
}

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Timestamp            *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Text                 string               `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Comments are used to record a message history

func (*Comment) Descriptor

func (*Comment) Descriptor() ([]byte, []int)

func (*Comment) GetText

func (m *Comment) GetText() string

func (*Comment) GetTimestamp

func (m *Comment) GetTimestamp() *timestamp.Timestamp

func (*Comment) ProtoMessage

func (*Comment) ProtoMessage()

func (*Comment) Reset

func (m *Comment) Reset()

func (*Comment) String

func (m *Comment) String() string

func (*Comment) XXX_DiscardUnknown

func (m *Comment) XXX_DiscardUnknown()

func (*Comment) XXX_Marshal

func (m *Comment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Comment) XXX_Merge

func (m *Comment) XXX_Merge(src proto.Message)

func (*Comment) XXX_Size

func (m *Comment) XXX_Size() int

func (*Comment) XXX_Unmarshal

func (m *Comment) XXX_Unmarshal(b []byte) error

type Project

type Project struct {
	Label                string            `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	CID                  string            `protobuf:"bytes,3,opt,name=CID,proto3" json:"CID,omitempty"`
	Runs                 map[string]string `` /* 149-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

Project is used to group Runs, Libraries and Samples

func InitProject

func InitProject(label string) *Project

InitProject will init a project struct with the minimum required values

func (*Project) Descriptor

func (*Project) Descriptor() ([]byte, []int)

func (*Project) GetCID

func (m *Project) GetCID() string

func (*Project) GetLabel

func (m *Project) GetLabel() string

func (*Project) GetRuns

func (m *Project) GetRuns() map[string]string

func (*Project) ProtoMessage

func (*Project) ProtoMessage()

func (*Project) Register

func (project *Project) Register() error

Register will register a project on the IPFS

func (*Project) Reset

func (m *Project) Reset()

func (*Project) String

func (m *Project) String() string

func (*Project) XXX_DiscardUnknown

func (m *Project) XXX_DiscardUnknown()

func (*Project) XXX_Marshal

func (m *Project) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Project) XXX_Merge

func (m *Project) XXX_Merge(src proto.Message)

func (*Project) XXX_Size

func (m *Project) XXX_Size() int

func (*Project) XXX_Unmarshal

func (m *Project) XXX_Unmarshal(b []byte) error

type ProjectDatabase

type ProjectDatabase struct {
	Projects             map[string]*Project `` /* 157-byte string literal not displayed */
	Pin                  bool                `protobuf:"varint,3,opt,name=pin,proto3" json:"pin,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

ProjectDatabase is used to organise Projects

func InitDB

func InitDB() *ProjectDatabase

InitDB will init the project database

func (*ProjectDatabase) AddProject

func (db *ProjectDatabase) AddProject(project *Project) error

AddProject will add a project to the db

func (*ProjectDatabase) Descriptor

func (*ProjectDatabase) Descriptor() ([]byte, []int)

func (*ProjectDatabase) GetNumProjects

func (db *ProjectDatabase) GetNumProjects() int

GetNumProjects will return the number of projects in the project database

func (*ProjectDatabase) GetPin

func (m *ProjectDatabase) GetPin() bool

func (*ProjectDatabase) GetProject

func (db *ProjectDatabase) GetProject(projectLabel string) (*Project, error)

GetProject will get a project from the db

func (*ProjectDatabase) GetProjects

func (m *ProjectDatabase) GetProjects() map[string]*Project

func (*ProjectDatabase) ProtoMessage

func (*ProjectDatabase) ProtoMessage()

func (*ProjectDatabase) Pull

func (db *ProjectDatabase) Pull(node *backend.Node, cid string) error

Pull will pull a database from the IPFS using the provided CID

func (*ProjectDatabase) Push

func (db *ProjectDatabase) Push(node *backend.Node) (string, error)

Push will push the database to the IPFS and return the CID (and any error)

func (*ProjectDatabase) Reset

func (m *ProjectDatabase) Reset()

func (*ProjectDatabase) String

func (m *ProjectDatabase) String() string

func (*ProjectDatabase) XXX_DiscardUnknown

func (m *ProjectDatabase) XXX_DiscardUnknown()

func (*ProjectDatabase) XXX_Marshal

func (m *ProjectDatabase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProjectDatabase) XXX_Merge

func (m *ProjectDatabase) XXX_Merge(src proto.Message)

func (*ProjectDatabase) XXX_Size

func (m *ProjectDatabase) XXX_Size() int

func (*ProjectDatabase) XXX_Unmarshal

func (m *ProjectDatabase) XXX_Unmarshal(b []byte) error

type Run

type Run struct {
	Created *timestamp.Timestamp `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"`
	Label   string               `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	//string parentProjectLabel = 3;               // the label of the project that this run belongs to
	ParentProjectCID     string          `protobuf:"bytes,4,opt,name=parentProjectCID,proto3" json:"parentProjectCID,omitempty"`
	History              []*Comment      `protobuf:"bytes,5,rep,name=history,proto3" json:"history,omitempty"`
	Status               Status          `protobuf:"varint,6,opt,name=status,proto3,enum=records.Status" json:"status,omitempty"`
	Tags                 map[string]bool `` /* 150-byte string literal not displayed */
	RequestOrder         []string        `protobuf:"bytes,8,rep,name=requestOrder,proto3" json:"requestOrder,omitempty"`
	OutputDirectory      string          `protobuf:"bytes,9,opt,name=outputDirectory,proto3" json:"outputDirectory,omitempty"`
	Fast5OutputDirectory string          `protobuf:"bytes,10,opt,name=fast5OutputDirectory,proto3" json:"fast5OutputDirectory,omitempty"`
	FastqOutputDirectory string          `protobuf:"bytes,11,opt,name=fastqOutputDirectory,proto3" json:"fastqOutputDirectory,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

Run is used to describe a Nanopore sequencing run

func InitRun

func InitRun(label, outputDir, fast5Dir, fastqDir string) *Run

InitRun will init a run struct with the minimum required values

func (*Run) AddComment

func (run *Run) AddComment(text string) error

AddComment adds a comment to the run history

func (*Run) Descriptor

func (*Run) Descriptor() ([]byte, []int)

func (*Run) GetCreated

func (m *Run) GetCreated() *timestamp.Timestamp

func (*Run) GetFast5OutputDirectory

func (m *Run) GetFast5OutputDirectory() string

func (*Run) GetFastqOutputDirectory

func (m *Run) GetFastqOutputDirectory() string

func (*Run) GetHistory

func (m *Run) GetHistory() []*Comment

func (*Run) GetLabel

func (m *Run) GetLabel() string

func (*Run) GetOutputDirectory

func (m *Run) GetOutputDirectory() string

func (*Run) GetParentProjectCID

func (m *Run) GetParentProjectCID() string

func (*Run) GetRequestOrder

func (m *Run) GetRequestOrder() []string

func (*Run) GetStatus

func (m *Run) GetStatus() Status

func (*Run) GetTags

func (m *Run) GetTags() map[string]bool

func (*Run) ProtoMessage

func (*Run) ProtoMessage()

func (*Run) Reset

func (m *Run) Reset()

func (*Run) String

func (m *Run) String() string

func (*Run) Sync

func (run *Run) Sync() error

Sync will store a run in the IPFS and update the parent project's record

func (*Run) XXX_DiscardUnknown

func (m *Run) XXX_DiscardUnknown()

func (*Run) XXX_Marshal

func (m *Run) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Run) XXX_Merge

func (m *Run) XXX_Merge(src proto.Message)

func (*Run) XXX_Size

func (m *Run) XXX_Size() int

func (*Run) XXX_Unmarshal

func (m *Run) XXX_Unmarshal(b []byte) error

type Sample

type Sample struct {
	Created              *timestamp.Timestamp `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"`
	Label                string               `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	History              []*Comment           `protobuf:"bytes,3,rep,name=history,proto3" json:"history,omitempty"`
	Status               Status               `protobuf:"varint,4,opt,name=status,proto3,enum=records.Status" json:"status,omitempty"`
	Tags                 map[string]bool      `` /* 150-byte string literal not displayed */
	RequestOrder         []string             `protobuf:"bytes,6,rep,name=requestOrder,proto3" json:"requestOrder,omitempty"`
	ParentExperiment     string               `protobuf:"bytes,7,opt,name=parentExperiment,proto3" json:"parentExperiment,omitempty"`
	Barcode              int32                `protobuf:"varint,8,opt,name=barcode,proto3" json:"barcode,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Sample is used to describe a biological sample which is being sequenced as part of a Run

func (*Sample) Descriptor

func (*Sample) Descriptor() ([]byte, []int)

func (*Sample) GetBarcode

func (m *Sample) GetBarcode() int32

func (*Sample) GetCreated

func (m *Sample) GetCreated() *timestamp.Timestamp

func (*Sample) GetHistory

func (m *Sample) GetHistory() []*Comment

func (*Sample) GetLabel

func (m *Sample) GetLabel() string

func (*Sample) GetParentExperiment

func (m *Sample) GetParentExperiment() string

func (*Sample) GetRequestOrder

func (m *Sample) GetRequestOrder() []string

func (*Sample) GetStatus

func (m *Sample) GetStatus() Status

func (*Sample) GetTags

func (m *Sample) GetTags() map[string]bool

func (*Sample) ProtoMessage

func (*Sample) ProtoMessage()

func (*Sample) Reset

func (m *Sample) Reset()

func (*Sample) String

func (m *Sample) String() string

func (*Sample) XXX_DiscardUnknown

func (m *Sample) XXX_DiscardUnknown()

func (*Sample) XXX_Marshal

func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Sample) XXX_Merge

func (m *Sample) XXX_Merge(src proto.Message)

func (*Sample) XXX_Size

func (m *Sample) XXX_Size() int

func (*Sample) XXX_Unmarshal

func (m *Sample) XXX_Unmarshal(b []byte) error

type Status

type Status int32

Status is used to determine if experiments/samples have tagged processes, or if they have been announced via the message server

const (
	Status_UN_INITIALIZED Status = 0
	Status_untagged       Status = 1
	Status_tagged         Status = 2
	Status_announced      Status = 3
)

func (Status) EnumDescriptor

func (Status) EnumDescriptor() ([]byte, []int)

func (Status) String

func (x Status) String() string

Jump to

Keyboard shortcuts

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