Documentation ¶
Overview ¶
Package transform provides functions for transforming sequences.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Complement ¶
Complement returns the complement of sequence. In DNA each nucleotide (A, T, C or G) is has a deterministic pair. A is paired with T and C is paired with G. The complement of a sequence is formed by exchanging these letters for their pair:
'A' becomes 'T' 'T' becomes 'A' 'C' becomes 'G' 'G' becomes 'C'
This function expects byte characters in the range a-z and A-Z and will not check for non-byte characters, i.e. utf-8 encoding.
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/transform" ) func main() { sequence := "GATTACA" complement := transform.Complement(sequence) fmt.Println(complement) }
Output: CTAATGT
func ComplementBase ¶
ComplementBase accepts a base pair and returns its complement base pair. See Complement.
This function expects byte characters in the range a-z and A-Z and will return a space ' ' (U+0020) for characters that are not matched to any known base. This is subject to change.
func ComplementBaseRNA ¶
ComplementBaseRNA accepts a RNA base pair and returns its complement base pair. See Complement.
This function expects byte characters in the range a-z and A-Z and will return a space ' ' (U+0020) for characters that are not matched to any known base. This is subject to change.
func ComplementRNA ¶
ComplementRNA returns the complement of sequence. In RNA each nucleotide (A, U, C or G) is has a deterministic pair. A is paired with U and C is paired with G. The complement of a sequence is formed by exchanging these letters for their pair:
'A' becomes 'U' 'U' becomes 'A' 'C' becomes 'G' 'G' becomes 'C'
This function expects byte characters in the range a-z and A-Z and will not check for non-byte characters, i.e. utf-8 encoding.
func Reverse ¶
Reverse returns the reverse of sequence. It performs a basic string reversal by working on the bytes.
This function expects byte characters in the range a-z and A-Z and will not check for non-byte character, i.e. utf-8 encoding.
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/transform" ) func main() { sequence := "GATTACA" reverse := transform.Reverse(sequence) fmt.Println(reverse) }
Output: ACATTAG
func ReverseComplement ¶
ReverseComplement returns the reversed complement of sequence. It is the equivalent of calling
revComplement := Reverse(Complement(sequence))
This function expects byte characters in the range a-z and A-Z and will not check for non-byte characters, i.e. utf-8 encoding.
Example ¶
package main import ( "fmt" "github.com/koeng101/dnadesign/lib/transform" ) func main() { sequence := "GATTACA" reverseComplement := transform.ReverseComplement(sequence) fmt.Println(reverseComplement) }
Output: TGTAATC
func ReverseComplementRNA ¶
ReverseComplementRNA returns the reversed complement of sequence. It is the equivalent of calling
revComplement := Reverse(ComplementRNA(sequence))
This function expects byte characters in the range a-z and A-Z and will not check for non-byte characters, i.e. utf-8 encoding.
Types ¶
This section is empty.