bed

package
v0.0.0-...-7b6cf24 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2012 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package to read and write BED file formats

Index

Constants

This section is empty.

Variables

View Source
var CharToStrand map[string]int8 = map[string]int8{"+": 1, "": 0, "-": -1}
View Source
var StrandToChar map[int8]string = map[int8]string{1: "+", 0: "", -1: "-"}

Functions

This section is empty.

Types

type Reader

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

BED format reader type.

func NewReader

func NewReader(f io.ReadCloser, b int) *Reader

Returns a new BED format reader using f.

func NewReaderName

func NewReaderName(name string, b int) (r *Reader, err error)

Returns a new BED reader using a filename.

func (*Reader) Close

func (self *Reader) Close() (err error)

Close the reader.

func (*Reader) Line

func (self *Reader) Line() int

Return the current line number

func (*Reader) Read

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

Read a single feature and return it or an error.

func (*Reader) Rewind

func (self *Reader) Rewind() (err error)

Rewind the reader.

type Writer

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

BED format writer type.

func NewWriter

func NewWriter(f io.WriteCloser, b int) *Writer

Returns a new BED format writer using f.

func NewWriterName

func NewWriterName(name string, b int) (w *Writer, err error)

Returns a new BED format writer using a filename, truncating any existing file. If appending is required use NewWriter and os.OpenFile.

func (*Writer) Close

func (self *Writer) Close() (err error)

Close the writer, flushing any unwritten data.

func (*Writer) Stringify

func (self *Writer) Stringify(f *feat.Feature) string

Convert a feature to a string.

func (*Writer) Write

func (self *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