bed

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package bed is used to read bed features. ref: https://genome.ucsc.edu/FAQ/FAQformat.html#format1 ref: https://github.com/biogo/biogo/blob/master/io/featio/bed/bed.go

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadBEDType error
	ErrBadBEDType = errors.New("bad BED type")
	// ErrBadBrowserLine error
	ErrBadBrowserLine = errors.New("bad browser line")
)
View Source
var TrackItemRegexp = regexp.MustCompile(`(\w+)="?[^#]+?"?`)

TrackItemRegexp is regular expression for parsing track items

Functions

This section is empty.

Types

type BED12

type BED12 struct {
	Chrom       string
	ChromStart  int
	ChromEnd    int
	FeatName    string
	FeatScore   int
	FeatStrand  *string
	ThickStart  int
	ThickEnd    int
	RGB         string
	BlockCount  int
	BlockSizes  []int
	BlockStarts []int
}

BED12 struct

func (*BED12) Chr

func (b *BED12) Chr() string

Chr returns chromosome

func (*BED12) End

func (b *BED12) End() int

End returns end. (the site is not included)

func (*BED12) Length

func (b *BED12) Length() int

Length returns length

func (*BED12) Name

func (b *BED12) Name() string

Name returns name

func (*BED12) Start

func (b *BED12) Start() int

Start returns start

func (*BED12) Strand

func (b *BED12) Strand() *string

Strand returns strand

func (*BED12) String

func (b *BED12) String() string

type BED3

type BED3 struct {
	Chrom      string
	ChromStart int
	ChromEnd   int
}

BED3 struct

func (*BED3) Chr

func (b *BED3) Chr() string

Chr returns chromosome

func (*BED3) End

func (b *BED3) End() int

End returns end. (the site is not included)

func (*BED3) Length

func (b *BED3) Length() int

Length returns length

func (*BED3) Name

func (b *BED3) Name() string

Name returns name

func (*BED3) Start

func (b *BED3) Start() int

Start returns start

func (*BED3) Strand

func (b *BED3) Strand() *string

Strand returns strand

func (*BED3) String

func (b *BED3) String() string

type BED4

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

BED4 struct

func (*BED4) Chr

func (b *BED4) Chr() string

Chr returns chromosome

func (*BED4) End

func (b *BED4) End() int

End returns end. (the site is not included)

func (*BED4) Length

func (b *BED4) Length() int

Length returns length

func (*BED4) Name

func (b *BED4) Name() string

Name returns name

func (*BED4) Start

func (b *BED4) Start() int

Start returns start

func (*BED4) Strand

func (b *BED4) Strand() *string

Strand returns strand

func (*BED4) String

func (b *BED4) String() string

type BED5

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

BED5 struct

func (*BED5) Chr

func (b *BED5) Chr() string

Chr returns chromosome

func (*BED5) End

func (b *BED5) End() int

End returns end. (the site is not included)

func (*BED5) Length

func (b *BED5) Length() int

Length returns length

func (*BED5) Name

func (b *BED5) Name() string

Name returns name

func (*BED5) Start

func (b *BED5) Start() int

Start returns start

func (*BED5) Strand

func (b *BED5) Strand() *string

Strand returns strand

func (*BED5) String

func (b *BED5) String() string

type BED6

type BED6 struct {
	Chrom      string
	ChromStart int
	ChromEnd   int
	FeatName   string
	FeatScore  int
	FeatStrand *string
}

BED6 struct

func (*BED6) Chr

func (b *BED6) Chr() string

Chr returns chromosome

func (*BED6) End

func (b *BED6) End() int

End returns end. (the site is not included)

func (*BED6) Length

func (b *BED6) Length() int

Length returns length

func (*BED6) Name

func (b *BED6) Name() string

Name returns name

func (*BED6) Start

func (b *BED6) Start() int

Start returns start

func (*BED6) Strand

func (b *BED6) Strand() *string

Strand returns strand

func (*BED6) String

func (b *BED6) String() string

type Feature

type Feature interface {
	Chr() string
	Start() int
	End() int
	Len() int
	Strand() *string
	String() string
}

Feature is the interface of BED feature

func ReadFeatures

func ReadFeatures(file string, n int) ([]Feature, map[string]map[string]string, error)

ReadFeatures returns bed data of a file, availabe type values are 3,4,5,6

Jump to

Keyboard shortcuts

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