fold

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package fold is a package for folding DNA and RNA sequences into secondary structures.

This package provides everything you need to fold a DNA or RNA sequence into a secondary structure and get the minimum free energy of the structure. Most of the code was ported from the python SeqFold package by Lattice Automation and Joshua Timmons but we hope to have a linear fold algorithm in the near future.

Biological context:

DNA, RNA, and proteins all fold. Protein is a particularly tricky thing to predict partially because there are so many more amino acids than there are nucleotides.

ACG(T/U) vs. ACDEFGHIKLMNPQRSTVWY (20 amino acids)

These folding predictions help us understand how to design primers, guide RNAs, and other nucleic acid sequences that fold into a particular structure.

Fortunately for us, DNA and RNA are much easier to predict because there are only 4 nucleotides and the rules for folding are much more well defined.

Each function has citations to the original papers that describe the algorithms used. Most of the algorithms used in this package are based on the work of Zuker and Stiegler, 1981 but we're hoping to add more algorithms in the near future such as linear fold.

TTFN, Tim

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bulge

func Bulge(start, rightOfStart, end, leftOfEnd int, foldContext context) (float64, error)

Bulge calculates the free energy associated with a bulge.

Args:

	start: The start index of the bulge
	rightOfStart: The index to the right of start
	end: The end index of the bulge
	leftOfEnd: The index to the left of end
 foldContext: The FoldingContext for this sequence

Returns the increment in free energy from the bulge

Types

type Result

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

Result holds the resulting structures of the folded s

func Zuker

func Zuker(seq string, temp float64) (Result, error)

Zuker folds the DNA sequence and return the lowest free energy score.

Based on the approach described in: Zuker and Stiegler, 1981 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC326673/pdf/nar00394-0137.pdf

If the sequence is 50 or more bp long, "isolated" matching bp are ignored in pairedMinimumFreeEnergyV(start,end). This is based on an approach described in: Mathews, Sabina, Zuker and Turner, 1999 https://www.ncbi.nlm.nih.gov/pubmed/10329189 Args:

seq: The sequence to Fold
temp: The temperature the Fold takes place in, in Celsius

Returns a slice of NucleicAcidStructure with the energy and description, i.e. stacks, bulges, hairpins, etc.

Example
package main

import (
	"fmt"

	"github.com/bebop/poly/fold"
)

func main() {
	result, _ := fold.Zuker("ACCCCCUCCUUCCUUGGAUCAAGGGGCUCAA", 37.0)
	brackets := result.DotBracket()
	fmt.Println(brackets)
}
Output:

.((((.(((......)))....))))

func (Result) DotBracket

func (r Result) DotBracket() string

DotBracket returns the dot-bracket notation of the secondary nucleic acid structure resulting from folding a sequence.

Dot-bracket notation, consisting in a balanced parentheses string composed by a three-character alphabet {.,(,)}, that can be unambiguously converted in the RNA secondary structure. See example_test.go for a small example.

func (Result) MinimumFreeEnergy

func (r Result) MinimumFreeEnergy() float64

MinimumFreeEnergy return just the delta G of the structures resulting from folding a sequence.

Returns the minimum free energy of the folded sequence

Jump to

Keyboard shortcuts

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