Debian Codegraph @

alphabet/example_test.go

raw
1 // Copyright ©2011-2013 The bíogo Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package alphabet
6
7 import (
8 "fmt"
9 )
10
11 func Example_allValid() {
12 fmt.Println(DNA.AllValid([]Letter("acgatcgatatagctatnagcatgc")))
13 // Output:
14 // false 17
15 }
16
17 func Example_complement() {
18 var (
19 c Letter
20 ok bool
21 )
22
23 c, ok = DNA.Complement('a')
24 fmt.Printf("%c %v\n", c, ok)
25 c, ok = DNA.Complement('n')
26 fmt.Printf("%c %v\n", c, ok)
27 c, ok = RNA.Complement('a')
28 fmt.Printf("%c %v\n", c, ok)
29 c, ok = RNA.Complement('t')
30 fmt.Printf("%c %v\n", c, ok)
31 // Output:
32 // t true
33 // n true
34 // u true
35 // t false
36 }