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 +5 -0
- data/.gitignore +52 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +9 -0
- data/features/agp/generation.feature +285 -0
- data/features/fasta/contigs.feature +173 -0
- data/features/fasta/single_sequence.feature +144 -0
- data/features/mappings/core.feature +181 -0
- data/features/support/env.rb +13 -0
- data/features/table/cds_entries.feature +304 -0
- data/features/table/core.feature +302 -0
- data/features/table/feature_type.feature +180 -0
- data/genomer-plugin-view.gemspec +34 -0
- data/lib/genomer-plugin-view/agp.rb +62 -0
- data/lib/genomer-plugin-view/fasta.rb +36 -0
- data/lib/genomer-plugin-view/gff_record_helper.rb +61 -0
- data/lib/genomer-plugin-view/mapping.rb +14 -0
- data/lib/genomer-plugin-view/table.rb +56 -0
- data/lib/genomer-plugin-view/version.rb +3 -0
- data/lib/genomer-plugin-view.rb +29 -0
- data/man/genomer-view-agp.ronn +46 -0
- data/man/genomer-view.ronn +153 -0
- data/spec/genomer-view-plugin/agp_spec.rb +79 -0
- data/spec/genomer-view-plugin/fasta_spec.rb +96 -0
- data/spec/genomer-view-plugin/gff_record_helper_spec.rb +244 -0
- data/spec/genomer-view-plugin/mapping_spec.rb +89 -0
- data/spec/genomer-view-plugin/table_spec.rb +279 -0
- data/spec/genomer-view-plugin_spec.rb +103 -0
- data/spec/spec_helper.rb +32 -0
- metadata +192 -0
@@ -0,0 +1,302 @@
|
|
1
|
+
Feature: Producing a annotation view of a scaffold
|
2
|
+
In order to submit genome annotations
|
3
|
+
A user can use the "table" command
|
4
|
+
to generate the genbank annotation table format
|
5
|
+
|
6
|
+
@disable-bundler
|
7
|
+
Scenario: Generating a table file from a single annotation
|
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
|
+
- sequence:
|
14
|
+
source: contig1
|
15
|
+
"""
|
16
|
+
And I write to "assembly/sequence.fna" with:
|
17
|
+
"""
|
18
|
+
>contig1
|
19
|
+
AAAAATTTTTGGGGGCCCCC
|
20
|
+
"""
|
21
|
+
And I write to "assembly/annotations.gff" with:
|
22
|
+
"""
|
23
|
+
##gff-version 3
|
24
|
+
contig1 . gene 1 3 . + 1 .
|
25
|
+
"""
|
26
|
+
And I append to "Gemfile" with:
|
27
|
+
"""
|
28
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
29
|
+
"""
|
30
|
+
When I run `genomer view table --identifier=genome`
|
31
|
+
Then the exit status should be 0
|
32
|
+
And the output should contain:
|
33
|
+
"""
|
34
|
+
>Feature genome annotation_table
|
35
|
+
1 3 gene
|
36
|
+
|
37
|
+
"""
|
38
|
+
|
39
|
+
@disable-bundler
|
40
|
+
Scenario: Generating a table file from two annotations
|
41
|
+
Given I successfully run `genomer init project`
|
42
|
+
And I cd to "project"
|
43
|
+
And I write to "assembly/scaffold.yml" with:
|
44
|
+
"""
|
45
|
+
---
|
46
|
+
- sequence:
|
47
|
+
source: contig1
|
48
|
+
"""
|
49
|
+
And I write to "assembly/sequence.fna" with:
|
50
|
+
"""
|
51
|
+
>contig1
|
52
|
+
AAAAATTTTTGGGGGCCCCC
|
53
|
+
"""
|
54
|
+
And I write to "assembly/annotations.gff" with:
|
55
|
+
"""
|
56
|
+
##gff-version 3
|
57
|
+
contig1 . gene 1 3 . + 1
|
58
|
+
contig1 . gene 4 6 . + 1
|
59
|
+
"""
|
60
|
+
And I append to "Gemfile" with:
|
61
|
+
"""
|
62
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
63
|
+
"""
|
64
|
+
When I run `genomer view table --identifier=genome`
|
65
|
+
Then the exit status should be 0
|
66
|
+
And the output should contain:
|
67
|
+
"""
|
68
|
+
>Feature genome annotation_table
|
69
|
+
1 3 gene
|
70
|
+
4 6 gene
|
71
|
+
|
72
|
+
"""
|
73
|
+
|
74
|
+
@disable-bundler
|
75
|
+
Scenario: Generating a table file from a gene with ID attribute
|
76
|
+
Given I successfully run `genomer init project`
|
77
|
+
And I cd to "project"
|
78
|
+
And I write to "assembly/scaffold.yml" with:
|
79
|
+
"""
|
80
|
+
---
|
81
|
+
- sequence:
|
82
|
+
source: contig1
|
83
|
+
"""
|
84
|
+
And I write to "assembly/sequence.fna" with:
|
85
|
+
"""
|
86
|
+
>contig1
|
87
|
+
AAAAATTTTTGGGGGCCCCC
|
88
|
+
"""
|
89
|
+
And I write to "assembly/annotations.gff" with:
|
90
|
+
"""
|
91
|
+
##gff-version 3
|
92
|
+
contig1 . gene 1 3 . - 1 ID=gene1
|
93
|
+
"""
|
94
|
+
And I append to "Gemfile" with:
|
95
|
+
"""
|
96
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
97
|
+
"""
|
98
|
+
When I run `genomer view table --identifier=genome`
|
99
|
+
Then the exit status should be 0
|
100
|
+
And the output should contain:
|
101
|
+
"""
|
102
|
+
>Feature genome annotation_table
|
103
|
+
3 1 gene
|
104
|
+
locus_tag gene1
|
105
|
+
|
106
|
+
"""
|
107
|
+
|
108
|
+
@disable-bundler
|
109
|
+
Scenario: Generating a table file from a gene with ID and name attributes
|
110
|
+
Given I successfully run `genomer init project`
|
111
|
+
And I cd to "project"
|
112
|
+
And I write to "assembly/scaffold.yml" with:
|
113
|
+
"""
|
114
|
+
---
|
115
|
+
- sequence:
|
116
|
+
source: contig1
|
117
|
+
"""
|
118
|
+
And I write to "assembly/sequence.fna" with:
|
119
|
+
"""
|
120
|
+
>contig1
|
121
|
+
AAAAATTTTTGGGGGCCCCC
|
122
|
+
"""
|
123
|
+
And I write to "assembly/annotations.gff" with:
|
124
|
+
"""
|
125
|
+
##gff-version 3
|
126
|
+
contig1 . gene 1 3 . - 1 ID=gene1;Name=abcd
|
127
|
+
"""
|
128
|
+
And I append to "Gemfile" with:
|
129
|
+
"""
|
130
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
131
|
+
"""
|
132
|
+
When I run `genomer view table --identifier=genome`
|
133
|
+
Then the exit status should be 0
|
134
|
+
And the output should contain:
|
135
|
+
"""
|
136
|
+
>Feature genome annotation_table
|
137
|
+
3 1 gene
|
138
|
+
locus_tag gene1
|
139
|
+
gene abcd
|
140
|
+
|
141
|
+
"""
|
142
|
+
|
143
|
+
@disable-bundler
|
144
|
+
Scenario: Reseting locus tag numbering at the scaffold origin
|
145
|
+
Given I successfully run `genomer init project`
|
146
|
+
And I cd to "project"
|
147
|
+
And I write to "assembly/scaffold.yml" with:
|
148
|
+
"""
|
149
|
+
---
|
150
|
+
- sequence:
|
151
|
+
source: contig1
|
152
|
+
"""
|
153
|
+
And I write to "assembly/sequence.fna" with:
|
154
|
+
"""
|
155
|
+
>contig1
|
156
|
+
AAAAATTTTTGGGGGCCCCC
|
157
|
+
"""
|
158
|
+
And I write to "assembly/annotations.gff" with:
|
159
|
+
"""
|
160
|
+
##gff-version 3
|
161
|
+
contig1 . gene 1 3 . + 1 ID=gene1
|
162
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
163
|
+
"""
|
164
|
+
And I append to "Gemfile" with:
|
165
|
+
"""
|
166
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
167
|
+
"""
|
168
|
+
When I run `genomer view table --identifier=genome --reset_locus_numbering`
|
169
|
+
Then the exit status should be 0
|
170
|
+
And the output should contain:
|
171
|
+
"""
|
172
|
+
>Feature genome annotation_table
|
173
|
+
1 3 gene
|
174
|
+
locus_tag 000001
|
175
|
+
4 6 gene
|
176
|
+
locus_tag 000002
|
177
|
+
|
178
|
+
"""
|
179
|
+
@disable-bundler
|
180
|
+
Scenario: Reseting locus tag numbering at specified start value
|
181
|
+
Given I successfully run `genomer init project`
|
182
|
+
And I cd to "project"
|
183
|
+
And I write to "assembly/scaffold.yml" with:
|
184
|
+
"""
|
185
|
+
---
|
186
|
+
- sequence:
|
187
|
+
source: contig1
|
188
|
+
"""
|
189
|
+
And I write to "assembly/sequence.fna" with:
|
190
|
+
"""
|
191
|
+
>contig1
|
192
|
+
AAAAATTTTTGGGGGCCCCC
|
193
|
+
"""
|
194
|
+
And I write to "assembly/annotations.gff" with:
|
195
|
+
"""
|
196
|
+
##gff-version 3
|
197
|
+
contig1 . gene 1 3 . + 1 ID=gene1
|
198
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
199
|
+
"""
|
200
|
+
And I append to "Gemfile" with:
|
201
|
+
"""
|
202
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
203
|
+
"""
|
204
|
+
When I run `genomer view table --identifier=genome --reset_locus_numbering=5`
|
205
|
+
Then the exit status should be 0
|
206
|
+
And the output should contain:
|
207
|
+
"""
|
208
|
+
>Feature genome annotation_table
|
209
|
+
1 3 gene
|
210
|
+
locus_tag 000005
|
211
|
+
4 6 gene
|
212
|
+
locus_tag 000006
|
213
|
+
|
214
|
+
"""
|
215
|
+
|
216
|
+
@disable-bundler
|
217
|
+
Scenario: Reseting locus tag at the scaffold origin with unordered annotations
|
218
|
+
Given I successfully run `genomer init project`
|
219
|
+
And I cd to "project"
|
220
|
+
And I write to "assembly/scaffold.yml" with:
|
221
|
+
"""
|
222
|
+
---
|
223
|
+
- sequence:
|
224
|
+
source: contig1
|
225
|
+
"""
|
226
|
+
And I write to "assembly/sequence.fna" with:
|
227
|
+
"""
|
228
|
+
>contig1
|
229
|
+
AAAAATTTTTGGGGGCCCCC
|
230
|
+
"""
|
231
|
+
And I write to "assembly/annotations.gff" with:
|
232
|
+
"""
|
233
|
+
##gff-version 3
|
234
|
+
contig1 . gene 10 12 . + 1 ID=gene4
|
235
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
236
|
+
contig1 . gene 1 3 . + 1 ID=gene1
|
237
|
+
contig1 . gene 7 9 . + 1 ID=gene3
|
238
|
+
"""
|
239
|
+
And I append to "Gemfile" with:
|
240
|
+
"""
|
241
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
242
|
+
"""
|
243
|
+
When I run `genomer view table --identifier=genome --reset_locus_numbering`
|
244
|
+
Then the exit status should be 0
|
245
|
+
And the output should contain:
|
246
|
+
"""
|
247
|
+
>Feature genome annotation_table
|
248
|
+
1 3 gene
|
249
|
+
locus_tag 000001
|
250
|
+
4 6 gene
|
251
|
+
locus_tag 000002
|
252
|
+
7 9 gene
|
253
|
+
locus_tag 000003
|
254
|
+
10 12 gene
|
255
|
+
locus_tag 000004
|
256
|
+
|
257
|
+
"""
|
258
|
+
|
259
|
+
@disable-bundler
|
260
|
+
Scenario: Adding a prefix to annotation locus tags
|
261
|
+
Given I successfully run `genomer init project`
|
262
|
+
And I cd to "project"
|
263
|
+
And I write to "assembly/scaffold.yml" with:
|
264
|
+
"""
|
265
|
+
---
|
266
|
+
- sequence:
|
267
|
+
source: contig1
|
268
|
+
"""
|
269
|
+
And I write to "assembly/sequence.fna" with:
|
270
|
+
"""
|
271
|
+
>contig1
|
272
|
+
AAAAATTTTTGGGGGCCCCC
|
273
|
+
"""
|
274
|
+
And I write to "assembly/annotations.gff" with:
|
275
|
+
"""
|
276
|
+
##gff-version 3
|
277
|
+
contig1 . gene 10 12 . + 1 ID=gene4
|
278
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
279
|
+
contig1 . gene 1 3 . + 1 ID=gene1
|
280
|
+
contig1 . gene 7 9 . + 1 ID=gene3
|
281
|
+
"""
|
282
|
+
And I append to "Gemfile" with:
|
283
|
+
"""
|
284
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
285
|
+
"""
|
286
|
+
When I run `genomer view table --identifier=genome --prefix=pre_`
|
287
|
+
Then the exit status should be 0
|
288
|
+
And the output should contain:
|
289
|
+
"""
|
290
|
+
>Feature genome annotation_table
|
291
|
+
1 3 gene
|
292
|
+
locus_tag pre_gene1
|
293
|
+
4 6 gene
|
294
|
+
locus_tag pre_gene2
|
295
|
+
7 9 gene
|
296
|
+
locus_tag pre_gene3
|
297
|
+
10 12 gene
|
298
|
+
locus_tag pre_gene4
|
299
|
+
|
300
|
+
"""
|
301
|
+
|
302
|
+
|
@@ -0,0 +1,180 @@
|
|
1
|
+
Feature: Producing an table view of alternate entries
|
2
|
+
In order to submit non-CDS genome annotations
|
3
|
+
A user can use the "table" command with --generate_encoded_features
|
4
|
+
to generate the genbank annotation table format with non-CDS
|
5
|
+
|
6
|
+
@disable-bundler
|
7
|
+
Scenario: Creating an unknown feature type using 'feature_type'
|
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
|
+
- sequence:
|
14
|
+
source: contig1
|
15
|
+
"""
|
16
|
+
And I write to "assembly/sequence.fna" with:
|
17
|
+
"""
|
18
|
+
>contig1
|
19
|
+
AAAAATTTTTGGGGGCCCCC
|
20
|
+
"""
|
21
|
+
And I write to "assembly/annotations.gff" with:
|
22
|
+
"""
|
23
|
+
##gff-version 3
|
24
|
+
contig1 . gene 1 3 . - 1 ID=gene1;feature_type=unknown;product=something
|
25
|
+
"""
|
26
|
+
And I append to "Gemfile" with:
|
27
|
+
"""
|
28
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
29
|
+
"""
|
30
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
31
|
+
Then the exit status should be 1
|
32
|
+
And the output should contain:
|
33
|
+
"""
|
34
|
+
Error. Unknown feature_type 'unknown'
|
35
|
+
"""
|
36
|
+
|
37
|
+
@disable-bundler
|
38
|
+
Scenario: Creating a tRNA entry from using the 'feature_type' field
|
39
|
+
Given I successfully run `genomer init project`
|
40
|
+
And I cd to "project"
|
41
|
+
And I write to "assembly/scaffold.yml" with:
|
42
|
+
"""
|
43
|
+
---
|
44
|
+
- sequence:
|
45
|
+
source: contig1
|
46
|
+
"""
|
47
|
+
And I write to "assembly/sequence.fna" with:
|
48
|
+
"""
|
49
|
+
>contig1
|
50
|
+
AAAAATTTTTGGGGGCCCCC
|
51
|
+
"""
|
52
|
+
And I write to "assembly/annotations.gff" with:
|
53
|
+
"""
|
54
|
+
##gff-version 3
|
55
|
+
contig1 . gene 1 3 . - 1 ID=gene1;feature_type=tRNA;product=tRNA-Gly;Note=something
|
56
|
+
"""
|
57
|
+
And I append to "Gemfile" with:
|
58
|
+
"""
|
59
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
60
|
+
"""
|
61
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
62
|
+
Then the exit status should be 0
|
63
|
+
And the output should contain:
|
64
|
+
"""
|
65
|
+
3 1 gene
|
66
|
+
locus_tag gene1
|
67
|
+
3 1 tRNA
|
68
|
+
product tRNA-Gly
|
69
|
+
note something
|
70
|
+
|
71
|
+
"""
|
72
|
+
|
73
|
+
@disable-bundler
|
74
|
+
Scenario: Creating a rRNA entry from using the 'feature_type' field
|
75
|
+
Given I successfully run `genomer init project`
|
76
|
+
And I cd to "project"
|
77
|
+
And I write to "assembly/scaffold.yml" with:
|
78
|
+
"""
|
79
|
+
---
|
80
|
+
- sequence:
|
81
|
+
source: contig1
|
82
|
+
"""
|
83
|
+
And I write to "assembly/sequence.fna" with:
|
84
|
+
"""
|
85
|
+
>contig1
|
86
|
+
AAAAATTTTTGGGGGCCCCC
|
87
|
+
"""
|
88
|
+
And I write to "assembly/annotations.gff" with:
|
89
|
+
"""
|
90
|
+
##gff-version 3
|
91
|
+
contig1 . gene 1 3 . - 1 ID=gene1;feature_type=rRNA;product=ribosomal RNA;Note=something
|
92
|
+
"""
|
93
|
+
And I append to "Gemfile" with:
|
94
|
+
"""
|
95
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
96
|
+
"""
|
97
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
98
|
+
Then the exit status should be 0
|
99
|
+
And the output should contain:
|
100
|
+
"""
|
101
|
+
3 1 gene
|
102
|
+
locus_tag gene1
|
103
|
+
3 1 rRNA
|
104
|
+
product ribosomal RNA
|
105
|
+
note something
|
106
|
+
|
107
|
+
"""
|
108
|
+
|
109
|
+
@disable-bundler
|
110
|
+
Scenario: Creating a tmRNA entry from using the 'feature_type' field
|
111
|
+
Given I successfully run `genomer init project`
|
112
|
+
And I cd to "project"
|
113
|
+
And I write to "assembly/scaffold.yml" with:
|
114
|
+
"""
|
115
|
+
---
|
116
|
+
- sequence:
|
117
|
+
source: contig1
|
118
|
+
"""
|
119
|
+
And I write to "assembly/sequence.fna" with:
|
120
|
+
"""
|
121
|
+
>contig1
|
122
|
+
AAAAATTTTTGGGGGCCCCC
|
123
|
+
"""
|
124
|
+
And I write to "assembly/annotations.gff" with:
|
125
|
+
"""
|
126
|
+
##gff-version 3
|
127
|
+
contig1 . gene 1 3 . - 1 ID=gene1;feature_type=tmRNA;product=tmRNA;Note=something
|
128
|
+
"""
|
129
|
+
And I append to "Gemfile" with:
|
130
|
+
"""
|
131
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
132
|
+
"""
|
133
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
134
|
+
Then the exit status should be 0
|
135
|
+
And the output should contain:
|
136
|
+
"""
|
137
|
+
3 1 gene
|
138
|
+
locus_tag gene1
|
139
|
+
3 1 tmRNA
|
140
|
+
product tmRNA
|
141
|
+
note something
|
142
|
+
|
143
|
+
"""
|
144
|
+
|
145
|
+
@disable-bundler
|
146
|
+
Scenario: Creating a miscRNA entry from using the 'feature_type' field
|
147
|
+
Given I successfully run `genomer init project`
|
148
|
+
And I cd to "project"
|
149
|
+
And I write to "assembly/scaffold.yml" with:
|
150
|
+
"""
|
151
|
+
---
|
152
|
+
- sequence:
|
153
|
+
source: contig1
|
154
|
+
"""
|
155
|
+
And I write to "assembly/sequence.fna" with:
|
156
|
+
"""
|
157
|
+
>contig1
|
158
|
+
AAAAATTTTTGGGGGCCCCC
|
159
|
+
"""
|
160
|
+
And I write to "assembly/annotations.gff" with:
|
161
|
+
"""
|
162
|
+
##gff-version 3
|
163
|
+
contig1 . gene 1 3 . - 1 ID=gene1;feature_type=miscRNA;product=RNA signal;Note=something
|
164
|
+
"""
|
165
|
+
And I append to "Gemfile" with:
|
166
|
+
"""
|
167
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
168
|
+
"""
|
169
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
170
|
+
Then the exit status should be 0
|
171
|
+
And the output should contain:
|
172
|
+
"""
|
173
|
+
3 1 gene
|
174
|
+
locus_tag gene1
|
175
|
+
3 1 miscRNA
|
176
|
+
product RNA signal
|
177
|
+
note something
|
178
|
+
|
179
|
+
"""
|
180
|
+
|