bio

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Precision        = 4   // biogo global precision value.
	FloatFormat byte = 'f' // biogo global float format.
)

Output defaults.

View Source
var (
	N = []byte("ACGTacgt")
	R = []byte("ACGUacgu")
	P = []byte("ABCDEFGHIJKLMNPQRSTVXYZabcdefghijklmnpqrstvxyz*")
)

Provide default Validators.

View Source
var TraceDepth = 10

Trace depth

Functions

func OneToZero

func OneToZero(pos int) int

Convert from 1-based to 0-based indexing

func ZeroToOne

func ZeroToOne(pos int) int

Convert from 0-based to 1-based indexing

Types

type Error

type Error interface {
	FileLine() (file string, line int) // Return the file name and line number of caller stored at creation of the Error.
	Trace() (stack []*runtime.Func)    // Return a slice contining the stack trace stored at creation of the Error.
	Package() string                   // Return the package name of the stored caller.
	Function() string                  // Return the function name of the stored caller.
	Items() []interface{}              // Return any items retained by caller.
	Tracef(depth int) string           // A formatted stack trace of the error extending depth frames into the stack, 0 indicates no limit.
	error
}

Base Error handling for bio packages.

func NewError

func NewError(message string, skip int, items ...interface{}) Error

Create a new Error with message, storing information about the caller stack frame skip levels above the caller and any item that may be needed for handling the error.

type Moltype

type Moltype int8

Moltype represents the molecule type of a source of sequence data.

const (
	Undefined Moltype = iota - 1
	DNA
	RNA
	Protein
)

func ParseMoltype

func ParseMoltype(s string) Moltype

ParseMoltype allows conversion from a string to a Moltype.

func (Moltype) String

func (self Moltype) String() string

Return a string representation of a Moltype.

type Validator

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

Validator type checks that a sequence conforms to a specified alphabet.

var ValidN, ValidR, ValidP *Validator

func NewValidator

func NewValidator(valid []byte) (v *Validator)

Make a new Validator with valid defining the allowable values for the alphabet.

func (*Validator) Check

func (self *Validator) Check(n []byte) (valid bool, pos int)

Check that a slice of bytes conforms to an alphabet, returning false and the position of the first invalid byte if invalid and true and a negative int if valid.

func (*Validator) String

func (self *Validator) String() string

Return a string indicating characters accepted as valid by the Validator.

Jump to

Keyboard shortcuts

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