bed2x

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: BSD-3-Clause Imports: 16 Imported by: 1

README

bed2x

Build Status Releases Go Report Card GoDoc Licenses Linux64 Windows MacOS

Functions

  • get upstream/downstream/intron/exon/promoter/tts/tss/utr3/utr5/cds annotation bed based on input bed12/bed6 bigbed/tabix/gzip/ascii files.
  • fetch cDNA sequence for bed12 format file.
  • support stdin/stdout pipe

Install

Install from go
go get github.com/nimezhu/bed2x/...
Download Binaries

Download pre-compiled files from release.

Usage Examples

bed2x exon [file.bb or file.bed or file.bed.gz]  > file.exon.bed
bed2x promoter file.bb | bed2x seq -g genome.2bit > file.promoter.fa
bed2x read file.bb | head -10 | bed2 seq -g http://hgdownload.soe.ucsc.edu/goldenPath/hg19/bigZips/hg19.2bit
bed2x read file.bb | head -10 | bed2 seq -g hg19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChromSizes added in v0.0.3

func ChromSizes(genome string) error

func CigarToCoords added in v0.0.3

func CigarToCoords(cigar sam.Cigar, offset int) ([]int, []int)

TODO TEST

func IterBed12

func IterBed12(fn string) (<-chan *Bed12, error)

func IterBed6

func IterBed6(fn string) (<-chan *Bed6, error)

func IterBedLines

func IterBedLines(fn string) (<-chan string, error)

IterBedLines: input format could be bigbed,gzip and ascii text file or \S+:\d+-\d+

func RC

func RC(s string) string

Types

type Bed12

type Bed12 struct {
	// contains filtered or unexported fields
}

func ParseBed12

func ParseBed12(line string) (*Bed12, error)

func SamRecordToBed12 added in v0.0.3

func SamRecordToBed12(s *sam.Record) *Bed12

func (*Bed12) BlockCount

func (b *Bed12) BlockCount() int

func (*Bed12) BlockSizes

func (b *Bed12) BlockSizes() []int

func (*Bed12) BlockStarts

func (b *Bed12) BlockStarts() []int

func (*Bed12) CDS

func (b *Bed12) CDS() (*Bed12, error)

func (*Bed12) Chr

func (b *Bed12) Chr() string

func (*Bed12) End

func (b *Bed12) End() int

func (*Bed12) Exons

func (b *Bed12) Exons() ([]*Bed6, error)

func (*Bed12) Id

func (b *Bed12) Id() string

func (*Bed12) Introns

func (b *Bed12) Introns() ([]*Bed6, error)

func (*Bed12) ItemRgb

func (b *Bed12) ItemRgb() string

func (*Bed12) Score

func (b *Bed12) Score() float64

func (*Bed12) Start

func (b *Bed12) Start() int

func (*Bed12) Strand

func (b *Bed12) Strand() string

func (*Bed12) String

func (b *Bed12) String() string

func (*Bed12) ThickEnd

func (b *Bed12) ThickEnd() int

func (*Bed12) ThickStart

func (b *Bed12) ThickStart() int

func (*Bed12) UTR3

func (b *Bed12) UTR3() (*Bed12, error)

func (*Bed12) UTR5

func (b *Bed12) UTR5() (*Bed12, error)

type Bed3 added in v0.0.3

type Bed3 interface {
	Chr() string
	Start() int
	End() int
}

type Bed3i

type Bed3i interface {
	Chr() string
	Start() int
	End() int
}

func ParseRegion added in v0.0.3

func ParseRegion(s string) (Bed3i, bool)

type Bed4 added in v0.0.3

type Bed4 struct {
	// contains filtered or unexported fields
}

func (Bed4) Chr added in v0.0.3

func (b Bed4) Chr() string

func (Bed4) End added in v0.0.3

func (b Bed4) End() int

func (Bed4) Id added in v0.0.3

func (b Bed4) Id() string

func (Bed4) Start added in v0.0.3

func (b Bed4) Start() int

type Bed6

type Bed6 struct {
	// contains filtered or unexported fields
}

func Downstream

func Downstream(b Bed6i, bp int) (*Bed6, error)

func ParseBed6

func ParseBed6(line string) (*Bed6, error)

func Promoter

func Promoter(b Bed6i, up int, down int) (*Bed6, error)

func Tss

func Tss(b Bed6i) (*Bed6, error)

func Tts

func Tts(b Bed6i) (*Bed6, error)

func Upstream

func Upstream(b Bed6i, bp int) (*Bed6, error)

func (*Bed6) Chr

func (b *Bed6) Chr() string

func (*Bed6) End

func (b *Bed6) End() int

func (*Bed6) Exons

func (b *Bed6) Exons() ([]*Bed6, error)

func (*Bed6) Id

func (b *Bed6) Id() string

func (*Bed6) Score

func (b *Bed6) Score() float64

func (*Bed6) Start

func (b *Bed6) Start() int

func (*Bed6) Strand

func (b *Bed6) Strand() string

func (*Bed6) String

func (b *Bed6) String() string

type Bed6i

type Bed6i interface {
	Bed3i
	Id() string
	Score() float64
	Strand() string
}

type BedI added in v0.0.3

type BedI interface {
	RangeI
	Chr() string
}

type BinIndex added in v0.0.3

type BinIndex map[int][]NamedRangeI

type BinIndexMap added in v0.0.3

type BinIndexMap struct {
	Data map[string]BinIndex
}

func NewBinIndexMap added in v0.0.3

func NewBinIndexMap() *BinIndexMap

func (*BinIndexMap) Delete added in v0.0.3

func (d *BinIndexMap) Delete(b NamedBedI) error

TODO Delete

func (*BinIndexMap) Insert added in v0.0.3

func (c *BinIndexMap) Insert(b NamedBedI) error

func (*BinIndexMap) Load added in v0.0.3

func (c *BinIndexMap) Load(b []NamedBedI) error

func (*BinIndexMap) Query added in v0.0.3

func (d *BinIndexMap) Query(b BedI) (<-chan NamedRangeI, error)

func (*BinIndexMap) QueryRegion added in v0.0.3

func (d *BinIndexMap) QueryRegion(chr string, start int, end int) (<-chan NamedRangeI, error)

type Db added in v0.0.3

type Db struct {
	// contains filtered or unexported fields
}

func NewDb added in v0.0.3

func NewDb() Db

func (Db) Get added in v0.0.3

func (db Db) Get(id string) (Bed6i, error)

* TODO Get All Bed6i with same Id */

func (Db) Load added in v0.0.3

func (db Db) Load(fn string) error

func (Db) Query added in v0.0.3

func (db Db) Query(chr string, start int, end int) (<-chan Bed6i, error)

type NamedBedI added in v0.0.3

type NamedBedI interface {
	BedI
	Id() string
}

type NamedRangeI added in v0.0.3

type NamedRangeI interface {
	RangeI
	Id() string
}

type RangeI added in v0.0.3

type RangeI interface {
	Start() int
	End() int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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