Documentation ¶
Overview ¶
Package poly is a go package for engineering organisms.
Poly can be used in two ways.
- As a Go library where you have finer control and can make magical things happen.
- 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 ¶
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 ¶
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
|
|
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`. |