dnaTwoBit

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	A uint8 = 0
	C uint8 = 1
	G uint8 = 2
	T uint8 = 3
)

Variables

This section is empty.

Functions

func BasesToUint64LeftAln

func BasesToUint64LeftAln(seq []dna.Base, start int, end int) uint64

BasesToUint64LeftAln converts a user-specified range of an input slice of dna.Base structs into a tw-bit encoded uint64 sequence. Sequences less than 32 bases long are aligned to the left of the uint64 memory space.

func BasesToUint64RightAln

func BasesToUint64RightAln(seq []dna.Base, start int, end int) uint64

BasesToUint64RightAln converts a user-specified range of an input slice of dna.Base structs into a tw-bit encoded uint64 sequence. Sequences less than 32 bases long are aligned to the right of the uint64 memory space.

func CountLeftMatches

func CountLeftMatches(one *TwoBit, startOne int, two *TwoBit, startTwo int) int

func CountRightMatches

func CountRightMatches(one *TwoBit, startOne int, two *TwoBit, startTwo int) int

func GetBase

func GetBase(frag *TwoBit, pos uint) dna.Base

GetBase decodes a dna.Base struct from a position of an input TwoBit sequence.

Types

type TwoBit

type TwoBit struct {
	Seq []uint64
	Len int
}

TwoBit is a struct that encodes DNA sequences in two-bit compressed format. Seq contains the sequence information itself. Len specifies the length of the sequence.

func NewTwoBit

func NewTwoBit(inSeq []dna.Base) *TwoBit

NewTwoBit parses a TwoBit sequence struct from an input slice of dna.Base structs. Remainder bases will be left-aligned.

func NewTwoBitRainbow

func NewTwoBitRainbow(inSeq []dna.Base) []*TwoBit

func TwoBitRainbowDeReference

func TwoBitRainbowDeReference(inSeq []dna.Base) []TwoBit

TwoBitRainbowDeReference is the same as NewTwoBitRainbow except it will be turn a non-pointer plice of dnaTwoBit.

Jump to

Keyboard shortcuts

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