biogo: github.com/biogo/biogo/feat Index | Files | Directories

package feat

import "github.com/biogo/biogo/feat"

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

Index

Package Files

feature.go moltype.go position.go

func BasePositionOf Uses

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.

func OneToZero Uses

func OneToZero(pos int) int

Convert from 1-based to 0-based indexing

func PositionWithin Uses

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 Uses

func ZeroToOne(pos int) int

Convert from 0-based to 1-based indexing

type Adder Uses

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

type Collection Uses

type Collection interface {
    Set
    Location() Feature
}

type Conformation Uses

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

func (Conformation) String Uses

func (c Conformation) String() string

type Conformationer Uses

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

type Feature Uses

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.

type LocationSetter Uses

type LocationSetter interface {
    SetLocation(Feature) error
}

type Moltype Uses

type Moltype int8

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

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

func ParseMoltype Uses

func ParseMoltype(s string) Moltype

ParseMoltype allows conversion from a string to a Moltype.

func (Moltype) String Uses

func (m Moltype) String() string

Return a string representation of a Moltype.

type Mutable Uses

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

type Offsetter Uses

type Offsetter interface {
    SetOffset(int) error
}

type OrientSetter Uses

type OrientSetter interface {
    SetOrientation(Orientation) error
}

type Orientation Uses

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

func BaseOrientationOf Uses

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 OrientationWithin Uses

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 Uses

func (o Orientation) String() string

type Orienter Uses

type Orienter interface {
    Orientation() Orientation
}

Orienter wraps the Orientation method.

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

type Pair Uses

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

type Range Uses

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

type Set Uses

type Set interface {
    Features() []Feature
}

Directories

PathSynopsis
genePackage gene contains the types and methods to handle the definition of a gene.
genomePackage genome defines types useful for representing cytogenetic features.

Package feat imports 1 packages (graph) and is imported by 115 packages. Updated 2017-01-24. Refresh now. Tools for package owners.