genobase

package module
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MPL-2.0 Imports: 10 Imported by: 2

README

Genobase

A human genomics reference DB.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoSync added in v0.6.0

func NoSync(connStr string) string

NoSync disables flushing the database to disk after each write. This is unsafe, but significantly speeds up bulk imports.

func ReadOnly added in v0.6.0

func ReadOnly(connStr string) string

ReadOnly makes the database read-only (allowing for multiple concurrent readers).

Types

type DB

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

func Open

func Open(ctx context.Context, logger *slog.Logger, dbPath string, opts ...Option) (*DB, error)

Open opens a database connection and applies any necessary migrations.

func (*DB) Close

func (db *DB) Close() error

func (*DB) GetAlignment

func (db *DB) GetAlignment(ctx context.Context, chainID, refOffset int64) (*types.Alignment, error)

func (*DB) GetAllele

func (db *DB) GetAllele(ctx context.Context, id int64, reference, alternate string, ancestry types.AncestryGroup) (*types.Allele, error)

func (*DB) GetAlleles

func (db *DB) GetAlleles(ctx context.Context, id int64) ([]types.Allele, error)

func (*DB) GetChain

func (db *DB) GetChain(ctx context.Context, from types.Reference, chromosome types.Chromosome, position int64) (*types.Chain, error)

func (*DB) GetVariant

func (db *DB) GetVariant(ctx context.Context, id int64) (*types.Variant, error)

func (*DB) GetVariants

func (db *DB) GetVariants(ctx context.Context, chromosome types.Chromosome, position int64) ([]types.Variant, error)

func (*DB) KnownAlleles added in v0.3.0

func (db *DB) KnownAlleles(ctx context.Context) (map[int64]bool, error)

func (*DB) StoreAlignments

func (db *DB) StoreAlignments(ctx context.Context, chainID int64, alignments []types.Alignment) error

func (*DB) StoreAlleles

func (db *DB) StoreAlleles(ctx context.Context, alleles []types.Allele) error

func (*DB) StoreChain

func (db *DB) StoreChain(ctx context.Context, from types.Reference, chain *types.Chain) (int64, error)

func (*DB) StoreVariants

func (db *DB) StoreVariants(ctx context.Context, variants []types.Variant) error

type Option added in v0.6.0

type Option func(string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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