genomer-plugin-view 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.gitignore ADDED
@@ -0,0 +1,52 @@
1
+ # rcov generated
2
+ coverage
3
+
4
+ # rdoc generated
5
+ rdoc
6
+
7
+ # yard generated
8
+ doc
9
+ .yardoc
10
+
11
+ # bundler
12
+ .bundle
13
+
14
+ # jeweler generated
15
+ pkg
16
+
17
+ # ronn generated
18
+ man/*.[1-9]
19
+ man/*.[1-9].html
20
+
21
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
22
+ #
23
+ # * Create a file at ~/.gitignore
24
+ # * Include files you want ignored
25
+ # * Run: git config --global core.excludesfile ~/.gitignore
26
+ #
27
+ # After doing this, these files will be ignored in all your git projects,
28
+ # saving you from having to 'pollute' every project you touch with them
29
+ #
30
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
31
+ #
32
+ # For MacOS:
33
+ #
34
+ #.DS_Store
35
+
36
+ # For TextMate
37
+ #*.tmproj
38
+ #tmtags
39
+
40
+ # For emacs:
41
+ #*~
42
+ #\#*
43
+ #.\#*
44
+
45
+ # For vim:
46
+ #*.swp
47
+
48
+ # For redcar:
49
+ #.redcar
50
+
51
+ # For rubinius:
52
+ #*.rbc
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Michael Barton
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = genomer-plugin-view
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to genomer-plugin-view
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 Michael Barton. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec) do |spec|
6
+ spec.pattern = FileList['spec/**/*_spec.rb']
7
+ end
8
+
9
+ task :default => :spec
@@ -0,0 +1,285 @@
1
+ Feature: Producing an agp view of a scaffold
2
+ In order to produce submit an incomplete scaffold
3
+ A user can use the "agp" command
4
+ to generate an agp file of the scaffold
5
+
6
+ @disable-bundler
7
+ Scenario: A single contig scaffold
8
+ Given I successfully run `genomer init project`
9
+ And I cd to "project"
10
+ And I write to "assembly/scaffold.yml" with:
11
+ """
12
+ ---
13
+ -
14
+ sequence:
15
+ source: "contig00001"
16
+ """
17
+ And I write to "assembly/sequence.fna" with:
18
+ """
19
+ >contig00001
20
+ ATGGC
21
+ """
22
+ And I append to "Gemfile" with:
23
+ """
24
+ gem 'genomer-plugin-view', :path => '../../../'
25
+ """
26
+ When I run `genomer view agp`
27
+ Then the exit status should be 0
28
+ And the output should contain:
29
+ """
30
+ ##agp-version 2.0
31
+ scaffold 1 5 1 W contig00001 1 5 +
32
+ """
33
+
34
+ @disable-bundler
35
+ Scenario: A two contig scaffold
36
+ Given I successfully run `genomer init project`
37
+ And I cd to "project"
38
+ And I write to "assembly/scaffold.yml" with:
39
+ """
40
+ ---
41
+ -
42
+ sequence:
43
+ source: "contig00001"
44
+ -
45
+ sequence:
46
+ source: "contig00002"
47
+ """
48
+ And I write to "assembly/sequence.fna" with:
49
+ """
50
+ >contig00001
51
+ ATGGC
52
+ >contig00002
53
+ ATGGC
54
+ """
55
+ And I append to "Gemfile" with:
56
+ """
57
+ gem 'genomer-plugin-view', :path => '../../../'
58
+ """
59
+ When I run `genomer view agp`
60
+ Then the exit status should be 0
61
+ And the output should contain:
62
+ """
63
+ ##agp-version 2.0
64
+ scaffold 1 5 1 W contig00001 1 5 +
65
+ scaffold 6 10 2 W contig00002 1 5 +
66
+ """
67
+
68
+ @disable-bundler
69
+ Scenario: A single contig scaffold with a gap
70
+ Given I successfully run `genomer init project`
71
+ And I cd to "project"
72
+ And I write to "assembly/scaffold.yml" with:
73
+ """
74
+ ---
75
+ -
76
+ sequence:
77
+ source: "contig00001"
78
+ """
79
+ And I write to "assembly/sequence.fna" with:
80
+ """
81
+ >contig00001
82
+ ATGNNNGCG
83
+ """
84
+ And I append to "Gemfile" with:
85
+ """
86
+ gem 'genomer-plugin-view', :path => '../../../'
87
+ """
88
+ When I run `genomer view agp`
89
+ Then the exit status should be 0
90
+ And the output should contain:
91
+ """
92
+ ##agp-version 2.0
93
+ scaffold 1 3 1 W contig00001 1 3 +
94
+ scaffold 4 6 2 N 3 scaffold yes internal
95
+ scaffold 7 9 3 W contig00002 1 3 +
96
+ """
97
+
98
+ @disable-bundler
99
+ Scenario: Two contigs scaffold containing gaps
100
+ Given I successfully run `genomer init project`
101
+ And I cd to "project"
102
+ And I write to "assembly/scaffold.yml" with:
103
+ """
104
+ ---
105
+ -
106
+ sequence:
107
+ source: "contig00001"
108
+ -
109
+ sequence:
110
+ source: "contig00002"
111
+ """
112
+ And I write to "assembly/sequence.fna" with:
113
+ """
114
+ >contig00001
115
+ ATGNNNGCG
116
+ >contig00002
117
+ ANG
118
+ """
119
+ And I append to "Gemfile" with:
120
+ """
121
+ gem 'genomer-plugin-view', :path => '../../../'
122
+ """
123
+ When I run `genomer view agp`
124
+ Then the exit status should be 0
125
+ And the output should contain:
126
+ """
127
+ ##agp-version 2.0
128
+ scaffold 1 3 1 W contig00001 1 3 +
129
+ scaffold 4 6 2 N 3 scaffold yes internal
130
+ scaffold 7 9 3 W contig00002 1 3 +
131
+ scaffold 10 10 4 W contig00003 1 1 +
132
+ scaffold 11 11 5 N 1 scaffold yes internal
133
+ scaffold 12 12 6 W contig00004 1 1 +
134
+ """
135
+
136
+ @disable-bundler
137
+ Scenario: Two contigs separated by an unresolved region
138
+ Given I successfully run `genomer init project`
139
+ And I cd to "project"
140
+ And I write to "assembly/scaffold.yml" with:
141
+ """
142
+ ---
143
+ -
144
+ sequence:
145
+ source: "contig00001"
146
+ -
147
+ unresolved:
148
+ length: 5
149
+ -
150
+ sequence:
151
+ source: "contig00002"
152
+ """
153
+ And I write to "assembly/sequence.fna" with:
154
+ """
155
+ >contig00001
156
+ ATGAT
157
+ >contig00002
158
+ ATGAT
159
+ """
160
+ And I append to "Gemfile" with:
161
+ """
162
+ gem 'genomer-plugin-view', :path => '../../../'
163
+ """
164
+ When I run `genomer view agp`
165
+ Then the exit status should be 0
166
+ And the output should contain:
167
+ """
168
+ ##agp-version 2.0
169
+ scaffold 1 5 1 W contig00001 1 5 +
170
+ scaffold 6 10 2 N 5 scaffold yes specified
171
+ scaffold 11 15 3 W contig00002 1 5 +
172
+ """
173
+
174
+ @disable-bundler
175
+ Scenario: Two contigs separated by an unresolved region
176
+ Given I successfully run `genomer init project`
177
+ And I cd to "project"
178
+ And I write to "assembly/scaffold.yml" with:
179
+ """
180
+ ---
181
+ -
182
+ sequence:
183
+ source: "contig00001"
184
+ -
185
+ unresolved:
186
+ length: 5
187
+ -
188
+ sequence:
189
+ source: "contig00002"
190
+ """
191
+ And I write to "assembly/sequence.fna" with:
192
+ """
193
+ >contig00001
194
+ ATGATNNNNN
195
+ >contig00002
196
+ ATGATNNNNN
197
+ """
198
+ And I append to "Gemfile" with:
199
+ """
200
+ gem 'genomer-plugin-view', :path => '../../../'
201
+ """
202
+ When I run `genomer view agp`
203
+ Then the exit status should be 0
204
+ And the output should contain:
205
+ """
206
+ ##agp-version 2.0
207
+ scaffold 1 5 1 W contig00001 1 5 +
208
+ scaffold 6 10 2 N 5 scaffold yes internal
209
+ scaffold 11 15 3 N 5 scaffold yes specified
210
+ scaffold 16 20 4 W contig00002 1 5 +
211
+ scaffold 21 25 5 N 5 scaffold yes internal
212
+ """
213
+
214
+ @disable-bundler
215
+ Scenario: A single contig scaffold with a gap filled with an insert
216
+ Given I successfully run `genomer init project`
217
+ And I cd to "project"
218
+ And I write to "assembly/scaffold.yml" with:
219
+ """
220
+ ---
221
+ -
222
+ sequence:
223
+ source: "contig00001"
224
+ inserts:
225
+ -
226
+ source: "insert00001"
227
+ open: 4
228
+ close: 6
229
+ """
230
+ And I write to "assembly/sequence.fna" with:
231
+ """
232
+ >contig00001
233
+ ATGNNNGCG
234
+ >insert00001
235
+ TTT
236
+ """
237
+ And I append to "Gemfile" with:
238
+ """
239
+ gem 'genomer-plugin-view', :path => '../../../'
240
+ """
241
+ When I run `genomer view agp`
242
+ Then the exit status should be 0
243
+ And the output should contain:
244
+ """
245
+ ##agp-version 2.0
246
+ scaffold 1 9 1 W contig00001 1 9 +
247
+ """
248
+
249
+ @disable-bundler
250
+ Scenario: A single contig scaffold with a gap partially filled with an insert
251
+ Given I successfully run `genomer init project`
252
+ And I cd to "project"
253
+ And I write to "assembly/scaffold.yml" with:
254
+ """
255
+ ---
256
+ -
257
+ sequence:
258
+ source: "contig00001"
259
+ inserts:
260
+ -
261
+ source: "insert00001"
262
+ open: 4
263
+ close: 5
264
+ """
265
+ And I write to "assembly/sequence.fna" with:
266
+ """
267
+ >contig00001
268
+ ATGNNNGCG
269
+ >insert00001
270
+ TTT
271
+ """
272
+ And I append to "Gemfile" with:
273
+ """
274
+ gem 'genomer-plugin-view', :path => '../../../'
275
+ """
276
+ When I run `genomer view agp`
277
+ Then the exit status should be 0
278
+ And the output should contain:
279
+ """
280
+ ##agp-version 2.0
281
+ scaffold 1 6 1 W contig00001 1 6 +
282
+ scaffold 7 7 2 N 1 scaffold yes internal
283
+ scaffold 8 10 3 W contig00002 1 3 +
284
+ """
285
+
@@ -0,0 +1,173 @@
1
+ Feature: Producing a fasta view of scaffold contigs
2
+ In order to produce fasta output of the scaffold contigs
3
+ A user can use the "view" command with the "--contigs" flag
4
+ to generate the contigs in fasta format
5
+
6
+ @disable-bundler
7
+ Scenario: A single contig scaffold
8
+ Given I successfully run `genomer init project`
9
+ And I cd to "project"
10
+ And I write to "assembly/scaffold.yml" with:
11
+ """
12
+ ---
13
+ -
14
+ sequence:
15
+ source: "contig00001"
16
+ """
17
+ And I write to "assembly/sequence.fna" with:
18
+ """
19
+ >contig00001
20
+ ATGGC
21
+ """
22
+ And I append to "Gemfile" with:
23
+ """
24
+ gem 'genomer-plugin-view', :path => '../../../'
25
+ """
26
+ When I run `genomer view fasta --contigs`
27
+ Then the exit status should be 0
28
+ And the output should contain:
29
+ """
30
+ >contig00001
31
+ ATGGC
32
+ """
33
+
34
+ @disable-bundler
35
+ Scenario: A two contig scaffold generating a single sequence
36
+ Given I successfully run `genomer init project`
37
+ And I cd to "project"
38
+ And I write to "assembly/scaffold.yml" with:
39
+ """
40
+ ---
41
+ -
42
+ sequence:
43
+ source: "contig00001"
44
+ -
45
+ sequence:
46
+ source: "contig00002"
47
+ """
48
+ And I write to "assembly/sequence.fna" with:
49
+ """
50
+ >contig00001
51
+ ATGGC
52
+ >contig00002
53
+ ATGGC
54
+ """
55
+ And I append to "Gemfile" with:
56
+ """
57
+ gem 'genomer-plugin-view', :path => '../../../'
58
+ """
59
+ When I run `genomer view fasta --contigs`
60
+ Then the exit status should be 0
61
+ And the output should contain:
62
+ """
63
+ >contig00001
64
+ ATGGCATGGC
65
+ """
66
+
67
+ @disable-bundler
68
+ Scenario: A single contig scaffold containing a sequence of Ns
69
+ Given I successfully run `genomer init project`
70
+ And I cd to "project"
71
+ And I write to "assembly/scaffold.yml" with:
72
+ """
73
+ ---
74
+ -
75
+ sequence:
76
+ source: "contig00001"
77
+ """
78
+ And I write to "assembly/sequence.fna" with:
79
+ """
80
+ >contig00001
81
+ ATGGCNNNNATGGC
82
+ """
83
+ And I append to "Gemfile" with:
84
+ """
85
+ gem 'genomer-plugin-view', :path => '../../../'
86
+ """
87
+ When I run `genomer view fasta --contigs`
88
+ Then the exit status should be 0
89
+ And the output should contain:
90
+ """
91
+ >contig00001
92
+ ATGGC
93
+ >contig00002
94
+ ATGGC
95
+ """
96
+
97
+ @disable-bundler
98
+ Scenario: A two contig scaffold with an unresolved region
99
+ Given I successfully run `genomer init project`
100
+ And I cd to "project"
101
+ And I write to "assembly/scaffold.yml" with:
102
+ """
103
+ ---
104
+ -
105
+ sequence:
106
+ source: "A"
107
+ -
108
+ unresolved:
109
+ length: 10
110
+ -
111
+ sequence:
112
+ source: "B"
113
+ """
114
+ And I write to "assembly/sequence.fna" with:
115
+ """
116
+ >A
117
+ AAAAA
118
+ >B
119
+ CCCCC
120
+ """
121
+ And I append to "Gemfile" with:
122
+ """
123
+ gem 'genomer-plugin-view', :path => '../../../'
124
+ """
125
+ When I run `genomer view fasta --contigs`
126
+ Then the exit status should be 0
127
+ And the output should contain:
128
+ """
129
+ >contig00001
130
+ AAAAA
131
+ >contig00002
132
+ CCCCC
133
+ """
134
+
135
+ @disable-bundler
136
+ Scenario: A two contig scaffold with an unresolved region and gapped contig
137
+ Given I successfully run `genomer init project`
138
+ And I cd to "project"
139
+ And I write to "assembly/scaffold.yml" with:
140
+ """
141
+ ---
142
+ -
143
+ sequence:
144
+ source: "A"
145
+ -
146
+ unresolved:
147
+ length: 10
148
+ -
149
+ sequence:
150
+ source: "B"
151
+ """
152
+ And I write to "assembly/sequence.fna" with:
153
+ """
154
+ >A
155
+ AAAAA
156
+ >B
157
+ CCCNNNNTTT
158
+ """
159
+ And I append to "Gemfile" with:
160
+ """
161
+ gem 'genomer-plugin-view', :path => '../../../'
162
+ """
163
+ When I run `genomer view fasta --contigs`
164
+ Then the exit status should be 0
165
+ And the output should contain:
166
+ """
167
+ >contig00001
168
+ AAAAA
169
+ >contig00002
170
+ CCC
171
+ >contig00003
172
+ TTT
173
+ """