9 type tilelibSuite struct{}
11 var _ = check.Suite(&tilelibSuite{})
13 func (s *tilelibSuite) TestSkipOOO(c *check.C) {
15 err := taglib.Load(bytes.NewBufferString(`>0000.00
16 ggagaactgtgctccgccttcaga
17 acacatgctagcgcgtcggggtgg
18 gactctagcagagtggccagccac
19 cctcccgagccgagccacccgtca
20 gttattaataataacttatcatca
22 c.Assert(err, check.IsNil)
24 // tags appear in seq: 4, 0, 2 (but skipOOO is false)
25 tilelib := &tileLibrary{taglib: &taglib, skipOOO: false}
26 tseq, err := tilelib.TileFasta("test-label", bytes.NewBufferString(`>test-seq
27 gttattaataataacttatcatca
28 ggggggggggggggggggggggg
29 ggagaactgtgctccgccttcaga
31 gactctagcagagtggccagccac
33 c.Assert(err, check.IsNil)
34 c.Check(tseq, check.DeepEquals, tileSeq{"test-seq": []tileLibRef{{4, 1}, {0, 1}, {2, 1}}})
36 // tags appear in seq: 0, 1, 2 -> don't skip
37 tilelib = &tileLibrary{taglib: &taglib, skipOOO: true}
38 tseq, err = tilelib.TileFasta("test-label", bytes.NewBufferString(`>test-seq
39 ggagaactgtgctccgccttcaga
41 acacatgctagcgcgtcggggtgg
42 ggggggggggggggggggggggg
43 gactctagcagagtggccagccac
45 c.Assert(err, check.IsNil)
46 c.Check(tseq, check.DeepEquals, tileSeq{"test-seq": []tileLibRef{{0, 1}, {1, 1}, {2, 1}}})
48 // tags appear in seq: 2, 3, 4 -> don't skip
49 tilelib = &tileLibrary{taglib: &taglib, skipOOO: true}
50 tseq, err = tilelib.TileFasta("test-label", bytes.NewBufferString(`>test-seq
51 gactctagcagagtggccagccac
53 cctcccgagccgagccacccgtca
54 ggggggggggggggggggggggg
55 gttattaataataacttatcatca
57 c.Assert(err, check.IsNil)
58 c.Check(tseq, check.DeepEquals, tileSeq{"test-seq": []tileLibRef{{2, 1}, {3, 1}, {4, 1}}})
60 // tags appear in seq: 4, 0, 2 -> skip 4
61 tilelib = &tileLibrary{taglib: &taglib, skipOOO: true}
62 tseq, err = tilelib.TileFasta("test-label", bytes.NewBufferString(`>test-seq
63 gttattaataataacttatcatca
65 ggagaactgtgctccgccttcaga
66 ggggggggggggggggggggggg
67 gactctagcagagtggccagccac
69 c.Assert(err, check.IsNil)
70 c.Check(tseq, check.DeepEquals, tileSeq{"test-seq": []tileLibRef{{0, 1}, {2, 1}}})
72 // tags appear in seq: 0, 2, 1 -> skip 2
73 tilelib = &tileLibrary{taglib: &taglib, skipOOO: true}
74 tseq, err = tilelib.TileFasta("test-label", bytes.NewBufferString(`>test-seq
75 ggagaactgtgctccgccttcaga
77 gactctagcagagtggccagccac
78 ggggggggggggggggggggggg
79 acacatgctagcgcgtcggggtgg
81 c.Assert(err, check.IsNil)
82 c.Check(tseq, check.DeepEquals, tileSeq{"test-seq": []tileLibRef{{0, 1}, {1, 1}}})
84 // tags appear in seq: 0, 1, 1, 2 -> skip second tag1
85 tilelib = &tileLibrary{taglib: &taglib, skipOOO: true}
86 tseq, err = tilelib.TileFasta("test-label", bytes.NewBufferString(`>test-seq
87 ggagaactgtgctccgccttcaga
89 acacatgctagcgcgtcggggtgg
90 ggggggggggggggggggggggg
91 acacatgctagcgcgtcggggtgg
92 ggggggggggggggggggggggg
93 gactctagcagagtggccagccac
95 c.Assert(err, check.IsNil)
96 c.Check(tseq, check.DeepEquals, tileSeq{"test-seq": []tileLibRef{{0, 1}, {1, 1}, {2, 1}}})
98 // tags appear in seq: 0, 1, 3 -> don't skip
99 tilelib = &tileLibrary{taglib: &taglib, skipOOO: true}
100 tseq, err = tilelib.TileFasta("test-label", bytes.NewBufferString(`>test-seq
101 ggagaactgtgctccgccttcaga
103 acacatgctagcgcgtcggggtgg
104 ggggggggggggggggggggggg
105 cctcccgagccgagccacccgtca
107 c.Assert(err, check.IsNil)
108 c.Check(tseq, check.DeepEquals, tileSeq{"test-seq": []tileLibRef{{0, 1}, {1, 1}, {3, 1}}})