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,144 @@
|
|
1
|
+
Feature: Producing a fasta view of a scaffold
|
2
|
+
In order to produce fasta output from a scaffold
|
3
|
+
A user can use the "view" command
|
4
|
+
to generate the required fasta output
|
5
|
+
|
6
|
+
@disable-bundler
|
7
|
+
Scenario: Generating simple fasta
|
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`
|
27
|
+
Then the exit status should be 0
|
28
|
+
And the output should contain:
|
29
|
+
"""
|
30
|
+
>.
|
31
|
+
ATGGC
|
32
|
+
"""
|
33
|
+
|
34
|
+
@disable-bundler
|
35
|
+
Scenario: Generating simple fasta with a sequence identifier
|
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
|
+
And I write to "assembly/sequence.fna" with:
|
46
|
+
"""
|
47
|
+
>contig00001
|
48
|
+
ATGGC
|
49
|
+
"""
|
50
|
+
And I append to "Gemfile" with:
|
51
|
+
"""
|
52
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
53
|
+
"""
|
54
|
+
When I run `genomer view fasta --identifier=scaffold`
|
55
|
+
Then the exit status should be 0
|
56
|
+
And the output should contain:
|
57
|
+
"""
|
58
|
+
>scaffold
|
59
|
+
ATGGC
|
60
|
+
"""
|
61
|
+
|
62
|
+
@disable-bundler
|
63
|
+
Scenario: Generating fasta with a organism name modifier
|
64
|
+
Given I successfully run `genomer init project`
|
65
|
+
And I cd to "project"
|
66
|
+
And I write to "assembly/scaffold.yml" with:
|
67
|
+
"""
|
68
|
+
---
|
69
|
+
-
|
70
|
+
sequence:
|
71
|
+
source: "contig00001"
|
72
|
+
"""
|
73
|
+
And I write to "assembly/sequence.fna" with:
|
74
|
+
"""
|
75
|
+
>contig00001
|
76
|
+
ATGGC
|
77
|
+
"""
|
78
|
+
And I append to "Gemfile" with:
|
79
|
+
"""
|
80
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
81
|
+
"""
|
82
|
+
When I run `genomer view fasta --organism='genus species'`
|
83
|
+
Then the exit status should be 0
|
84
|
+
And the output should contain:
|
85
|
+
"""
|
86
|
+
>. [organism=genus species]
|
87
|
+
ATGGC
|
88
|
+
"""
|
89
|
+
|
90
|
+
@disable-bundler
|
91
|
+
Scenario: Generating fasta with a strain modifier
|
92
|
+
Given I successfully run `genomer init project`
|
93
|
+
And I cd to "project"
|
94
|
+
And I write to "assembly/scaffold.yml" with:
|
95
|
+
"""
|
96
|
+
---
|
97
|
+
-
|
98
|
+
sequence:
|
99
|
+
source: "contig00001"
|
100
|
+
"""
|
101
|
+
And I write to "assembly/sequence.fna" with:
|
102
|
+
"""
|
103
|
+
>contig00001
|
104
|
+
ATGGC
|
105
|
+
"""
|
106
|
+
And I append to "Gemfile" with:
|
107
|
+
"""
|
108
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
109
|
+
"""
|
110
|
+
When I run `genomer view fasta --strain=strain_name`
|
111
|
+
Then the exit status should be 0
|
112
|
+
And the output should contain:
|
113
|
+
"""
|
114
|
+
>. [strain=strain_name]
|
115
|
+
ATGGC
|
116
|
+
"""
|
117
|
+
|
118
|
+
@disable-bundler
|
119
|
+
Scenario: Generating fasta with identifier and strain modifier
|
120
|
+
Given I successfully run `genomer init project`
|
121
|
+
And I cd to "project"
|
122
|
+
And I write to "assembly/scaffold.yml" with:
|
123
|
+
"""
|
124
|
+
---
|
125
|
+
-
|
126
|
+
sequence:
|
127
|
+
source: "contig00001"
|
128
|
+
"""
|
129
|
+
And I write to "assembly/sequence.fna" with:
|
130
|
+
"""
|
131
|
+
>contig00001
|
132
|
+
ATGGC
|
133
|
+
"""
|
134
|
+
And I append to "Gemfile" with:
|
135
|
+
"""
|
136
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
137
|
+
"""
|
138
|
+
When I run `genomer view fasta --strain=strain_name --identifier=name`
|
139
|
+
Then the exit status should be 0
|
140
|
+
And the output should contain:
|
141
|
+
"""
|
142
|
+
>name [strain=strain_name]
|
143
|
+
ATGGC
|
144
|
+
"""
|
@@ -0,0 +1,181 @@
|
|
1
|
+
Feature: Producing a map of annotations IDs
|
2
|
+
In order to use map annotation IDs between versions
|
3
|
+
A user can use the "mapping" command
|
4
|
+
to generate a list of the original and updated annotations
|
5
|
+
|
6
|
+
@disable-bundler
|
7
|
+
Scenario: Two genes with locus tag numbering reset at the scaffold origin
|
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
|
25
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
26
|
+
"""
|
27
|
+
And I append to "Gemfile" with:
|
28
|
+
"""
|
29
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
30
|
+
"""
|
31
|
+
When I run `genomer view mapping --reset_locus_numbering`
|
32
|
+
Then the exit status should be 0
|
33
|
+
And the output should contain:
|
34
|
+
"""
|
35
|
+
gene1 000001
|
36
|
+
gene2 000002
|
37
|
+
"""
|
38
|
+
|
39
|
+
@disable-bundler
|
40
|
+
Scenario: Two genes with locus tag numbering reset at specified start value
|
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 ID=gene1
|
58
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
59
|
+
"""
|
60
|
+
And I append to "Gemfile" with:
|
61
|
+
"""
|
62
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
63
|
+
"""
|
64
|
+
When I run `genomer view mapping --reset_locus_numbering=5`
|
65
|
+
Then the exit status should be 0
|
66
|
+
And the output should contain:
|
67
|
+
"""
|
68
|
+
gene1 000005
|
69
|
+
gene2 000006
|
70
|
+
"""
|
71
|
+
|
72
|
+
@disable-bundler
|
73
|
+
Scenario: Four unordered genes with locus tag reset at the scaffold origin
|
74
|
+
Given I successfully run `genomer init project`
|
75
|
+
And I cd to "project"
|
76
|
+
And I write to "assembly/scaffold.yml" with:
|
77
|
+
"""
|
78
|
+
---
|
79
|
+
- sequence:
|
80
|
+
source: contig1
|
81
|
+
"""
|
82
|
+
And I write to "assembly/sequence.fna" with:
|
83
|
+
"""
|
84
|
+
>contig1
|
85
|
+
AAAAATTTTTGGGGGCCCCC
|
86
|
+
"""
|
87
|
+
And I write to "assembly/annotations.gff" with:
|
88
|
+
"""
|
89
|
+
##gff-version 3
|
90
|
+
contig1 . gene 10 12 . + 1 ID=gene4
|
91
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
92
|
+
contig1 . gene 1 3 . + 1 ID=gene1
|
93
|
+
contig1 . gene 7 9 . + 1 ID=gene3
|
94
|
+
"""
|
95
|
+
And I append to "Gemfile" with:
|
96
|
+
"""
|
97
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
98
|
+
"""
|
99
|
+
When I run `genomer view mapping --reset_locus_numbering`
|
100
|
+
Then the exit status should be 0
|
101
|
+
And the output should contain:
|
102
|
+
"""
|
103
|
+
gene1 000001
|
104
|
+
gene2 000002
|
105
|
+
gene3 000003
|
106
|
+
gene4 000004
|
107
|
+
"""
|
108
|
+
|
109
|
+
@disable-bundler
|
110
|
+
Scenario: Four genes with a prefix added to the locus tags
|
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 10 12 . + 1 ID=gene4
|
128
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
129
|
+
contig1 . gene 1 3 . + 1 ID=gene1
|
130
|
+
contig1 . gene 7 9 . + 1 ID=gene3
|
131
|
+
"""
|
132
|
+
And I append to "Gemfile" with:
|
133
|
+
"""
|
134
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
135
|
+
"""
|
136
|
+
When I run `genomer view mapping --prefix=pre_`
|
137
|
+
Then the exit status should be 0
|
138
|
+
And the output should contain:
|
139
|
+
"""
|
140
|
+
gene1 pre_gene1
|
141
|
+
gene2 pre_gene2
|
142
|
+
gene3 pre_gene3
|
143
|
+
gene4 pre_gene4
|
144
|
+
"""
|
145
|
+
|
146
|
+
@disable-bundler
|
147
|
+
Scenario: Four genes prefixes and locus tag reset at the scaffold origin
|
148
|
+
Given I successfully run `genomer init project`
|
149
|
+
And I cd to "project"
|
150
|
+
And I write to "assembly/scaffold.yml" with:
|
151
|
+
"""
|
152
|
+
---
|
153
|
+
- sequence:
|
154
|
+
source: contig1
|
155
|
+
"""
|
156
|
+
And I write to "assembly/sequence.fna" with:
|
157
|
+
"""
|
158
|
+
>contig1
|
159
|
+
AAAAATTTTTGGGGGCCCCC
|
160
|
+
"""
|
161
|
+
And I write to "assembly/annotations.gff" with:
|
162
|
+
"""
|
163
|
+
##gff-version 3
|
164
|
+
contig1 . gene 10 12 . + 1 ID=gene4
|
165
|
+
contig1 . gene 4 6 . + 1 ID=gene2
|
166
|
+
contig1 . gene 1 3 . + 1 ID=gene1
|
167
|
+
contig1 . gene 7 9 . + 1 ID=gene3
|
168
|
+
"""
|
169
|
+
And I append to "Gemfile" with:
|
170
|
+
"""
|
171
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
172
|
+
"""
|
173
|
+
When I run `genomer view mapping --reset_locus_numbering=5 --prefix=pre_`
|
174
|
+
Then the exit status should be 0
|
175
|
+
And the output should contain:
|
176
|
+
"""
|
177
|
+
gene1 pre_000005
|
178
|
+
gene2 pre_000006
|
179
|
+
gene3 pre_000007
|
180
|
+
gene4 pre_000008
|
181
|
+
"""
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
begin
|
3
|
+
Bundler.setup(:default, :development)
|
4
|
+
rescue Bundler::BundlerError => e
|
5
|
+
$stderr.puts e.message
|
6
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
7
|
+
exit e.status_code
|
8
|
+
end
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
|
11
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../spec')
|
12
|
+
|
13
|
+
require 'aruba/cucumber'
|
@@ -0,0 +1,304 @@
|
|
1
|
+
Feature: Producing cds annotation view from a scaffold
|
2
|
+
In order to submit CDS genome annotations
|
3
|
+
A user can use the "table" command with --generate_encoded_features
|
4
|
+
to generate the genbank annotation table format with CDS
|
5
|
+
|
6
|
+
@disable-bundler
|
7
|
+
Scenario: A CDS entry with no attributes
|
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 --generate_encoded_features`
|
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
|
+
1 3 CDS
|
37
|
+
|
38
|
+
"""
|
39
|
+
|
40
|
+
@disable-bundler
|
41
|
+
Scenario: A CDS entry with a prefixed ID
|
42
|
+
Given I successfully run `genomer init project`
|
43
|
+
And I cd to "project"
|
44
|
+
And I write to "assembly/scaffold.yml" with:
|
45
|
+
"""
|
46
|
+
---
|
47
|
+
- sequence:
|
48
|
+
source: contig1
|
49
|
+
"""
|
50
|
+
And I write to "assembly/sequence.fna" with:
|
51
|
+
"""
|
52
|
+
>contig1
|
53
|
+
AAAAATTTTTGGGGGCCCCC
|
54
|
+
"""
|
55
|
+
And I write to "assembly/annotations.gff" with:
|
56
|
+
"""
|
57
|
+
##gff-version 3
|
58
|
+
contig1 . gene 1 3 . - 1 ID=gene1
|
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 --generate_encoded_features=pre_`
|
65
|
+
Then the exit status should be 0
|
66
|
+
And the output should contain:
|
67
|
+
"""
|
68
|
+
>Feature genome annotation_table
|
69
|
+
3 1 gene
|
70
|
+
locus_tag gene1
|
71
|
+
3 1 CDS
|
72
|
+
protein_id pre_gene1
|
73
|
+
|
74
|
+
"""
|
75
|
+
|
76
|
+
@disable-bundler
|
77
|
+
Scenario: A CDS entry with a Name attribute
|
78
|
+
Given I successfully run `genomer init project`
|
79
|
+
And I cd to "project"
|
80
|
+
And I write to "assembly/scaffold.yml" with:
|
81
|
+
"""
|
82
|
+
---
|
83
|
+
- sequence:
|
84
|
+
source: contig1
|
85
|
+
"""
|
86
|
+
And I write to "assembly/sequence.fna" with:
|
87
|
+
"""
|
88
|
+
>contig1
|
89
|
+
AAAAATTTTTGGGGGCCCCC
|
90
|
+
"""
|
91
|
+
And I write to "assembly/annotations.gff" with:
|
92
|
+
"""
|
93
|
+
##gff-version 3
|
94
|
+
contig1 . gene 4 6 . + 1 ID=gene2;Name=defg
|
95
|
+
"""
|
96
|
+
And I append to "Gemfile" with:
|
97
|
+
"""
|
98
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
99
|
+
"""
|
100
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
101
|
+
Then the exit status should be 0
|
102
|
+
And the output should contain:
|
103
|
+
"""
|
104
|
+
>Feature genome annotation_table
|
105
|
+
4 6 gene
|
106
|
+
locus_tag gene2
|
107
|
+
gene defg
|
108
|
+
4 6 CDS
|
109
|
+
protein_id gene2
|
110
|
+
product Defg
|
111
|
+
|
112
|
+
"""
|
113
|
+
|
114
|
+
@disable-bundler
|
115
|
+
Scenario: A CDS entry with a product attribute
|
116
|
+
Given I successfully run `genomer init project`
|
117
|
+
And I cd to "project"
|
118
|
+
And I write to "assembly/scaffold.yml" with:
|
119
|
+
"""
|
120
|
+
---
|
121
|
+
- sequence:
|
122
|
+
source: contig1
|
123
|
+
"""
|
124
|
+
And I write to "assembly/sequence.fna" with:
|
125
|
+
"""
|
126
|
+
>contig1
|
127
|
+
AAAAATTTTTGGGGGCCCCC
|
128
|
+
"""
|
129
|
+
And I write to "assembly/annotations.gff" with:
|
130
|
+
"""
|
131
|
+
##gff-version 3
|
132
|
+
contig1 . gene 4 6 . + 1 ID=gene2;product=defg
|
133
|
+
"""
|
134
|
+
And I append to "Gemfile" with:
|
135
|
+
"""
|
136
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
137
|
+
"""
|
138
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
139
|
+
Then the exit status should be 0
|
140
|
+
And the output should contain:
|
141
|
+
"""
|
142
|
+
>Feature genome annotation_table
|
143
|
+
4 6 gene
|
144
|
+
locus_tag gene2
|
145
|
+
4 6 CDS
|
146
|
+
protein_id gene2
|
147
|
+
product defg
|
148
|
+
|
149
|
+
"""
|
150
|
+
|
151
|
+
@disable-bundler
|
152
|
+
Scenario: A CDS entry with Name and product attributes
|
153
|
+
Given I successfully run `genomer init project`
|
154
|
+
And I cd to "project"
|
155
|
+
And I write to "assembly/scaffold.yml" with:
|
156
|
+
"""
|
157
|
+
---
|
158
|
+
- sequence:
|
159
|
+
source: contig1
|
160
|
+
"""
|
161
|
+
And I write to "assembly/sequence.fna" with:
|
162
|
+
"""
|
163
|
+
>contig1
|
164
|
+
AAAAATTTTTGGGGGCCCCC
|
165
|
+
"""
|
166
|
+
And I write to "assembly/annotations.gff" with:
|
167
|
+
"""
|
168
|
+
##gff-version 3
|
169
|
+
contig1 . gene 4 6 . + 1 ID=gene2;Name=defg;product=xyz
|
170
|
+
"""
|
171
|
+
And I append to "Gemfile" with:
|
172
|
+
"""
|
173
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
174
|
+
"""
|
175
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
176
|
+
Then the exit status should be 0
|
177
|
+
And the output should contain:
|
178
|
+
"""
|
179
|
+
>Feature genome annotation_table
|
180
|
+
4 6 gene
|
181
|
+
locus_tag gene2
|
182
|
+
gene defg
|
183
|
+
4 6 CDS
|
184
|
+
protein_id gene2
|
185
|
+
product Defg
|
186
|
+
function xyz
|
187
|
+
|
188
|
+
"""
|
189
|
+
|
190
|
+
@disable-bundler
|
191
|
+
Scenario: A CDS entry with product and function attributes
|
192
|
+
Given I successfully run `genomer init project`
|
193
|
+
And I cd to "project"
|
194
|
+
And I write to "assembly/scaffold.yml" with:
|
195
|
+
"""
|
196
|
+
---
|
197
|
+
- sequence:
|
198
|
+
source: contig1
|
199
|
+
"""
|
200
|
+
And I write to "assembly/sequence.fna" with:
|
201
|
+
"""
|
202
|
+
>contig1
|
203
|
+
AAAAATTTTTGGGGGCCCCC
|
204
|
+
"""
|
205
|
+
And I write to "assembly/annotations.gff" with:
|
206
|
+
"""
|
207
|
+
##gff-version 3
|
208
|
+
contig1 . gene 4 6 . + 1 ID=gene2;product=defg;function=xyz
|
209
|
+
"""
|
210
|
+
And I append to "Gemfile" with:
|
211
|
+
"""
|
212
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
213
|
+
"""
|
214
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
215
|
+
Then the exit status should be 0
|
216
|
+
And the output should contain:
|
217
|
+
"""
|
218
|
+
>Feature genome annotation_table
|
219
|
+
4 6 gene
|
220
|
+
locus_tag gene2
|
221
|
+
4 6 CDS
|
222
|
+
protein_id gene2
|
223
|
+
product defg
|
224
|
+
function xyz
|
225
|
+
|
226
|
+
"""
|
227
|
+
|
228
|
+
@disable-bundler
|
229
|
+
Scenario: A CDS entry with Name, product and function attributes
|
230
|
+
Given I successfully run `genomer init project`
|
231
|
+
And I cd to "project"
|
232
|
+
And I write to "assembly/scaffold.yml" with:
|
233
|
+
"""
|
234
|
+
---
|
235
|
+
- sequence:
|
236
|
+
source: contig1
|
237
|
+
"""
|
238
|
+
And I write to "assembly/sequence.fna" with:
|
239
|
+
"""
|
240
|
+
>contig1
|
241
|
+
AAAAATTTTTGGGGGCCCCC
|
242
|
+
"""
|
243
|
+
And I write to "assembly/annotations.gff" with:
|
244
|
+
"""
|
245
|
+
##gff-version 3
|
246
|
+
contig1 . gene 4 6 . + 1 ID=gene2;Name=abcd;product=efgh;function=ijkl
|
247
|
+
"""
|
248
|
+
And I append to "Gemfile" with:
|
249
|
+
"""
|
250
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
251
|
+
"""
|
252
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
253
|
+
Then the exit status should be 0
|
254
|
+
And the output should contain:
|
255
|
+
"""
|
256
|
+
>Feature genome annotation_table
|
257
|
+
4 6 gene
|
258
|
+
locus_tag gene2
|
259
|
+
gene abcd
|
260
|
+
4 6 CDS
|
261
|
+
protein_id gene2
|
262
|
+
product Abcd
|
263
|
+
function efgh
|
264
|
+
|
265
|
+
"""
|
266
|
+
|
267
|
+
@disable-bundler
|
268
|
+
Scenario: A CDS entry with ec_number and note attributes
|
269
|
+
Given I successfully run `genomer init project`
|
270
|
+
And I cd to "project"
|
271
|
+
And I write to "assembly/scaffold.yml" with:
|
272
|
+
"""
|
273
|
+
---
|
274
|
+
- sequence:
|
275
|
+
source: contig1
|
276
|
+
"""
|
277
|
+
And I write to "assembly/sequence.fna" with:
|
278
|
+
"""
|
279
|
+
>contig1
|
280
|
+
AAAAATTTTTGGGGGCCCCC
|
281
|
+
"""
|
282
|
+
And I write to "assembly/annotations.gff" with:
|
283
|
+
"""
|
284
|
+
##gff-version 3
|
285
|
+
contig1 . gene 1 3 . - 1 ID=gene1;ec_number=3.5.2.3;Note=my protein
|
286
|
+
"""
|
287
|
+
And I append to "Gemfile" with:
|
288
|
+
"""
|
289
|
+
gem 'genomer-plugin-view', :path => '../../../'
|
290
|
+
"""
|
291
|
+
When I run `genomer view table --identifier=genome --generate_encoded_features`
|
292
|
+
Then the exit status should be 0
|
293
|
+
And the output should contain:
|
294
|
+
"""
|
295
|
+
>Feature genome annotation_table
|
296
|
+
3 1 gene
|
297
|
+
locus_tag gene1
|
298
|
+
3 1 CDS
|
299
|
+
protein_id gene1
|
300
|
+
EC_number 3.5.2.3
|
301
|
+
note my protein
|
302
|
+
|
303
|
+
"""
|
304
|
+
|