transform

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package transform provides functions for transforming sequences.

Complement takes the complement of a sequence. (returns a sequence string where each nucleotide has been swapped with its complement A<->T, C<->G)

Reverse takes the reverse of a sequence. (literally just reverses a string. Exists in stdlib but hey why not have it here too?)

ReverseComplement takes the reverse complement of a sequence. (Reverses the sequence string and returns the complement of the reversed sequence.)

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Complement

func Complement(sequence string) string

Complement takes the complement of a sequence.

Example
package main

import (
	"fmt"

	"github.com/TimothyStiles/poly/transform"
)

func main() {
	sequence := "GATTACA"
	complement := transform.Complement(sequence)
	fmt.Println(complement)

}
Output:

CTAATGT

func ComplementBase

func ComplementBase(basePair rune) rune

ComplementBase accepts a base pair and returns its complement base pair

func Reverse

func Reverse(sequence string) string

Reverse takes the reverse of a sequence.

Example
package main

import (
	"fmt"

	"github.com/TimothyStiles/poly/transform"
)

func main() {
	sequence := "GATTACA"
	reverse := transform.Reverse(sequence)
	fmt.Println(reverse)

}
Output:

ACATTAG

func ReverseComplement

func ReverseComplement(sequence string) string

ReverseComplement takes the reverse complement of a sequence.

Example
package main

import (
	"fmt"

	"github.com/TimothyStiles/poly/transform"
)

func main() {
	sequence := "GATTACA"
	reverseComplement := transform.ReverseComplement(sequence)
	fmt.Println(reverseComplement)

}
Output:

TGTAATC

Types

This section is empty.

Directories

Path Synopsis
Package variants contains a function for generating all variants of a sequence.
Package variants contains a function for generating all variants of a sequence.

Jump to

Keyboard shortcuts

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