feat

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: BSD-3-Clause Imports: 1 Imported by: 152

Documentation

Overview

Package feat provides the base for storage and manipulation of biological interval information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseOrientationOf

func BaseOrientationOf(f Feature) (ori Orientation, ref Feature)

BaseOrientationOf returns the orientation of f relative to a reference which is the first non-nil, non-orientable feature location, and that reference feature. The returned reference feature should be used by callers of BaseOrientationOf to verify that orientations are comparable. If f is not orientable, the returned orientation will be NotOriented and the reference will be the first orientable or last non-nil feature. BaseOrientationOf will panic if the feature chain is deeper than 1000 links.

func OneToZero

func OneToZero(pos int) int

Convert from 1-based to 0-based indexing

func PositionWithin

func PositionWithin(f, ref Feature, position int) (pos int, ok bool)

PositionWithin returns the position in f coordinates converted to coordinates relative to the given reference feature and a boolean indicating whether f can be located relative to ref. PositionWithin will panic if the feature chain is deeper than 1000 links.

func ZeroToOne

func ZeroToOne(pos int) int

Convert from 0-based to 1-based indexing

Types

type Adder

type Adder interface {
	Set
	Add(...Feature)
}

type Collection

type Collection interface {
	Set
	Location() Feature
}

type Conformation

type Conformation int8
const (
	UndefinedConformation Conformation = iota - 1
	Linear
	Circular
)

func (Conformation) String

func (c Conformation) String() string

type Conformationer

type Conformationer interface {
	Conformation() Conformation
	SetConformation(Conformation) error
}

type Feature

type Feature interface {
	Range
	// Name returns the name of the feature.
	Name() string
	// Description returns the description of the feature.
	Description() string
	// Location returns the reference feature on which the feature is located.
	Location() Feature
}

Feature is a Range whose coordinates are defined relative to a feature location. Start and End return the coordinates of the feature relative to its location which can be nil. In the latter case callers should make no assumptions whether coordinates of such features are comparable.

func BasePositionOf

func BasePositionOf(f Feature, position int) (int, Feature)

BasePositionOf returns the position in f coordinates converted to coordinates relative to the first nil feature location, and a reference which is the feature location preceding the nil. The returned reference feature should be used by callers of BasePositionOf to verify that coordinates are comparable. BasePositionOf will panic if the feature chain is deeper than 1000 links.

type LocationSetter

type LocationSetter interface {
	SetLocation(Feature) 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 (m Moltype) String() string

Return a string representation of a Moltype.

type Mutable

type Mutable interface {
	SetStart(int) error
	SetEnd(int) error
}

type Offsetter

type Offsetter interface {
	SetOffset(int) error
}

type OrientSetter

type OrientSetter interface {
	SetOrientation(Orientation) error
}

type Orientation

type Orientation int8
const (
	Reverse Orientation = iota - 1
	NotOriented
	Forward
)

func OrientationWithin

func OrientationWithin(f, ref Feature) Orientation

OrientationWithin returns the orientation of f relative to the given reference feature. The returned orientation will be NotOriented if f is not located within the reference or if f is not orientable. OrientationWithin will panic if the feature chain is deeper than 1000 links.

func (Orientation) String

func (o Orientation) String() string

type Orienter

type Orienter interface {
	Orientation() Orientation
}

Orienter wraps the Orientation method.

Orientation returns the orientation of the feature relative to its location.

type Pair

type Pair interface {
	Features() [2]Feature
}

type Range

type Range interface {
	Start() int
	End() int
	Len() int
}

type Set

type Set interface {
	Features() []Feature
}

Directories

Path Synopsis
Package gene contains the types and methods to handle the definition of a gene.
Package gene contains the types and methods to handle the definition of a gene.
Package genome defines types useful for representing cytogenetic features.
Package genome defines types useful for representing cytogenetic features.
cow/bt7
Package bt7 defines chromosome and assembly fragment intervals for the bt7 genome assembly for cow.
Package bt7 defines chromosome and assembly fragment intervals for the bt7 genome assembly for cow.
drosophila/dm3
Package dm3 defines chromosome and band intervals for the drosophila karyotype based on the dm3 assembly.
Package dm3 defines chromosome and band intervals for the drosophila karyotype based on the dm3 assembly.
human/hg19
Package hg19 defines chromosome and band intervals for the human karyotype based on the hg19 assembly.
Package hg19 defines chromosome and band intervals for the human karyotype based on the hg19 assembly.
mouse/mm10
Package mm10 defines chromosome and band intervals for the mouse karyotype based on the mm10 assembly.
Package mm10 defines chromosome and band intervals for the mouse karyotype based on the mm10 assembly.

Jump to

Keyboard shortcuts

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