poly

package module
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 2 Imported by: 1

README

(Poly)merase

PkgGoDev GitHub license Tests Test Coverage

Poly is a Go package for engineering organisms.

  • Fast: Poly is fast and scalable.

  • Modern: Poly tackles issues that other libraries and utilities just don't. From general codon optimization and primer design to circular sequence hashing. All written in a language that was designed to be fast, scalable, and easy to develop in and maintain. Did we say it was fast?

  • Reproducible: Poly is well tested and designed to be used in industrial, academic, and hobbyist settings. No more copy and pasting strings into random websites to process the data you need.

  • Ambitious: Poly's goal is to be the most complete, open, and well used collection of computational synthetic biology tools ever assembled. If you like our dream and want to support us please star this repo, request a feature, open a pull request, or sponsor the project.

Documentation

Community

  • Discord: Chat about Poly and join us for game nights on our discord server!

Contributing

  • Code of conduct: Please read the full text so you can understand what we're all about and remember to be excellent to each other!

  • Contributor's guide: Please read through it before you start hacking away and pushing contributions to this fine codebase.

Sponsor

  • Sponsor: 🤘 Thanks for your support 🤘

License

  • MIT

  • Copyright (c) 2021 Timothy Stiles

Documentation

Overview

Package poly is a go package for engineering organisms.

Poly can be used in two ways.

  1. As a Go library where you have finer control and can make magical things happen.
  2. As a command line utility where you can bash script your way to greatness and make DNA go brrrrrrrr.

Installation

These instructions assume that you already have a working go environment. If not see:

https://golang.org/doc/install

Building Poly CLI and package from scratch:

git clone https://github.com/TimothyStiles/poly.git && cd poly && go build ./... && go install ./...

Installing latest release of poly as a go package:

go get github.com/TimothyStiles/poly

For CLI only instructions please checkout: https://pkg.go.dev/github.com/TimothyStiles/poly/poly

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	Name string //Seqid in gff, name in gbk
	//gff specific
	Source               string            `json:"source"`
	Type                 string            `json:"type"`
	Score                string            `json:"score"`
	Strand               string            `json:"strand"`
	Phase                string            `json:"phase"`
	Attributes           map[string]string `json:"attributes"`
	GbkLocationString    string            `json:"gbk_location_string"`
	Sequence             string            `json:"sequence"`
	SequenceLocation     Location          `json:"sequence_location"`
	SequenceHash         string            `json:"sequence_hash"`
	Description          string            `json:"description"`
	SequenceHashFunction string            `json:"hash_function"`
	ParentSequence       *Sequence         `json:"-"`
}

Feature holds a single annotation in a struct. from https://github.com/blachlylab/gff3/blob/master/gff3.go

func (Feature) GetSequence

func (feature Feature) GetSequence() string

GetSequence is a method wrapper to get a Feature's sequence. Mutates with Sequence.

Example
// Sequence for greenflourescent protein (GFP) that we're using as test data for this example.
gfpSequence := "ATGGCTAGCAAAGGAGAAGAACTTTTCACTGGAGTTGTCCCAATTCTTGTTGAATTAGATGGTGATGTTAATGGGCACAAATTTTCTGTCAGTGGAGAGGGTGAAGGTGATGCTACATACGGAAAGCTTACCCTTAAATTTATTTGCACTACTGGAAAACTACCTGTTCCATGGCCAACACTTGTCACTACTTTCTCTTATGGTGTTCAATGCTTTTCCCGTTATCCGGATCATATGAAACGGCATGACTTTTTCAAGAGTGCCATGCCCGAAGGTTATGTACAGGAACGCACTATATCTTTCAAAGATGACGGGAACTACAAGACGCGTGCTGAAGTCAAGTTTGAAGGTGATACCCTTGTTAATCGTATCGAGTTAAAAGGTATTGATTTTAAAGAAGATGGAAACATTCTCGGACACAAACTCGAGTACAACTATAACTCACACAATGTATACATCACGGCAGACAAACAAAAGAATGGAATCAAAGCTAACTTCAAAATTCGCCACAACATTGAAGATGGATCCGTTCAACTAGCAGACCATTATCAACAAAATACTCCAATTGGCGATGGCCCTGTCCTTTTACCAGACAACCATTACCTGTCGACACAATCTGCCCTTTCGAAAGATCCCAACGAAAAGCGTGACCACATGGTCCTTCTTGAGTTTGTAACTGCTGCTGGGATTACACATGGCATGGATGAGCTCTACAAATAA"

// initialize sequence and feature structs.
var sequence Sequence
var feature Feature

// set the initialized sequence struct's sequence.
sequence.Sequence = gfpSequence

// Set the initialized feature name and sequence location.
feature.Name = "Green Flourescent Protein"
feature.SequenceLocation.Start = 0
feature.SequenceLocation.End = len(sequence.Sequence)

// Add the GFP feature to the sequence struct.
sequence.AddFeature(&feature)

// get the GFP feature sequence string from the sequence struct.
featureSequence := feature.GetSequence()

// check to see if the feature was inserted properly into the sequence.
fmt.Println(gfpSequence == featureSequence)
Output:

true

type Location

type Location struct {
	Start             int        `json:"start"`
	End               int        `json:"end"`
	Complement        bool       `json:"complement"`
	Join              bool       `json:"join"`
	FivePrimePartial  bool       `json:"five_prime_partial"`
	ThreePrimePartial bool       `json:"three_prime_partial"`
	SubLocations      []Location `json:"sub_locations"`
}

