snparray

package
v0.3.1 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: 9 Imported by: 0

Documentation

Overview

Package snparray provides readers for common SNP array file formats. Such as direct-to-consumer genetic testing services like 23andMe and AncestryDNA.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	// Detect returns true if the file format is detected.
	Detect(r io.Reader) (bool, error)
	// Open opens the SNP array file and returns a lazy SNP reader.
	Open(r io.Reader) (Reader, error)
}

Codec is a SNP array file format encoder/decoder.

type Reader

type Reader interface {
	// Reference returns the reference assembly used by the SNP array.
	Reference() types.Reference
	// Read reads the next SNP from the file. It returns io.EOF if there are no
	// more SNPs.
	Read() (*SNP, error)
}

Reader is a lazy SNP reader.

func Open

func Open(r io.Reader) (Reader, error)

Open opens the SNP array file and returns a lazy SNP reader.

type SNP

type SNP struct {
	RSID       string
	Chromosome types.Chromosome
	Position   int64
	Genotype   string
}

Jump to

Keyboard shortcuts

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