genomer 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,2 @@
1
1
  source :rubygems
2
2
  gemspec
3
-
4
- gem "md2man", :git => "git://github.com/sunaku/md2man.git", :ref => "c87dab11"
@@ -0,0 +1,59 @@
1
+ ![Genomer: A swiss army knife for genome projects](http://genomer.s3.amazonaws.com/icon/genomer.png)
2
+
3
+ ## About
4
+
5
+ Genomer is command line glue for genome projects. I wrote this tool to simplify
6
+ the small but tedious tasks required when finishing a genome. Genomer does not
7
+ perform assembly, gap closing or genome annotation. Genomer does however make
8
+ it easy to reorganise contigs in a genome, map annotations on to the genome and
9
+ generate the files required to submit a genome.
10
+
11
+ A important part of genomer is making all projects reproducible. Genomer is
12
+ designed to work well with build tools such as [GNU Make][make] and revision
13
+ control tools such as [git][git]. This allows for all steps taken in genome
14
+ project to be tracked and reverted if required.
15
+
16
+ [make]: http://www.gnu.org/software/make/
17
+ [git]: http://git-scm.com/
18
+
19
+ Genomer is also built as a modular tool where additional functions are added by
20
+ installing plugins. Plugins can be added simply by naming them in the `Gemfile`
21
+ in the genomer project root, followed typing the command `bundle install`.
22
+ Furthermore plugins can be specified to specific versions, this means that new
23
+ versions of genomer plugins will not break any existing genomer projects.
24
+
25
+ ## Examples
26
+
27
+ I wrote genomer to simplify the manual and error prone tasks in my own genome
28
+ projects. You can see examples of using genomer for [a small plasmid][plasmid]
29
+ and for [a larger microbial genome][genome]. Each of these projects takes
30
+ advantage of revision control and build files to make the projects
31
+ reproducible.
32
+
33
+ [plasmid]: https://github.com/michaelbarton/chromosome-pfluorescens-r124-plasmid
34
+ [genome]: https://github.com/michaelbarton/chromosome-pfluorescens-r124-genome
35
+
36
+ ## Installing
37
+
38
+ Ruby and RubyGems are required to use genomer and related plugins. Genomer is
39
+ installed on the command line using:
40
+
41
+ $ gem install genomer
42
+
43
+ ## Contact
44
+
45
+ Genomer is developed by Michael Barton (www.michaelbarton.me.uk). The source
46
+ code is available on [github][]. Bug reports and feature requests should also
47
+ be made there.
48
+
49
+ [github]: https://github.com/michaelbarton/genomer
50
+
51
+ ## Copyright
52
+
53
+ Genomer copyright (c) 2010 by Michael Barton. Genomer is licensed under the MIT
54
+ license. See LICENSE.txt for further details. The swiss army knife image is by
55
+ [Alan Cann][cann] used under a Creative Commons Attribution Non-Commercial
56
+ ShareAlike 2.0 Licence. The original can be [found on flickr.][flickr]
57
+
58
+ [cann]: http://microbiologybytes.com/AJC/
59
+ [flickr]: http://www.flickr.com/photos/ajc1/4663140532/
@@ -6,6 +6,11 @@ Feature: Creating a new genomer project
6
6
  Scenario: Creating a new project
7
7
  When I run the genomer command with the arguments "init project"
8
8
  Then the exit status should be 0
9
+ And the stdout should contain:
10
+ """
11
+ Genomer project 'project' created.
12
+
13
+ """
9
14
  And a directory named "project" should exist
10
15
  And a directory named "project/assembly" should exist
11
16
  And a file named "project/assembly/scaffold.yml" should exist
@@ -67,3 +72,12 @@ Feature: Creating a new genomer project
67
72
  """
68
73
  The scaffold contains 1 entries
69
74
  """
75
+
76
+ Scenario: Creating a new project where the directory already exists
77
+ Given a directory named "project"
78
+ When I run the genomer command with the arguments "init project"
79
+ Then the exit status should be 1
80
+ And the stderr should contain:
81
+ """
82
+ Error. Directory 'project' already exists.
83
+ """
@@ -69,3 +69,9 @@ Feature: Showing man pages for available commands
69
69
  Error. No manual entry for command 'simple unknown'
70
70
 
71
71
  """
72
+
73
+ @disable-bundler
74
+ Scenario: Getting the man page for init
75
+ When I run the genomer command with the arguments "man init"
76
+ Then the exit status should be 0
77
+ And the output should contain "GENOMER-INIT(1)"
@@ -16,12 +16,12 @@ Gem::Specification.new do |s|
16
16
  s.rubyforge_project = "genomer"
17
17
 
18
18
  s.add_dependency "rake", "~> 0.9.0"
19
- s.add_dependency "bundler", "~> 1.1.0"
19
+ s.add_dependency "bundler", "> 1.1.0"
20
20
  s.add_dependency "configliere", "~> 0.4.8"
21
21
  s.add_dependency "scaffolder", "~> 0.4.0"
22
22
  s.add_dependency "scaffolder-annotation-locator", ">= 0.1.4"
23
23
  s.add_dependency "unindent", "~> 1.0.0"
24
- s.add_dependency "md2man", "~> 1.2.0"
24
+ s.add_dependency "md2man", "~> 1.4.0"
25
25
 
26
26
  # Specs
27
27
  s.add_development_dependency "rspec", "~> 2.7.0"
@@ -53,12 +53,17 @@ class Genomer::Runtime
53
53
 
54
54
  def man
55
55
  if not arguments.empty?
56
- man_file_location = man_file(arguments.clone)
57
- unless File.exists?(man_file_location)
56
+ location = if arguments.first == 'init'
57
+ File.expand_path File.dirname(__FILE__) + '/../../man/genomer-init.1.ronn'
58
+ else
59
+ man_file(arguments.clone)
60
+ end
61
+
62
+ unless File.exists?(location)
58
63
  raise Genomer::Error, "No manual entry for command '#{arguments.join(' ')}'"
59
64
  end
60
65
 
61
- Kernel.exec "man #{groffed_man_file(man_file_location).path}"
66
+ Kernel.exec "man #{groffed_man_file(location).path}"
62
67
  else
63
68
  msg =<<-EOF
64
69
  genomer man COMMAND
@@ -94,7 +99,6 @@ class Genomer::Runtime
94
99
  Dir.mkdir project_name
95
100
  Dir.mkdir File.join(project_name,'assembly')
96
101
 
97
-
98
102
  File.open(File.join(project_name,'Gemfile'),'w') do |file|
99
103
  file.print Genomer::Files.gemfile
100
104
  end
@@ -104,6 +108,9 @@ class Genomer::Runtime
104
108
  file.print Genomer::Files.send(name.gsub('.','_').to_sym)
105
109
  end
106
110
  end
111
+
112
+ "Genomer project '#{project_name}' created.\n"
113
+
107
114
  end
108
115
 
109
116
  def run_plugin
@@ -1,3 +1,3 @@
1
1
  module Genomer
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -11,7 +11,35 @@ genomer-init(1) -- create a new genomer project
11
11
  ## DESCRIPTION
12
12
 
13
13
  Creates a new genomer project directory named **project-name**. Returns an
14
- error if the project directory already exists.
14
+ error if the project directory already exists. This created directory has the
15
+ following structure. Each file is described below.
16
+
17
+ **project-name**
18
+ ├── Gemfile
19
+ └── assembly
20
+ ├── annotations.gff
21
+ ├── scaffold.yml
22
+ └── sequence.fna
23
+
24
+ * **Gemfile**: Genomer plugins are specified here. After adding a plugin the
25
+ command `bundle install` should run to install the required plugins. Gems are
26
+ specified according to [the bundler documentation][bundler]. Each plugin
27
+ should begin with the suffix 'genomer-plugin.'
28
+
29
+ * **sequence.fna**: The file containing your contigs and scaffolds. These
30
+ should be stored in fasta format.
31
+
32
+ * **scaffold.yml**: The specifies the final layout of your genome. The scaffold
33
+ file is written the YAML format. Details and examples of the scaffold format
34
+ can be found on the [next.gs][] website.
35
+
36
+ * **annotations.gff**: Specific your genome annotations in [gff3 format][gff]
37
+ here. The **seqid** column should match the corresponding name of the fasta
38
+ sequence in the **sequence.fna** file.
39
+
40
+ [bundler]: http://gembundler.com/
41
+ [gff]: http://www.sequenceontology.org/gff3.shtml
42
+ [next.gs]: http://next.gs
15
43
 
16
44
  ## BUGS
17
45
 
@@ -49,7 +49,11 @@ describe Genomer::Runtime do
49
49
  describe "with project name argument" do
50
50
 
51
51
  before do
52
- subject.execute!
52
+ @msg = subject.execute!
53
+ end
54
+
55
+ it "should print message that project has been created" do
56
+ @msg.should == "Genomer project 'project_name' created.\n"
53
57
  end
54
58
 
55
59
  it "should create a directory from the named argument" do
@@ -133,12 +137,12 @@ describe Genomer::Runtime do
133
137
 
134
138
  describe "help" do
135
139
 
136
- let(:arguments){ %w|help| }
137
-
138
140
  before do
139
141
  mock(Genomer::Plugin).plugins{ gems }
140
142
  end
141
143
 
144
+ let(:arguments){ %w|help| }
145
+
142
146
  describe "with no available plugins" do
143
147
 
144
148
  let(:gems) do
@@ -186,7 +190,7 @@ describe Genomer::Runtime do
186
190
  stub(Genomer::Plugin).plugins{ gems }
187
191
  end
188
192
 
189
- describe "with no command specified" do
193
+ describe "and no command specified" do
190
194
 
191
195
  let(:arguments){ %w|man| }
192
196
 
@@ -200,7 +204,7 @@ describe Genomer::Runtime do
200
204
 
201
205
  end
202
206
 
203
- describe "with a command specified" do
207
+ describe "and a command specified" do
204
208
 
205
209
  let(:arguments){ %w|man simple| }
206
210
  let(:man_file){ 'a' }
@@ -219,6 +223,25 @@ describe Genomer::Runtime do
219
223
 
220
224
  end
221
225
 
226
+ describe "and the init command specified" do
227
+
228
+ let(:arguments){ %w|man init| }
229
+ let(:man_file){ File.expand_path File.dirname(__FILE__) + '/../../man/genomer-init.1.ronn' }
230
+ let(:groffed_man_file){ mock!.path{ 'b' } }
231
+
232
+ before do
233
+ dont_allow(subject).man_file
234
+ mock(subject).groffed_man_file(man_file){ groffed_man_file }
235
+ mock(File).exists?(man_file){true}
236
+ end
237
+
238
+ it "should call man for the groffed path" do
239
+ mock(Kernel).exec("man b")
240
+ subject.execute!
241
+ end
242
+
243
+ end
244
+
222
245
  describe "with a subcommand specified" do
223
246
 
224
247
  let(:arguments){ %w|man simple subcommand| }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genomer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-06 00:00:00.000000000 Z
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>'
36
36
  - !ruby/object:Gem::Version
37
37
  version: 1.1.0
38
38
  type: :runtime
@@ -40,7 +40,7 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>'
44
44
  - !ruby/object:Gem::Version
45
45
  version: 1.1.0
46
46
  - !ruby/object:Gem::Dependency
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 1.2.0
117
+ version: 1.4.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 1.2.0
125
+ version: 1.4.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: rspec
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -232,10 +232,9 @@ files:
232
232
  - .travis.yml
233
233
  - Gemfile
234
234
  - LICENSE.txt
235
- - README.rdoc
235
+ - README.mkd
236
236
  - Rakefile
237
237
  - bin/genomer
238
- - cucumber.yml
239
238
  - features/api/annotation_ids.feature
240
239
  - features/api/annotation_location.feature
241
240
  - features/cli/error.feature
@@ -275,7 +274,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
275
274
  version: '0'
276
275
  segments:
277
276
  - 0
278
- hash: -2433583334421431310
277
+ hash: -1310621877616390557
279
278
  required_rubygems_version: !ruby/object:Gem::Requirement
280
279
  none: false
281
280
  requirements:
@@ -1,23 +0,0 @@
1
- == Synopsis
2
-
3
- Genomer is a plugin-based framework for genome finishing. Plugins are installed
4
- using the RubyGems package management system. Genome files are managed as a
5
- directory and updated at the command line using the `genomer` command.
6
-
7
- == Installing
8
-
9
- Ruby and RubyGems are required to use genomer and related plugins. Genomer is
10
- installed on the command line using:
11
-
12
- $ gem install genomer
13
-
14
- == Contact
15
-
16
- Genomer is developed by Michael Barton (www.michaelbarton.me.uk). The source
17
- code is available on github. Bug reports and feature requests should also be
18
- made there.
19
-
20
- == Copyright
21
-
22
- Genomer copyright (c) 2010 by Michael Barton. Scaffolder is licensed under the
23
- MIT license. See LICENSE.txt for further details.
@@ -1,2 +0,0 @@
1
- ---
2
- default: --format progress --color