seqhash

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(sequence string, sequenceType string, circular bool, doubleStranded bool) (string, error)

Hash is a function to create Seqhashes, a specific kind of identifier.

Example
sequence := genbank.Read("../data/puc19.gbk")

seqhash, _ := Hash(sequence.Sequence, "DNA", true, true)
fmt.Println(seqhash)
Output:

v1_DCD_4b0616d1b3fc632e42d78521deb38b44fba95cca9fde159e01cd567fa996ceb9

func RotateSequence

func RotateSequence(sequence string) string

RotateSequence rotates circular sequences to deterministic point.

Example
sequence := genbank.Read("../data/puc19.gbk")
sequenceLength := len(sequence.Sequence)
testSequence := sequence.Sequence[sequenceLength/2:] + sequence.Sequence[0:sequenceLength/2]

fmt.Println(RotateSequence(sequence.Sequence) == RotateSequence(testSequence))
Output:

true

Types

This section is empty.

Jump to

Keyboard shortcuts

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