linearfold

package
v0.0.0-...-85e8820 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	MANNER_NONE                  = iota // 0: empty
	MANNER_H                            // 1: hairpin candidate
	MANNER_HAIRPIN                      // 2: hairpin
	MANNER_SINGLE                       // 3: single
	MANNER_HELIX                        // 4: helix
	MANNER_MULTI                        // 5: multi = ..M2. [30 restriction on the left and jump on the right]
	MANNER_MULTI_eq_MULTI_plus_U        // 6: multi = multi + U
	MANNER_P_eq_MULTI                   // 7: P = (multi)
	MANNER_M2_eq_M_plus_P               // 8: M2 = M + P
	MANNER_M_eq_M2                      // 9: M = M2
	MANNER_M_eq_M_plus_U                // 10: M = M + U
	MANNER_M_eq_P                       // 11: M = P
	/* MANNER_C_eq_U, */
	/* MANNER_C_eq_P, */
	MANNER_C_eq_C_plus_U // 12: C = C + U
	MANNER_C_eq_C_plus_P // 13: C = C + P
)

What is manner?

View Source
const (
	DefaultTemperature     = mfe.DefaultTemperature
	DefaultEnergyParamsSet = energy_params.Turner2004
)
View Source
const ASYMMETRY_MAX_LEN int = 28
View Source
const DefaultBeamSize int = 100

recommended beam size based on paper

View Source
const EXPLICIT_MAX_LEN int = 4
View Source
const HAIRPIN_MAX_LEN int = 30
View Source
const MIN_CUBE_PRUNING_SIZE int = 20
View Source
const NOTON int = 5 // NUM_OF_TYPE_OF_NUCS
View Source
const NOTOND int = 25
View Source
const NOTONT int = 125
View Source
const SINGLE_MAX_LEN int = 30 // NOTE: *must* <= sizeof(char), otherwise modify State::TraceInfo accordingly
View Source
const SINGLE_MIN_LEN int = 0
View Source
const SYMMETRIC_MAX_LEN int = 15

Variables

View Source
var INTERNAL_MAX_LEN int = SINGLE_MAX_LEN
View Source
var VALUE_MIN float64 = -math.MaxFloat64

Functions

func BeamPrune

func BeamPrune(beamstep *map[int]*State) float64

func CONTRAfoldV2

func CONTRAfoldV2(sequence string, beamSize int) (string, float64)
Example
result, score := CONTRAfoldV2("UGAGUUCUCGAUCUCUAAAAUCG", DefaultBeamSize)

fmt.Printf("result: %v , score: %v", result, score)
Output:

result: ....................... , score: -0.22376699999999988

func GET_ACGU_NUM

func GET_ACGU_NUM(x rune) int

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func NUM_TO_NUC

func NUM_TO_NUC(x int) int

func NUM_TO_PAIR

func NUM_TO_PAIR(x, y int) (ret energy_params.BasePairType)

func Parse

func Parse(sequence string, foldingModel FoldingModel) (string, float64)

func SET_HELIX_STACKING

func SET_HELIX_STACKING(x rune, y rune, z rune, w rune, val bool)

func ScoreExternalUnpaired

func ScoreExternalUnpaired(i, j int) float64

func ViennaRNAFold

func ViennaRNAFold(sequence string, temperature float64, energyParamsSet energy_params.EnergyParamsSet, danglingEndsModel mfe.DanglingEndsModel, beamSize int) (string, float64)
Example
sequence := "UCUAGACUUUUCGAUAUCGCGAAAAAAAAU"
result, score := ViennaRNAFold(sequence, DefaultTemperature, DefaultEnergyParamsSet, mfe.DefaultDanglingEndsModel, DefaultBeamSize)
fmt.Printf("result: %v , score: %.2f", result, score)
Output:

result: .......((((((......))))))..... , score: -3.90

Types

type CONTRAfoldV2FoldWrapper

type CONTRAfoldV2FoldWrapper struct {
	BeamSize int
}

func NewDefaultCONTRAfoldV2FoldWrapper

func NewDefaultCONTRAfoldV2FoldWrapper() CONTRAfoldV2FoldWrapper

func (CONTRAfoldV2FoldWrapper) Fold

func (c CONTRAfoldV2FoldWrapper) Fold(sequence string, temp float64) (dotBracket string, score float64, err error)

type FoldingModel

type FoldingModel int
const (
	CONTRAfoldv2 FoldingModel = iota // CONTRAfold v2.0 machine-learned model, Do et al 2006
	ViennaRNA                        // thermodynamic model, Lorenz et al 2011, with parameters from Mathews et al 2004
)

type Pair

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

type PairHeap

type PairHeap []Pair

func (PairHeap) Len

func (h PairHeap) Len() int

func (PairHeap) Less

func (h PairHeap) Less(i, j int) bool

func (*PairHeap) Pop

func (h *PairHeap) Pop() interface{}

func (*PairHeap) Push

func (h *PairHeap) Push(x interface{})

func (PairHeap) Swap

func (h PairHeap) Swap(i, j int)

type State

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

func NewState

func NewState() *State

func (*State) Set

func (s *State) Set(score float64, manner int)

func (*State) Set2

func (s *State) Set2(score float64, manner int, l1 rune, l2 int)

func (*State) Set3

func (s *State) Set3(score float64, manner int, split int)

type Tuple

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

type ViennaRNAFoldWrapper

type ViennaRNAFoldWrapper struct {
	EnergyParamsSet   energy_params.EnergyParamsSet
	DanglingEndsModel mfe.DanglingEndsModel
	BeamSize          int
}

func NewDefaultViennaRnaFoldWrapper

func NewDefaultViennaRnaFoldWrapper() ViennaRNAFoldWrapper

func (ViennaRNAFoldWrapper) Fold

func (v ViennaRNAFoldWrapper) Fold(sequence string, temp float64) (dotBracket string, score float64, err error)

Jump to

Keyboard shortcuts

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