sam

package
v0.9.19 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2017 License: BSD-2-Clause Imports: 8 Imported by: 10 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package to read and write SAM format files

Index

Constants

This section is empty.

Variables

View Source
var (
	Regex = regexp.MustCompile(`^[\n\r]*[@[A-Z][A-Z][ \t]+[\S \t]+[\n\r]]*`)
)

Functions

func Format

func Format(s *seq.Seq, w io.Writer) (n int, err error)

To-do: not finished Format a single sequence into sam string

func NewReader

func NewReader(f file.SectionReader) seq.ReadRewinder

Returns a new Sam format reader using r.

func NewReaderName

func NewReaderName(name string) (r seq.ReadRewinder, err error)

Returns a new Sam format reader using a filename.

Types

type Reader

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

Sam sequence format reader type.

func (*Reader) GetReadOffset

func (self *Reader) GetReadOffset() (n int, err error)

Read a single sequence and return read offset for indexing.

func (*Reader) Read

func (self *Reader) Read() (sequence *seq.Seq, err error)

Read a single sequence and return it or an error.

func (*Reader) ReadRaw

func (self *Reader) ReadRaw(p []byte) (n int, err error)

Read a single sequence and return it or an error. (used for making record index)

func (*Reader) Rewind

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

Rewind the reader.

func (*Reader) SeekChunk

func (self *Reader) SeekChunk(offSet int64) (n int64, err error)

type Writer

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

Fasta sequence format writer type.

func NewWriter

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

Returns a new sam format writer using f.

func NewWriterName

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

Returns a new sam 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 sequence.

func (*Writer) Flush

func (self *Writer) Flush() error

Flush the writer.

func (*Writer) Write

func (self *Writer) Write(s *seq.Seq) (n int, err error)

Write a single sequence 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