bed

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: BSD-3-Clause Imports: 14 Imported by: 4

Documentation

Overview

Package bed provides types to read and write BED format files according to the UCSC specification.

The specification can be found at http://genome.ucsc.edu/FAQ/FAQformat.html#format1.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadBedType         = errors.New("bed: bad bed type")
	ErrBadStrandField     = errors.New("bad strand field")
	ErrBadStrand          = errors.New("invalid strand")
	ErrBadColorField      = errors.New("bad color field")
	ErrMissingBlockValues = errors.New("missing block values")
	ErrNoChromField       = errors.New("no chrom field available")
)

Functions

This section is empty.

Types

type Bed

type Bed interface {
	feat.Feature
	// contains filtered or unexported methods
}

type Bed12

type Bed12 struct {
	Chrom       string
	ChromStart  int
	ChromEnd    int
	FeatName    string
	FeatScore   int
	FeatStrand  seq.Strand
	ThickStart  int
	ThickEnd    int
	Rgb         color.RGBA
	BlockCount  int
	BlockSizes  []int
	BlockStarts []int
}

func (*Bed12) Description

func (b *Bed12) Description() string

func (*Bed12) End

func (b *Bed12) End() int

func (*Bed12) Format

func (b *Bed12) Format(fs fmt.State, c rune)

func (*Bed12) Len

func (b *Bed12) Len() int

func (*Bed12) Location

func (b *Bed12) Location() feat.Feature

func (*Bed12) Name

func (b *Bed12) Name() string

func (*Bed12) Orientation

func (b *Bed12) Orientation() feat.Orientation

func (*Bed12) Start

func (b *Bed12) Start() int

type Bed3

type Bed3 struct {
	Chrom      string
	ChromStart int
	ChromEnd   int
}

func (*Bed3) Description

func (b *Bed3) Description() string

func (*Bed3) End

func (b *Bed3) End() int

func (*Bed3) Format

func (b *Bed3) Format(fs fmt.State, c rune)

func (*Bed3) Len

func (b *Bed3) Len() int

func (*Bed3) Location

func (b *Bed3) Location() feat.Feature

func (*Bed3) Name

func (b *Bed3) Name() string

func (*Bed3) Start

func (b *Bed3) Start() int

type Bed4

type Bed4 struct {
	Chrom      string
	ChromStart int
	ChromEnd   int
	FeatName   string
}

func (*Bed4) Description

func (b *Bed4) Description() string

func (*Bed4) End

func (b *Bed4) End() int

func (*Bed4) Format

func (b *Bed4) Format(fs fmt.State, c rune)

func (*Bed4) Len

func (b *Bed4) Len() int

func (*Bed4) Location

func (b *Bed4) Location() feat.Feature

func (*Bed4) Name

func (b *Bed4) Name() string

func (*Bed4) Start

func (b *Bed4) Start() int

type Bed5

type Bed5 struct {
	Chrom      string
	ChromStart int
	ChromEnd   int
	FeatName   string
	FeatScore  int
}

func (*Bed5) Description

func (b *Bed5) Description() string

func (*Bed5) End

func (b *Bed5) End() int

func (*Bed5) Format

func (b *Bed5) Format(fs fmt.State, c rune)

func (*Bed5) Len

func (b *Bed5) Len() int

func (*Bed5) Location

func (b *Bed5) Location() feat.Feature

func (*Bed5) Name

func (b *Bed5) Name() string

func (*Bed5) Start

func (b *Bed5) Start() int

type Bed6

type Bed6 struct {
	Chrom      string
	ChromStart int
	ChromEnd   int
	FeatName   string
	FeatScore  int
	FeatStrand seq.Strand
}

func (*Bed6) Description

func (b *Bed6) Description() string

func (*Bed6) End

func (b *Bed6) End() int

func (*Bed6) Format

func (b *Bed6) Format(fs fmt.State, c rune)

func (*Bed6) Len

func (b *Bed6) Len() int

func (*Bed6) Location

func (b *Bed6) Location() feat.Feature

func (*Bed6) Name

func (b *Bed6) Name() string

func (*Bed6) Orientation

func (b *Bed6) Orientation() feat.Orientation

func (*Bed6) Start

func (b *Bed6) Start() int

type Chrom

type Chrom string

func (Chrom) Description

func (c Chrom) Description() string

func (Chrom) End

func (c Chrom) End() int

func (Chrom) Len

func (c Chrom) Len() int

func (Chrom) Location

func (c Chrom) Location() feat.Feature

func (Chrom) Name

func (c Chrom) Name() string

func (Chrom) Start

func (c Chrom) Start() int

type Reader

type Reader struct {
	BedType int
	// contains filtered or unexported fields
}

BED format reader type.

func NewReader

func NewReader(r io.Reader, b int) (*Reader, error)

Returns a new BED format reader using r.

func (*Reader) Line

func (r *Reader) Line() int

Return the current line number

func (*Reader) Read

func (r *Reader) Read() (f feat.Feature, err error)

Read a single feature and return it or an error.

type Scorer

type Scorer interface {
	Score() int
}

type Writer

type Writer struct {
	BedType int
	// contains filtered or unexported fields
}

BED format writer type.

func NewWriter

func NewWriter(w io.Writer, b int) (*Writer, error)

Returns a new BED format writer using w.

func (*Writer) Write

func (w *Writer) Write(f feat.Feature) (n int, err error)

Write a single feature and return the number of bytes written and any error.

Jump to

Keyboard shortcuts

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