gff

package
v0.0.0-...-25502c3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2012 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package to read and write GFF format files

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultVersion    = 2
	DefaultToOneBased = true
)

Functions

This section is empty.

Types

type Reader

type Reader struct {
	Version       int
	OneBased      bool
	SourceVersion string
	Date          time.Time
	TimeFormat    string // Required for parsing date fields
	Type          bio.Moltype
	// contains filtered or unexported fields
}

GFF format reader type.

func NewReader

func NewReader(f io.ReadCloser) *Reader

Returns a new GFF format reader using f.

func NewReaderName

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

Returns a new GFF reader using a filename.

func (*Reader) Close

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

Close the reader.

func (*Reader) Read

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

Read a single feature or part and return it or an error.

func (*Reader) Rewind

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

Rewind the reader.

type Writer

type Writer struct {
	Version     int
	OneBased    bool
	FloatFormat byte
	Precision   int
	Width       int
	// contains filtered or unexported fields
}

GFF format writer type.

func NewWriter

func NewWriter(f io.WriteCloser, version, width int, header bool) (w *Writer)

Returns a new GFF format writer using f. When header is true, a version header will be written to the GFF.

func NewWriterName

func NewWriterName(name string, version, width int, header bool) (w *Writer, err error)

Returns a new GFF format writer using a filename, truncating any existing file. If appending is required use NewWriter and os.OpenFile. When header is true, a version header will be written to the GFF.

func (*Writer) Close

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

Close the writer, flushing any unwritten data.

func (*Writer) Flush

func (self *Writer) Flush() error

Flush the writer.

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.

func (*Writer) WriteComment

func (self *Writer) WriteComment(c string) (n int, err error)

Write a comment line to a GFF file

func (*Writer) WriteMetaData

func (self *Writer) WriteMetaData(d interface{}) (n int, err error)

Write meta data to a GFF file.

Jump to

Keyboard shortcuts

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