cloningprimer

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: MIT Imports: 8 Imported by: 4

README

CloningPrimer

GitHub (pre-)release GoDoc Packagist Build Status codecov

About

Cloning Primer is a software tool that facilitates the design of primer pairs for gene cloning. Given a certain nucleotide sequence and a set of parameters (see Documentation), it returns forward and reverse primers as well as useful statistics like GC content, the probability of the primer pair to form dimers, and much more.

The software is accessible via a web application, but it is recommended to download the command line application (CLI) to enable offline use. Also, an API (written in Go) is available through this GitHub repository. Cloning Primer is under active development, so source code, web interface, API, and CLI might change in the future!

A working version of Cloning Primer is currently available as a pre-release version v0.0.3. Please review the documentation section of this README file for more information about available functionality.

Overview

A pre-release version of the web application is available here.

CLI binaries can be downloaded from ./bin in this repository.

Table of Contents
  1. About

  2. Overview

  3. Documentation

  4. License

Documentation

Application Programming Interface (API)

More documentation regarding the Go API of Cloning Primer is available here.

A minimal, working example:

package main

import (
	"fmt"
	"log"

	cloningprimer "github.com/DanielSchuette/cloningPrimer"
)

func main() {
	// define an input string (must be a valid nucleotide sequence)
	input := "ATGCAAAAACGGGCGATTTATCCGGGTACTTTCGATCCCATTACCAATGGTCATATCGATATCGTGACGCGCGCCACGCAGATGTTCGATCACGTTATTCTGGCGATTGCCGCCAGCCCCAGTAAAAAACCGATGTTTACCCTGGAAGAGCGTGTGGCACTGGCACAGCAGGCAACCGCGCATCTGGGGAACGTGGAAGTGGTCGGGTTTAGTGATTTAATGGCGAACTTCGCCCGTAATCAACACGCTACGGTGCTGATTCGTGGCCTGCGTGCGGTGGCAGATTTTGAATATGAAATGCAGCTGGCGCATATGAATCGCCACTTAATGCCGGAACTGGAAAGTGTGTTTCTGATGCCGTCGAAAGAGTGGTCGTTTATCTCTTCATCGTTGGTGAAAGAGGTGGCGCGCCATCAGGGCGATGTCACCCATTTCCTGCCGGAGAATGTCCATCAGGCGCTGATGGCGAAGTTAGCGTAG"

	// find forward primer with EcoRI restriction site and 5 random nucleotides as an overhang
	forward, err := cloningprimer.FindForward(input, "GAATTC", 1, 18, 4, false)
	if err != nil {
		log.Fatalf("error finding forward primer: %s\n", err)
	}
	if forward == "" {
		log.Fatalf("no forward primer found\n")
	}

	// find reverse primer with BamHI restriction site and 3 random nucleotides as an overhang
	reverse, err := cloningprimer.FindReverse(input, "GGATCC", 1, 20, 3, true)
	if err != nil {
		log.Fatalf("error finding reverse primer: %s\n", err)
	}
	if reverse == "" {
		log.Fatalf("no reverse primer found\n")
	}

	// print results
	fmt.Printf("input: %s\nforward primer: %s\nreverse primer: %s\n", input, forward, reverse)
}
Command Line Interface (CLI)

Documentation is coming soon.

Web Application

Documentation is coming soon.

License

This software is licensed under the MIT license, see LICENSE for more information.

Documentation

Overview

Package cloningprimer is a software tool that facilitates the design of primer pairs for gene cloning. The project lives at https://github.com/DanielSchuette/cloningPrimer and has a web interface and CLI in addition to its Go API.

Code Example:

package main

import (
	"fmt"
	"log"

	cloningprimer "github.com/DanielSchuette/cloningPrimer"
)

func main() {
	// define an input string (must be a valid nucleotide sequence)
	input := "ATGCAAAAACGGGCGATTTATCCGGGTACTTTCGATCCCATTACCAATGGTCATATCGATATCGTGACGCGCGCCACGCAGATGTTCGATCACGTTATTCTGGCGATTGCCGCCAGCCCCAGTAAAAAACCGATGTTTACCCTGGAAGAGCGTGTGGCACTGGCACAGCAGGCAACCGCGCATCTGGGGAACGTGGAAGTGGTCGGGTTTAGTGATTTAATGGCGAACTTCGCCCGTAATCAACACGCTACGGTGCTGATTCGTGGCCTGCGTGCGGTGGCAGATTTTGAATATGAAATGCAGCTGGCGCATATGAATCGCCACTTAATGCCGGAACTGGAAAGTGTGTTTCTGATGCCGTCGAAAGAGTGGTCGTTTATCTCTTCATCGTTGGTGAAAGAGGTGGCGCGCCATCAGGGCGATGTCACCCATTTCCTGCCGGAGAATGTCCATCAGGCGCTGATGGCGAAGTTAGCGTAG"

	// find forward primer with EcoRI restriction site and 5 random nucleotides as an overhang
	forward, err := cloningprimer.FindForward(input, "GAATTC", 1, 18, 4, false)
	if err != nil {
		log.Fatalf("error finding forward primer: %s\n", err)
	}
	if forward == "" {
		log.Fatalf("no forward primer found\n")
	}

	// find reverse primer with BamHI restriction site and 3 random nucleotides as an overhang
	reverse, err := cloningprimer.FindReverse(input, "GGATCC", 1, 20, 3, true)
	if err != nil {
		log.Fatalf("error finding reverse primer: %s\n", err)
	}
	if reverse == "" {
		log.Fatalf("no reverse primer found\n")
	}

	// print results
	fmt.Printf("input: %s\nforward primer: %s\nreverse primer: %s\n", input, forward, reverse)
}

Index

Constants