Location holds nested location info for sequence region.

type Locus

type Locus struct {
	Name             string `json:"name"`
	SequenceLength   string `json:"sequence_length"`
	MoleculeType     string `json:"molecule_type"`
	GenbankDivision  string `json:"genbank_division"`
	ModificationDate string `json:"modification_date"`
	SequenceCoding   string `json:"sequence_coding"`
	Circular         bool   `json:"circular"`
	Linear           bool   `json:"linear"`
}

Locus holds Locus information in a Meta struct.

type Meta

type Meta struct {
	Name        string            `json:"name"`
	GffVersion  string            `json:"gff_version"`
	RegionStart int               `json:"region_start"`
	RegionEnd   int               `json:"region_end"`
	Size        int               `json:"size"`
	Type        string            `json:"type"`
	Date        string            `json:"date"`
	Definition  string            `json:"definition"`
	Accession   string            `json:"accession"`
	Version     string            `json:"version"`
	Keywords    string            `json:"keywords"`
	Organism    string            `json:"organism"`
	Source      string            `json:"source"`
	Origin      string            `json:"origin"`
	Locus       Locus             `json:"locus"`
	References  []Reference       `json:"references"`
	Other       map[string]string `json:"other"`
}

Meta Holds all the meta information of an Sequence struct.

type Reference

type Reference struct {
	Index   string `json:"index"`
	Authors string `json:"authors"`
	Title   string `json:"title"`
	Journal string `json:"journal"`
	PubMed  string `json:"pub_med"`
	Remark  string `json:"remark"`
	Range   string `json:"range"`
}

Reference holds information one reference in a Meta struct.

type Sequence

type Sequence struct {
	Meta                 Meta      `json:"meta"`
	Description          string    `json:"description"`
	SequenceHash         string    `json:"sequence_hash"`
	SequenceHashFunction string    `json:"hash_function"`
	Sequence             string    `json:"sequence"`
	Features             []Feature `json:"features"`
}

Sequence holds all sequence information in a single struct.

func (*Sequence) AddFeature

func (sequence *Sequence) AddFeature(feature *Feature) []Feature

AddFeature is the canonical way to add a Feature into a Sequence struct. Appending a Feature struct directly to Sequence.Feature's will break .GetSequence() method.

Example
// Sequence for greenflourescent protein (GFP) that we're using as test data for this example.
gfpSequence := "ATGGCTAGCAAAGGAGAAGAACTTTTCACTGGAGTTGTCCCAATTCTTGTTGAATTAGATGGTGATGTTAATGGGCACAAATTTTCTGTCAGTGGAGAGGGTGAAGGTGATGCTACATACGGAAAGCTTACCCTTAAATTTATTTGCACTACTGGAAAACTACCTGTTCCATGGCCAACACTTGTCACTACTTTCTCTTATGGTGTTCAATGCTTTTCCCGTTATCCGGATCATATGAAACGGCATGACTTTTTCAAGAGTGCCATGCCCGAAGGTTATGTACAGGAACGCACTATATCTTTCAAAGATGACGGGAACTACAAGACGCGTGCTGAAGTCAAGTTTGAAGGTGATACCCTTGTTAATCGTATCGAGTTAAAAGGTATTGATTTTAAAGAAGATGGAAACATTCTCGGACACAAACTCGAGTACAACTATAACTCACACAATGTATACATCACGGCAGACAAACAAAAGAATGGAATCAAAGCTAACTTCAAAATTCGCCACAACATTGAAGATGGATCCGTTCAACTAGCAGACCATTATCAACAAAATACTCCAATTGGCGATGGCCCTGTCCTTTTACCAGACAACCATTACCTGTCGACACAATCTGCCCTTTCGAAAGATCCCAACGAAAAGCGTGACCACATGGTCCTTCTTGAGTTTGTAACTGCTGCTGGGATTACACATGGCATGGATGAGCTCTACAAATAA"

// initialize sequence and feature structs.
var sequence Sequence
var feature Feature

// set the initialized sequence struct's sequence.
sequence.Sequence = gfpSequence

// Set the initialized feature name and sequence location.
feature.Name = "Green Flourescent Protein"
feature.SequenceLocation.Start = 0
feature.SequenceLocation.End = len(sequence.Sequence)

// Add the GFP feature to the sequence struct.
sequence.AddFeature(&feature)

// get the GFP feature sequence string from the sequence struct.
featureSequence := feature.GetSequence()

// check to see if the feature was inserted properly into the sequence.
fmt.Println(gfpSequence == featureSequence)
Output:

true

Directories

Path Synopsis
cmd
poly
Poly command line utility installation instructions: Mac OSX brew install timothystiles/poly/poly Linux - deb/rpm Download the .deb or .rpm from the releases page https://github.com/TimothyStiles/poly/releases and install with `dpkg -i` and `rpm -i` respectively Windows Coming soon...
Poly command line utility installation instructions: Mac OSX brew install timothystiles/poly/poly Linux - deb/rpm Download the .deb or .rpm from the releases page https://github.com/TimothyStiles/poly/releases and install with `dpkg -i` and `rpm -i` respectively Windows Coming soon...
io
gff
Package secondary_structure provides the structs needed to contain information about a RNA's secondary structure Overview of the structs The struct that contains information of a RNA's secondary structure is `SecondaryStructure`.
Package secondary_structure provides the structs needed to contain information about a RNA's secondary structure Overview of the structs The struct that contains information of a RNA's secondary structure is `SecondaryStructure`.

Jump to

Keyboard shortcuts

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