Documentation ¶
Overview ¶
Package twobit implements the 2bit compact randomly-accessible file format for storing DNA sequence data.
Index ¶
- Constants
- Variables
- func Unpack(raw []byte, sz int) string
- type Block
- type Reader
- func (r *Reader) Count() int
- func (r *Reader) Length(name string) (int, error)
- func (r *Reader) LengthNoN(name string) (int, error)
- func (r *Reader) NBlocks(name string) ([]*Block, error)
- func (r *Reader) Names() []string
- func (r *Reader) Read(name string) ([]byte, error)
- func (r *Reader) ReadRange(name string, start, end int) ([]byte, error)
- func (r *Reader) Version() int
- type Service
- type Writer
Constants ¶
View Source
const BASE_A = 'A'
BASE_A -
View Source
const BASE_C = 'C'
BASE_C -
View Source
const BASE_G = 'G'
BASE_G -
View Source
const BASE_N = 'N'
BASE_N -
View Source
const BASE_T = 'T'
BASE_T -
View Source
const SIG = 0x1A412743
SIG -
Variables ¶
BYTES2NT -
View Source
var NT2BYTES = []byte{}
NT2BYTES -
Functions ¶
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block represents either blocks of Ns or masked (lower-case) blocks
type Reader ¶
type Reader twoBit
Reader reads twobits
func NewReader ¶
func NewReader(r io.ReadSeeker) (*Reader, error)
NewReader returns a new TwoBit file reader which reads from r
func (*Reader) LengthNoN ¶
LengthNoN - Returns the length for sequence with name but does not count Ns
type Service ¶
type Service interface { // Genomic Interval-based services GenomicInterval(chr string, start, end int) (string, error) // returns genomic sequence using 2-bit (from memory) GetGenomicIntervalWindow(chr string, start, end int, ref, alt string, windowL, windowR int) (seqRef, seqAlt string, err error) // returns ref and alt with window to left and right GetGenomicIntervalBound(chr string, start, end int, ref, alt string, intervalStart, intervalEnd int) (seqRef, seqAlt string, err error) // returns ref and alt bound by interval (ex. interval = exon, will return exonRef and exonAlt sequences) GetGenomicIntervalStrand(chr string, start, end int, ref, alt string, windowL, windowR int, isPosStrand bool) (seqRef, seqAlt string, err error) // returns ref and alt with window to left and right, correct strand }
Service includes all services
func NewDataService ¶
NewDataService - Open 2-bit genome reference
Click to show internal directories.
Click to hide internal directories.