sam

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 8 Imported by: 4

Documentation

Overview

Package sam handles SAM I/O.

This package uses the format described in https://en.wikipedia.org/wiki/SAM_(file_format).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

A Reader reads and parses SAM lines.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader returns a new SAM reader that reads from r.

func (*Reader) Next

func (r *Reader) Next() (*SAM, error)

Next returns the next SAM line.

func (*Reader) NextHeader

func (r *Reader) NextHeader() (string, error)

NextHeader returns the next header line as a raw string, including the '@'. Returns EOF when out of header lines, then Next can be called for the data lines.

type SAM

type SAM struct {
	Qname string                 // Query name
	Flag  int                    // Bitwise flag
	Rname string                 // Reference sequence name
	Pos   int                    // Mapping position (1-based)
	Mapq  int                    // Mapping quality
	Cigar string                 // CIGAR string
	Rnext string                 // Ref. name of the mate/next read
	Pnext int                    // Position of the mate/next read
	Tlen  int                    // Observed template length
	Seq   string                 // Sequence
	Qual  string                 // Phred qualities (ASCII)
	Tags  map[string]interface{} // Typed optional tags.
}

SAM is a single line (alignment) in a SAM file.

func (*SAM) Text added in v0.1.2

func (s *SAM) Text() string

Text returns the textual representation of s in SAM format. Includes a trailing new line.

Jump to

Keyboard shortcuts

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