scaffolder-tools 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -1
- data/.travis.yml +4 -0
- data/Gemfile +1 -3
- data/README.rdoc +6 -4
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/features/error_checking.feature +137 -0
- data/features/sequence.feature +30 -73
- data/features/step_definitions/scaffolder-tools.rb +5 -1
- data/features/validate.feature +12 -78
- data/lib/scaffolder/tool/sequence.rb +10 -8
- data/lib/scaffolder/tool_index.rb +0 -7
- data/man/scaffolder-format.7.ronn +127 -0
- data/man/scaffolder-sequence.1.ronn +3 -5
- data/scaffolder-tools.gemspec +16 -30
- data/spec/scaffolder/binary_helper_spec.rb +1 -1
- data/spec/scaffolder/tool/help_spec.rb +64 -74
- data/spec/scaffolder/tool/sequence_spec.rb +55 -16
- data/spec/scaffolder/tool/validate_spec.rb +5 -5
- data/spec/scaffolder/tool_index_spec.rb +1 -1
- data/spec/scaffolder/tool_spec.rb +12 -21
- data/spec/spec_helper.rb +15 -9
- data/spec/support/exit_code_matcher.rb +2 -2
- metadata +120 -214
data/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--color
|
1
|
+
--color --format=progress
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -10,14 +10,12 @@ end
|
|
10
10
|
group :development do
|
11
11
|
gem "bundler", "~> 1.0"
|
12
12
|
gem "jeweler", "~> 1.5"
|
13
|
-
gem "gherkin", "~> 2.3.3"
|
14
13
|
gem "rspec", "~> 2.4"
|
15
14
|
gem "cucumber", "~> 0.10"
|
16
15
|
gem "fakefs", "~> 0.2"
|
17
16
|
gem "aruba", "~> 0.2"
|
18
17
|
gem "mocha", "~> 0.9"
|
19
|
-
gem "hashie", "~> 0.4"
|
20
18
|
gem "yard", "~> 0.6"
|
21
19
|
|
22
|
-
gem "scaffolder-test-helpers", "~> 0.
|
20
|
+
gem "scaffolder-test-helpers", "~> 0.4"
|
23
21
|
end
|
data/README.rdoc
CHANGED
@@ -27,10 +27,12 @@ A unix man page is available for each scaffolder command by typing:
|
|
27
27
|
|
28
28
|
== Contact
|
29
29
|
|
30
|
-
Scaffolder was developed by Michael Barton (
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
Scaffolder was developed by Michael Barton (www.michaelbarton.me.uk). The
|
31
|
+
website for scaffolder is at http://next.gs and a {twitter feed for
|
32
|
+
updates}[http://twitter.com/nxtgs] is available. There is a {Google
|
33
|
+
group}[http://groups.google.com/group/scaffolder] for questions and comments.
|
34
|
+
The source code is available on github[http://github.com/scaffolder]. Bug
|
35
|
+
reports and feature requests may also be made there.
|
34
36
|
|
35
37
|
== Copyright
|
36
38
|
|
data/Rakefile
CHANGED
@@ -14,10 +14,11 @@ Jeweler::Tasks.new do |gem|
|
|
14
14
|
gem.name = "scaffolder-tools"
|
15
15
|
gem.summary = "Tools for manipulating genome scaffolds"
|
16
16
|
gem.description = "Binary to use with scaffolder genome scaffolds"
|
17
|
-
gem.email = "mail@
|
18
|
-
gem.homepage = "http://
|
17
|
+
gem.email = "mail@next.gs"
|
18
|
+
gem.homepage = "http://next.gs"
|
19
19
|
gem.authors = ["Michael Barton"]
|
20
20
|
gem.license = "MIT"
|
21
|
+
gem.test_files = Dir['spec/**/*.rb']
|
21
22
|
end
|
22
23
|
Jeweler::RubygemsDotOrgTasks.new
|
23
24
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
@@ -0,0 +1,137 @@
|
|
1
|
+
Feature: Error checking command line arguments
|
2
|
+
In order to recoginise incorrect input
|
3
|
+
A user should be able to use the binaries with incorrect inputs
|
4
|
+
and be given clear error messages
|
5
|
+
|
6
|
+
|
7
|
+
Scenario: Using sequence where the sequence file specified does not exist
|
8
|
+
Given a file named "scaffold.yml" with:
|
9
|
+
"""
|
10
|
+
---
|
11
|
+
-
|
12
|
+
sequence:
|
13
|
+
source: "seq"
|
14
|
+
"""
|
15
|
+
When I call "scaffolder" with arguments "sequence scaffold.yml missing_file"
|
16
|
+
Then the exit status should be 1
|
17
|
+
And the stderr should contain "Error. Sequence file not found:"
|
18
|
+
|
19
|
+
Scenario: Using sequence where the sequence file doesn't contain any thing
|
20
|
+
Given an empty file named "sequence.fna"
|
21
|
+
Given a file named "scaffold.yml" with:
|
22
|
+
"""
|
23
|
+
---
|
24
|
+
-
|
25
|
+
sequence:
|
26
|
+
source: "seq1"
|
27
|
+
"""
|
28
|
+
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna"
|
29
|
+
Then the exit status should be 1
|
30
|
+
And the stderr should contain "Error. Sequence file is empty"
|
31
|
+
|
32
|
+
Scenario: Using sequence where the scaffold file specified does not exist
|
33
|
+
Given a file named "sequence.fna" with:
|
34
|
+
"""
|
35
|
+
>seq
|
36
|
+
ATGGC
|
37
|
+
"""
|
38
|
+
When I call "scaffolder" with arguments "sequence missing_file sequence.fna"
|
39
|
+
Then the exit status should be 1
|
40
|
+
And the stderr should contain "Error. Scaffold file not found:"
|
41
|
+
|
42
|
+
Scenario: Using sequence where the scaffold file doesn't contain anything
|
43
|
+
Given an empty file named "scaffold.yml"
|
44
|
+
Given a file named "sequence.fna" with:
|
45
|
+
"""
|
46
|
+
>seq
|
47
|
+
ATGGC
|
48
|
+
"""
|
49
|
+
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna"
|
50
|
+
Then the exit status should be 1
|
51
|
+
And the stderr should contain "Error. Scaffold file is empty"
|
52
|
+
|
53
|
+
Scenario: Using sequence where a scaffold sequence is missing
|
54
|
+
Given a file named "sequence.fna" with:
|
55
|
+
"""
|
56
|
+
>seq1
|
57
|
+
ATGGC
|
58
|
+
"""
|
59
|
+
Given a file named "scaffold.yml" with:
|
60
|
+
"""
|
61
|
+
---
|
62
|
+
-
|
63
|
+
sequence:
|
64
|
+
source: "seq1"
|
65
|
+
-
|
66
|
+
sequence:
|
67
|
+
source: "seq2"
|
68
|
+
"""
|
69
|
+
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna"
|
70
|
+
Then the exit status should be 1
|
71
|
+
And the stderr should contain "Error. Unknown sequence: seq2"
|
72
|
+
|
73
|
+
Scenario: Using validate where the sequence file specified does not exist
|
74
|
+
Given a file named "scaffold.yml" with:
|
75
|
+
"""
|
76
|
+
---
|
77
|
+
-
|
78
|
+
sequence:
|
79
|
+
source: "seq"
|
80
|
+
"""
|
81
|
+
When I call "scaffolder" with arguments "validate scaffold.yml missing_file"
|
82
|
+
Then the exit status should be 1
|
83
|
+
And the stderr should contain "Error. Sequence file not found:"
|
84
|
+
|
85
|
+
Scenario: Using validate where the sequence file doesn't contain any thing
|
86
|
+
Given an empty file named "sequence.fna"
|
87
|
+
Given a file named "scaffold.yml" with:
|
88
|
+
"""
|
89
|
+
---
|
90
|
+
-
|
91
|
+
sequence:
|
92
|
+
source: "seq1"
|
93
|
+
"""
|
94
|
+
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
95
|
+
Then the exit status should be 1
|
96
|
+
And the stderr should contain "Error. Sequence file is empty"
|
97
|
+
|
98
|
+
Scenario: Using validate where the scaffold file specified does not exist
|
99
|
+
Given a file named "sequence.fna" with:
|
100
|
+
"""
|
101
|
+
>seq
|
102
|
+
ATGGC
|
103
|
+
"""
|
104
|
+
When I call "scaffolder" with arguments "validate missing_file sequence.fna"
|
105
|
+
Then the exit status should be 1
|
106
|
+
And the stderr should contain "Error. Scaffold file not found:"
|
107
|
+
|
108
|
+
Scenario: Using validate where the scaffold file doesn't contain anything
|
109
|
+
Given an empty file named "scaffold.yml"
|
110
|
+
Given a file named "sequence.fna" with:
|
111
|
+
"""
|
112
|
+
>seq
|
113
|
+
ATGGC
|
114
|
+
"""
|
115
|
+
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
116
|
+
Then the exit status should be 1
|
117
|
+
And the stderr should contain "Error. Scaffold file is empty"
|
118
|
+
|
119
|
+
Scenario: Using validate where a scaffold sequence is missing
|
120
|
+
Given a file named "sequence.fna" with:
|
121
|
+
"""
|
122
|
+
>seq1
|
123
|
+
ATGGC
|
124
|
+
"""
|
125
|
+
Given a file named "scaffold.yml" with:
|
126
|
+
"""
|
127
|
+
---
|
128
|
+
-
|
129
|
+
sequence:
|
130
|
+
source: "seq1"
|
131
|
+
-
|
132
|
+
sequence:
|
133
|
+
source: "seq2"
|
134
|
+
"""
|
135
|
+
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
136
|
+
Then the exit status should be 1
|
137
|
+
And the stderr should contain "Error. Unknown sequence: seq2"
|
data/features/sequence.feature
CHANGED
@@ -18,73 +18,12 @@ Feature: The scaffolder-sequence binary
|
|
18
18
|
"""
|
19
19
|
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna"
|
20
20
|
Then the exit status should be 0
|
21
|
-
And the stdout should contain
|
22
|
-
|
23
|
-
Scenario: The sequence file specified does not exist
|
24
|
-
Given a file named "scaffold.yml" with:
|
25
|
-
"""
|
26
|
-
---
|
27
|
-
-
|
28
|
-
sequence:
|
29
|
-
source: "seq"
|
30
|
-
"""
|
31
|
-
When I call "scaffolder" with arguments "sequence scaffold.yml missing_file"
|
32
|
-
Then the exit status should be 1
|
33
|
-
And the stderr should contain "Error. Sequence file not found:"
|
34
|
-
|
35
|
-
Scenario: The sequence file doesn't contain any thing
|
36
|
-
Given an empty file named "sequence.fna"
|
37
|
-
Given a file named "scaffold.yml" with:
|
38
|
-
"""
|
39
|
-
---
|
40
|
-
-
|
41
|
-
sequence:
|
42
|
-
source: "seq1"
|
21
|
+
And the stdout should contain exactly:
|
43
22
|
"""
|
44
|
-
|
45
|
-
Then the exit status should be 1
|
46
|
-
And the stderr should contain "Error. Sequence file is empty"
|
47
|
-
|
48
|
-
Scenario: The scaffold file specified does not exist
|
49
|
-
Given a file named "sequence.fna" with:
|
50
|
-
"""
|
51
|
-
>seq
|
23
|
+
>
|
52
24
|
ATGGC
|
53
|
-
"""
|
54
|
-
When I call "scaffolder" with arguments "sequence missing_file sequence.fna"
|
55
|
-
Then the exit status should be 1
|
56
|
-
And the stderr should contain "Error. Scaffold file not found:"
|
57
25
|
|
58
|
-
Scenario: The scaffold file doesn't contain anything
|
59
|
-
Given an empty file named "scaffold.yml"
|
60
|
-
Given a file named "sequence.fna" with:
|
61
26
|
"""
|
62
|
-
>seq
|
63
|
-
ATGGC
|
64
|
-
"""
|
65
|
-
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna"
|
66
|
-
Then the exit status should be 1
|
67
|
-
And the stderr should contain "Error. Scaffold file is empty"
|
68
|
-
|
69
|
-
Scenario: One of the sequences specified in the scaffold is missing
|
70
|
-
Given a file named "sequence.fna" with:
|
71
|
-
"""
|
72
|
-
>seq1
|
73
|
-
ATGGC
|
74
|
-
"""
|
75
|
-
Given a file named "scaffold.yml" with:
|
76
|
-
"""
|
77
|
-
---
|
78
|
-
-
|
79
|
-
sequence:
|
80
|
-
source: "seq1"
|
81
|
-
-
|
82
|
-
sequence:
|
83
|
-
source: "seq2"
|
84
|
-
"""
|
85
|
-
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna"
|
86
|
-
Then the exit status should be 1
|
87
|
-
And the stderr should contain "Error. Unknown sequence: seq2"
|
88
27
|
|
89
28
|
Scenario: Using the definition argument before the file arguments
|
90
29
|
Given a file named "sequence.fna" with:
|
@@ -101,8 +40,12 @@ Feature: The scaffolder-sequence binary
|
|
101
40
|
"""
|
102
41
|
When I call "scaffolder" with arguments "sequence --definition='name' scaffold.yml sequence.fna"
|
103
42
|
Then the exit status should be 0
|
104
|
-
And the stdout should contain
|
105
|
-
|
43
|
+
And the stdout should contain exactly:
|
44
|
+
"""
|
45
|
+
>name
|
46
|
+
ATGGC
|
47
|
+
|
48
|
+
"""
|
106
49
|
|
107
50
|
Scenario: Using the definition argument after the file arguments
|
108
51
|
Given a file named "sequence.fna" with:
|
@@ -119,10 +62,14 @@ Feature: The scaffolder-sequence binary
|
|
119
62
|
"""
|
120
63
|
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna --definition='name'"
|
121
64
|
Then the exit status should be 0
|
122
|
-
And the stdout should contain
|
123
|
-
|
65
|
+
And the stdout should contain exactly:
|
66
|
+
"""
|
67
|
+
>name
|
68
|
+
ATGGC
|
124
69
|
|
125
|
-
|
70
|
+
"""
|
71
|
+
|
72
|
+
Scenario: Using the argument --with-sequence-digest
|
126
73
|
Given a file named "sequence.fna" with:
|
127
74
|
"""
|
128
75
|
>seq
|
@@ -135,11 +82,16 @@ Feature: The scaffolder-sequence binary
|
|
135
82
|
sequence:
|
136
83
|
source: "seq"
|
137
84
|
"""
|
138
|
-
When I call "scaffolder" with arguments "sequence --
|
85
|
+
When I call "scaffolder" with arguments "sequence --with-sequence-digest scaffold.yml sequence.fna"
|
139
86
|
Then the exit status should be 0
|
140
|
-
And the stdout should contain
|
87
|
+
And the stdout should contain exactly:
|
88
|
+
"""
|
89
|
+
>[sha1=32848c64b5bac47e23002c989a9d1bf3d21b8f92]
|
90
|
+
ATGGC
|
141
91
|
|
142
|
-
|
92
|
+
"""
|
93
|
+
|
94
|
+
Scenario: Using the arguments --with-sequence-digest and --definition
|
143
95
|
Given a file named "sequence.fna" with:
|
144
96
|
"""
|
145
97
|
>seq
|
@@ -152,6 +104,11 @@ Feature: The scaffolder-sequence binary
|
|
152
104
|
sequence:
|
153
105
|
source: "seq"
|
154
106
|
"""
|
155
|
-
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna --
|
107
|
+
When I call "scaffolder" with arguments "sequence scaffold.yml sequence.fna --with-sequence-digest --definition='name'"
|
156
108
|
Then the exit status should be 0
|
157
|
-
And the stdout should contain
|
109
|
+
And the stdout should contain exactly:
|
110
|
+
"""
|
111
|
+
>name [sha1=32848c64b5bac47e23002c989a9d1bf3d21b8f92]
|
112
|
+
ATGGC
|
113
|
+
|
114
|
+
"""
|
@@ -1,4 +1,8 @@
|
|
1
1
|
When /^I call "([^"]*)" with arguments "([^"]*)"$/ do |command,args|
|
2
2
|
bin = File.join(File.dirname(__FILE__),'..','..','bin',command)
|
3
|
-
When "I run
|
3
|
+
When "I run `#{bin} #{args}`"
|
4
|
+
end
|
5
|
+
|
6
|
+
Then /^the stdout yaml should contain exactly:$/ do |string|
|
7
|
+
YAML.load(string).should == YAML.load(all_stdout)
|
4
8
|
end
|
data/features/validate.feature
CHANGED
@@ -3,72 +3,6 @@ Feature: The scaffolder-validate binary
|
|
3
3
|
A user can use the scaffolder binary with the argument validate
|
4
4
|
to test that inserts are correctly inserted
|
5
5
|
|
6
|
-
Scenario: The sequence file specified does not exist
|
7
|
-
Given a file named "scaffold.yml" with:
|
8
|
-
"""
|
9
|
-
---
|
10
|
-
-
|
11
|
-
sequence:
|
12
|
-
source: "seq"
|
13
|
-
"""
|
14
|
-
When I call "scaffolder" with arguments "validate scaffold.yml missing_file"
|
15
|
-
Then the exit status should be 1
|
16
|
-
And the stderr should contain "Error. Sequence file not found:"
|
17
|
-
|
18
|
-
Scenario: The sequence file doesn't contain any thing
|
19
|
-
Given an empty file named "sequence.fna"
|
20
|
-
Given a file named "scaffold.yml" with:
|
21
|
-
"""
|
22
|
-
---
|
23
|
-
-
|
24
|
-
sequence:
|
25
|
-
source: "seq1"
|
26
|
-
"""
|
27
|
-
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
28
|
-
Then the exit status should be 1
|
29
|
-
And the stderr should contain "Error. Sequence file is empty"
|
30
|
-
|
31
|
-
Scenario: The scaffold file specified does not exist
|
32
|
-
Given a file named "sequence.fna" with:
|
33
|
-
"""
|
34
|
-
>seq
|
35
|
-
ATGGC
|
36
|
-
"""
|
37
|
-
When I call "scaffolder" with arguments "validate missing_file sequence.fna"
|
38
|
-
Then the exit status should be 1
|
39
|
-
And the stderr should contain "Error. Scaffold file not found:"
|
40
|
-
|
41
|
-
Scenario: The scaffold file doesn't contain anything
|
42
|
-
Given an empty file named "scaffold.yml"
|
43
|
-
Given a file named "sequence.fna" with:
|
44
|
-
"""
|
45
|
-
>seq
|
46
|
-
ATGGC
|
47
|
-
"""
|
48
|
-
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
49
|
-
Then the exit status should be 1
|
50
|
-
And the stderr should contain "Error. Scaffold file is empty"
|
51
|
-
|
52
|
-
Scenario: One of the sequences specified in the scaffold is missing
|
53
|
-
Given a file named "sequence.fna" with:
|
54
|
-
"""
|
55
|
-
>seq1
|
56
|
-
ATGGC
|
57
|
-
"""
|
58
|
-
Given a file named "scaffold.yml" with:
|
59
|
-
"""
|
60
|
-
---
|
61
|
-
-
|
62
|
-
sequence:
|
63
|
-
source: "seq1"
|
64
|
-
-
|
65
|
-
sequence:
|
66
|
-
source: "seq2"
|
67
|
-
"""
|
68
|
-
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
69
|
-
Then the exit status should be 1
|
70
|
-
And the stderr should contain "Error. Unknown sequence: seq2"
|
71
|
-
|
72
6
|
Scenario: Validating a scaffold with no overlapping inserts
|
73
7
|
Given a file named "sequence.fna" with:
|
74
8
|
"""
|
@@ -169,18 +103,18 @@ Feature: The scaffolder-validate binary
|
|
169
103
|
"""
|
170
104
|
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
171
105
|
Then the exit status should be 0
|
172
|
-
And the stdout should contain exactly:
|
106
|
+
And the stdout yaml should contain exactly:
|
173
107
|
"""
|
174
|
-
---
|
175
|
-
- sequence-insert-overlap:
|
176
|
-
|
108
|
+
---
|
109
|
+
- sequence-insert-overlap:
|
110
|
+
source: seq
|
111
|
+
inserts:
|
177
112
|
- open: 2
|
178
113
|
close: 4
|
179
114
|
source: ins1
|
180
115
|
- open: 3
|
181
116
|
close: 5
|
182
117
|
source: ins2
|
183
|
-
source: seq
|
184
118
|
|
185
119
|
"""
|
186
120
|
|
@@ -220,26 +154,26 @@ Feature: The scaffolder-validate binary
|
|
220
154
|
"""
|
221
155
|
When I call "scaffolder" with arguments "validate scaffold.yml sequence.fna"
|
222
156
|
Then the exit status should be 0
|
223
|
-
And the stdout should contain exactly:
|
157
|
+
And the stdout yaml should contain exactly:
|
224
158
|
"""
|
225
|
-
---
|
226
|
-
- sequence-insert-overlap:
|
227
|
-
|
159
|
+
---
|
160
|
+
- sequence-insert-overlap:
|
161
|
+
source: seq
|
162
|
+
inserts:
|
228
163
|
- open: 2
|
229
164
|
close: 4
|
230
165
|
source: ins1
|
231
166
|
- open: 3
|
232
167
|
close: 5
|
233
168
|
source: ins2
|
169
|
+
- sequence-insert-overlap:
|
234
170
|
source: seq
|
235
|
-
|
236
|
-
inserts:
|
171
|
+
inserts:
|
237
172
|
- open: 6
|
238
173
|
close: 8
|
239
174
|
source: ins1
|
240
175
|
- open: 7
|
241
176
|
close: 9
|
242
177
|
source: ins2
|
243
|
-
source: seq
|
244
178
|
|
245
179
|
"""
|