bed

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package bed is a library for parsing and representing BED files. See https://genome.ucsc.edu/FAQ/FAQformat.html#format1

Index

Constants

This section is empty.

Variables

View Source
var (
	// Strand forward.
	SF = utils.Intern("+")
	// Strand reverse.
	SR = utils.Intern("-")
)

Symbols for optional strand field of a Region.

Functions

func AddRegion

func AddRegion(bed *Bed, region *Region)

AddRegion adds a region to the bed region map.

Types

type Bed

type Bed struct {
	// Bed tracks defined in the file.
	Tracks []*Track
	// Maps chromosome name onto bed regions.
	RegionMap map[utils.Symbol][]*Region
}

Bed is a struct for representing the contents of a BED file. See https://genome.ucsc.edu/FAQ/FAQformat.html#format1

func NewBed

func NewBed() *Bed

NewBed allocates and initializes an empty bed.

func ParseBed

func ParseBed(filename string) (b *Bed, err error)

ParseBed parses a BED file. See https://genome.ucsc.edu/FAQ/FAQformat.html#format1

type Region

type Region struct {
	Chrom          utils.Symbol
	Start          int32
	End            int32
	OptionalFields []interface{}
}

A Region is a struct for representing intervals as defined in a BED file. See https://genome.ucsc.edu/FAQ/FAQformat.html#format1

func NewRegion

func NewRegion(chrom utils.Symbol, start int32, end int32, fields []string) (b *Region, err error)

NewRegion allocates and initializes a new Region. Optional fields are given in order. If a "later" field is entered, then the "earlier" field was entered as well. See https://genome.ucsc.edu/FAQ/FAQformat.html#format1

type Track

type Track struct {
	// All track fields are optional.
	Fields map[string]string
	// The bed regions this track groups together.
	Regions []*Region
}

A Track is a struct for representing BED tracks. See https://genome.ucsc.edu/FAQ/FAQformat.html#format1

func NewTrack

func NewTrack(fields map[string]string) *Track

NewTrack allocates and initializes a new Track.

Jump to

Keyboard shortcuts

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