fastq

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2016 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package to read and write FASTQ format files

Index

Constants

This section is empty.

Variables

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

Functions

func Format

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

Format a single sequence into fastq string

func NewReader

func NewReader(f file.SectionReader) seq.ReadRewinder

Returns a new fastq format reader using r.

func NewReaderName

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

Returns a new fastq format reader using a filename.

Types

type Reader

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

Fastq 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. TODO: Does not read interleaved fastq.

func (*Reader) ReadRaw

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

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)

seek sequences which add up to a size close to the configured chunk size (conf.CHUNK_SIZE, e.g. 1M)

type Writer

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

Fastq sequence format writer type.

func NewWriter

func NewWriter(f io.WriteCloser) *Writer

Returns a new fastq format writer using w.

func NewWriterName

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

Returns a new fastq 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