awtk

package
v0.0.0-...-a452cc9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: AGPL-3.0, AGPL-3.0-or-later Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// FIXME
	DbFile = "awtk.sqlite3"
)

Variables

This section is empty.

Functions

func GetDatabaseConnection

func GetDatabaseConnection() (*sql.DB, *gorp.DbMap, error)

func GetEvidence

func GetEvidence(evidenceId int) ([]byte, error)

func InitDatabase

func InitDatabase()

func InitEvidence

func InitEvidence(dbmap *gorp.DbMap) error

InitEvidence initializes evidences table records.

Types

type Evidence

type Evidence struct {
	Id         int       `json:"id"`
	Phenotype  string    `json:"phenotype"`
	Model      string    `json:"model"`
	Unit       string    `json:"unit"`
	Population string    `json:"population"`
	Variants   []Variant `db:"-" json:"variants"`
}

type EvidenceError

type EvidenceError struct {
	Msg string
}

func (*EvidenceError) Error

func (err *EvidenceError) Error() string

type Genome

type Genome struct {
	Id          int    `json:"id"`
	FilePath    string `json:"filePath" form:"filePath"`
	SampleName  string `json:"sampleName"`
	SampleIndex int    `json:"sampleIndex"`
}

func CreateGenomes

func CreateGenomes(filePath string) ([]Genome, error)

func GetGenome

func GetGenome(genomeId int) (*Genome, error)

func GetGenomes

func GetGenomes() ([]Genome, error)

type GenomeError

type GenomeError struct {
	Msg string
}

func (*GenomeError) Error

func (err *GenomeError) Error() string

type Genotype

type Genotype struct {
	Chrom     string   `json:"chrom"`
	Position  int      `json:"position"`
	SnpId     string   `json:"snpId"`
	Genotype  []string `json:"genotype"`
	Alleles   []string `json:"alleles"`
	Reference string   `json:"reference"`
}

type Genotypes

type Genotypes struct {
	SampleName string     `json:"sampleName"`
	Genotypes  []Genotype `json:"genotypes"`
}

func QueryGenotypes

func QueryGenotypes(f string, idx int, locs []Location) (Genotypes, error)

func (*Genotypes) AddGenotype

func (genotypes *Genotypes) AddGenotype(genotype Genotype) []Genotype

type Location

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

func NewLocation

func NewLocation(chrom string, start int, end int) Location

func (Location) Chrom

func (s Location) Chrom() string

func (Location) End

func (s Location) End() uint32

func (Location) Start

func (s Location) Start() uint32

type Sequence

type Sequence struct {
	Chrom      string   `json:"chrom"`
	Start      int      `json:"start"`
	End        int      `json:"end"`
	Reference  []string `json:"reference"`
	Haplotype1 []string `json:"haplotype_1"`
	Haplotype2 []string `json:"haplotype_2"`
}

func Genotypes2Sequence

func Genotypes2Sequence(gts Genotypes, locs []Location) (Sequence, error)

Convert Genotypes to Sequence

type Variant

type Variant struct {
	Id            int     `json:"-"`
	EvidenceId    int     `json:"-"`
	Name          string  `json:"name"`
	CriteriaBySnp string  `json:"criteriaBySnp"`
	CriteriaByLoc string  `json:"criteriaByLoc"`
	EffectSize    float64 `json:"effectSize"`
	Effect        string  `json:"effect`
	Reference     string  `json:"reference"`
}

Jump to

Keyboard shortcuts

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