View Source
const (
	// Codon is a sequence of 3 nucleotides
	Codon = 3

	// MinimumPrimerLength gives the minimum length that a primer must be
	MinimumPrimerLength = 10

	// MaximumPrimerLength gives the maximum length that a primer can be
	MaximumPrimerLength = 30
)

Variables

This section is empty.

Functions

func AddOverhang

func AddOverhang(seq string, len int, front bool) string

AddOverhang appends pseudo-random nucleotides as an overhang to the front (`front' = True) or back (`front' = False) of the input nucleotide sequence `seq' (overhang is of length `len')

func CalculateGC added in v0.0.3

func CalculateGC(primer string) (float64, error)

CalculateGC takes a `primer' as an input and returns the GC nucleotide content as a floating point number between 0.0 and 1.0

func CalculateTm added in v0.0.3

func CalculateTm(primer string, complementary int) (float64, error)

CalculateTm takes a `primer' (5' -> 3') as an input and returns the melting temperature (or Tm) as a floating point number; it uses the formula: Tm = 2°C * (A + T) + 4°C * (C + G) `complementary' indicates how many nucleotides (from the 3' end of the `primer') should be considered if `complementary' is `0', this argument is ignored and the entire `primer' is used for calculations

func Complement

func Complement(nucleotide byte) (byte, error)

Complement finds the complement of a nucleotide sequence (i.e. Watson-Crick base pairs)

func FilterEnzymeMap

func FilterEnzymeMap(enzymeMap map[string]RestrictEnzyme, query string) (map[string]RestrictEnzyme, error)

FilterEnzymeMap takes a map with keys of type `string' and values of type `RestrictEnzyme' and returns a slice of strings containing enzyme names that match a certain query string `query'

func FindForward

func FindForward(seq, restrict string, seqStart, length, random int, startCodon bool) (string, error)

FindForward finds a forward primer with a `length' number of complementary nucleotides, binding to the specified starting position (`seqStart'), counting from the 5' end) and up to (`seqStart' + `length' - 1); e.g. if `length' = 10 and `start' = 1, a primer will be returned that binds to nucleotides 1 - 10; the boolean `startCodon' indicates if an 'ATG' should be added and is only evaluated if no 'ATG' is found in the input `seq' (if that is the case, 'ATG' adds three nucleotides to the total length of the primer); `random' indicates how many random nucleotides should be added as an overhang; `restrict' is a string giving the recognition sequence of a restriction enzyme

func FindReverse

func FindReverse(seq, restrict string, seqStart, length, random int, stopCodon bool) (string, error)

FindReverse finds a reverse primer with a `length' number of complementary nucleotides, binding to the specified start position measured from the 3' end of `seq' up to nucleotide (`seqStart' + `length' -1); `random' indicates the number of random nucleotides to be added to the primer; `restrict' indicates the restriction enzyme recognition site; the boolean `stopCodon' indicates if a stop codon should be added to the primer (only evaluated if the last 3 nucleotides of the sequence underlying the primer do not make up a valid stop codon - in that case, the stop codon adds three nucleotides to the total length of the primer)

func HasStartCodon

func HasStartCodon(seq string, exact bool) bool

HasStartCodon returns true if the first 3 characters of a given input sequence `seq' are 'ATG' if `exact' is false, the entire sequence is checked for the triplet 'ATG'

func HasStopCodon1

func HasStopCodon1(seq string, exact bool) bool

HasStopCodon1 (see also ...2, ...3) returns true if the first 3 characters of a given input sequence `seq' are reversed complements of the stop codon TAA if `exact' is false, the entire sequence is checked for the reverse complement of TAA

func HasStopCodon2

func HasStopCodon2(seq string, exact bool) bool

HasStopCodon2 tests reverse complement of TAG (see HasStopCodon1)

func HasStopCodon3

func HasStopCodon3(seq string, exact bool) bool

HasStopCodon3 tests reverse complement of TGA (see HasStopCodon1)

func IsNucleotide

func IsNucleotide(letter byte) bool

IsNucleotide returns a boolean if input rune is a valid nucleotide letter (i.e. one of A/a/T/t/G/g/C/c)

func ParseEnzymesFromFile

func ParseEnzymesFromFile(file string) (map[string]RestrictEnzyme, error)

ParseEnzymesFromFile parses enzyme data (identifiers, recognition sequences, etc.) from a *.re file (see the example in ./assets/enzymes.re) and returns a map with enzyme names as keys and `restricEnzyme' structs as values

func ParseSequenceFromFile

func ParseSequenceFromFile(file string) (string, error)

ParseSequenceFromFile parses a plasmid or DNA sequence from a *.seq file (see the example in ./assets/tp53.seq) and returns the sequence as a string

func Reverse

func Reverse(seq string) string

Reverse finds the reverse of a nucleotide sequence; it requires prior checking of possible sources of errors (for example, it does not check if the input sequence contains invalid nucleotide letters); thus, `Reverse' should be called in the context of a valid `seq' input argument

func ValidateSequence added in v0.0.3

func ValidateSequence(seq []byte) (string, error)

ValidateSequence takes a slice of bytes as an input and checks if it contains anything else but valid nucleotide letters ('A', 'G', 'T', 'C'); lower case letters are accepted and capitalized '/n' and white spaces are silently ignored and a valid sequence is returned to the caller

Types

type RestrictEnzyme

type RestrictEnzyme struct {
	Name            string   /* e.g. EcoRI */
	RecognitionSite string   /* e.g. AACGTT */
	NoPalinCleav    string   /* either "no" or "(...)(...)", see *.re specification in ./assets/enzymes.re */
	ID              string   /* the PDB ID of the enzyme */
	Isoschizomeres  []string /* common isoschizomeres */
}

RestrictEnzyme is an internally used struct that holds data of a certain restriction enzyme

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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