bed

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package bed decodes and encodes BED files.

This package uses the format described in: https://en.wikipedia.org/wiki/BED_(file_format)

Limitations

Currently only tab delimiters are supported.

Currently BED headers are not supported.

Index

Constants

View Source
const (
	PlusStrand  = "+"
	MinusStrand = "-"
	NoStrand    = "."
)

Valid values for the strand field.

Variables

This section is empty.

Functions

func File added in v1.0.0

func File(file string) iter.Seq2[*BED, error]

File returns an iterator over fasta entries in a file.

func Reader added in v0.1.3

func Reader(r io.Reader) iter.Seq2[*BED, error]

Reader returns an iterator over fasta entries in a reader.

Types

type BED added in v0.1.2

type BED struct {
	N           int // Number of fields in this entry
	Chrom       string
	ChromStart  int // 0-based
	ChromEnd    int // 0-based exclusive
	Name        string
	Score       int
	Strand      string
	ThickStart  int
	ThickEnd    int
	ItemRGB     [3]byte
	BlockCount  int
	BlockSizes  []int // Length should match BlockCount
	BlockStarts []int // Length should match BlockCount
}

BED is a single line in a BED file.

func (*BED) MarshalText added in v1.0.0

func (b *BED) MarshalText() ([]byte, error)

MarshalText returns the textual representation of b in BED format. Encodes the first b.N fields, where b.N is between 3 and 12. Includes a trailing new line.

func (*BED) Write added in v1.0.0

func (b *BED) Write(w io.Writer) error

Write writer the textual BED format representation of b to w. Encodes the first b.N fields, where b.N is between 3 and 12. Includes a trailing new line.

Jump to

Keyboard shortcuts

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