bio-gff3 0.8.7 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ # - jruby-19mode # JRuby in 1.9 mode
7
+ - rbx-19mode
8
+ # - jruby-18mode # JRuby in 1.8 mode
9
+ # - rbx-18mode
10
+
11
+ # uncomment this line if your project needs to run something other than `rake`:
12
+ # script: bundle exec rspec spec
data/Gemfile CHANGED
@@ -9,8 +9,8 @@ gem "bio-logger", "> 0.8.0"
9
9
  # Include everything needed to run rake, tests, features, etc.
10
10
  group :development do
11
11
  gem "shoulda", ">= 0"
12
- gem "bundler", "~> 1.0.0"
13
- gem "jeweler", "~> 1.5.2"
14
- gem "rcov", ">= 0"
15
- gem "rspec", ">= 2.3.0"
12
+ gem "bundler", "~> 1.1.5"
13
+ gem "jeweler", "~> 1.8.3"
14
+ gem "rspec", ">= 2.10.0"
15
+ gem "regressiontest"
16
16
  end
@@ -1,27 +1,41 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- bio (1.4.1)
4
+ activesupport (3.2.7)
5
+ i18n (~> 0.6)
6
+ multi_json (~> 1.0)
7
+ bio (1.4.2)
5
8
  bio-logger (1.0.0)
6
9
  log4r (>= 1.1.9)
7
- diff-lcs (1.1.2)
10
+ diff-lcs (1.1.3)
8
11
  git (1.2.5)
9
- jeweler (1.5.2)
10
- bundler (~> 1.0.0)
12
+ i18n (0.6.0)
13
+ jeweler (1.8.4)
14
+ bundler (~> 1.0)
11
15
  git (>= 1.2.5)
12
16
  rake
13
- log4r (1.1.9)
14
- rake (0.9.2)
15
- rcov (0.9.9)
16
- rspec (2.6.0)
17
- rspec-core (~> 2.6.0)
18
- rspec-expectations (~> 2.6.0)
19
- rspec-mocks (~> 2.6.0)
20
- rspec-core (2.6.4)
21
- rspec-expectations (2.6.0)
22
- diff-lcs (~> 1.1.2)
23
- rspec-mocks (2.6.0)
24
- shoulda (2.11.3)
17
+ rdoc
18
+ json (1.7.4)
19
+ log4r (1.1.10)
20
+ multi_json (1.3.6)
21
+ rake (0.9.2.2)
22
+ rdoc (3.12)
23
+ json (~> 1.4)
24
+ regressiontest (0.0.1)
25
+ rspec (2.10.0)
26
+ rspec-core (~> 2.10.0)
27
+ rspec-expectations (~> 2.10.0)
28
+ rspec-mocks (~> 2.10.0)
29
+ rspec-core (2.10.1)
30
+ rspec-expectations (2.10.0)
31
+ diff-lcs (~> 1.1.3)
32
+ rspec-mocks (2.10.1)
33
+ shoulda (3.1.1)
34
+ shoulda-context (~> 1.0)
35
+ shoulda-matchers (~> 1.2)
36
+ shoulda-context (1.0.0)
37
+ shoulda-matchers (1.2.0)
38
+ activesupport (>= 3.0.0)
25
39
 
26
40
  PLATFORMS
27
41
  ruby
@@ -29,9 +43,9 @@ PLATFORMS
29
43
  DEPENDENCIES
30
44
  bio (>= 1.3.1)
31
45
  bio-logger (> 0.8.0)
32
- bundler (~> 1.0.0)
33
- jeweler (~> 1.5.2)
46
+ bundler (~> 1.1.5)
47
+ jeweler (~> 1.8.3)
34
48
  log4r (> 1.1.6)
35
- rcov
36
- rspec (>= 2.3.0)
49
+ regressiontest
50
+ rspec (>= 2.10.0)
37
51
  shoulda
@@ -1,3 +1,9 @@
1
+ {<img
2
+ src="https://secure.travis-ci.org/pjotrp/bioruby-gff3-plugin.png"
3
+ />}[http://travis-ci.org/#!/pjotrp/bioruby-gff3-plugin]
4
+
5
+ bio-gff3 is listed at http://biogems.info
6
+
1
7
  = bio-gff3
2
8
 
3
9
  GFF3 parser, aimed at parsing big data GFF3 to return sequences of any type,
@@ -15,7 +21,8 @@ Currently the output is a FASTA file.
15
21
  You can use this plugin in two ways. First as a standalone program,
16
22
  second as a plugin library to BioRuby.
17
23
 
18
- Note: a really fast GFF3 parser is in the works at https://github.com/pjotrp/biolib_hpc/tree/master/modules/gff3
24
+ Note: a really fast GFF3 parser, and way more flexible, is in the
25
+ works. See https://github.com/mamarjan/gff3-pltools.
19
26
 
20
27
  == Install and run gff3-fetch
21
28
 
@@ -55,13 +62,9 @@ For a write-up see http://thebird.nl/bioruby/BioRuby_GFF3.html
55
62
 
56
63
  -------------------------------------------------------------------------------
57
64
 
58
- == Copyright
59
-
60
- Copyright (C) 2010,2011 Pjotr Prins <pjotr.prins@thebird.nl>
61
-
65
+ = Command line usage (CLI)
62
66
 
63
-
64
- Fetch and assemble GFF3 types (e.g. ORF, mRNA, CDS) + print in FASTA format.
67
+ Fetch and assemble GFF3 types (ORF, mRNA, CDS) + print in FASTA format.
65
68
 
66
69
  gff3-fetch [options] type [filename.fa] filename.gff3
67
70
 
@@ -94,10 +97,10 @@ Copyright (C) 2010,2011 Pjotr Prins <pjotr.prins@thebird.nl>
94
97
  Where (NYI == Not Yet Implemented):
95
98
 
96
99
  Multiple GFF3 files can be used. With external FASTA files, always the last
97
- one before the GFF3 filename is matched.
100
+ one before the GFF3 filename is matched. Make sure the FASTA file
101
+ comes before the GFF3 file on the command line.
98
102
 
99
- Note that above switches are only partially implemented at this stage. Full
100
- feature support is projected Feb. 2011.
103
+ Note that above switches are only partially implemented at this stage.
101
104
 
102
105
  Examples:
103
106
 
@@ -164,8 +167,7 @@ time gff3-fetch cds m_hapla.WS217.dna.fa m_hapla.WS217.gff3 2> /dev/null > test.
164
167
 
165
168
  Cache real user sys gff3 version
166
169
  ------------------------------------------------------------
167
- in preparation see also biolib/HPC:
168
- https://github.com/pjotrp/biolib_hpc/tree/master/modules/gff3
170
+ in preparation
169
171
  ------------------------------------------------------------
170
172
 
171
173
  where
@@ -176,13 +178,20 @@ where
176
178
  ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
177
179
  on an 8 CPU, 2.6 GHz (6MB cache), 16 GB RAM machine.
178
180
 
181
+ Note: the new parser by Marjan is magnitudes faster, and way more
182
+ flexible. See https://github.com/mamarjan/gff3-pltools
183
+
179
184
  == Cite
180
185
 
181
186
  If you use this software, please cite
182
187
 
188
+ http://dx.doi.org/10.1093/bioinformatics/bts080
189
+
190
+ or
191
+
183
192
  http://dx.doi.org/10.1093/bioinformatics/btq475
184
193
 
185
194
  == Copyright
186
195
 
187
- Copyright (C) 2010,2011 Pjotr Prins <pjotr.prins@thebird.nl>
196
+ Copyright (C) 2010-2012 Pjotr Prins <pjotr.prins@thebird.nl>
188
197
 
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'rubygems'
2
- # require 'bundler'
3
- # begin
4
- # Bundler.setup(:default, :development)
5
- # rescue Bundler::BundlerError => e
6
- # $stderr.puts e.message
7
- # $stderr.puts "Run `bundle install` to install missing gems"
8
- # exit e.status_code
9
- # end
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
10
  require 'rake'
11
11
 
12
12
  require 'jeweler'
@@ -33,7 +33,8 @@ Jeweler::RubygemsDotOrgTasks.new
33
33
  require 'rake/testtask'
34
34
  Rake::TestTask.new(:test) do |test|
35
35
  test.libs << 'lib' << 'test'
36
- test.pattern = 'test/**/test_*.rb'
36
+ # test.pattern = 'test/**/test_*.rb' # breaks in 1.9.3
37
+ test.test_files = Dir.glob("test/**/test_*.rb")
37
38
  test.verbose = true
38
39
  Kernel.system('rspec spec/*.rb')
39
40
  end
@@ -47,21 +48,21 @@ end
47
48
  #end
48
49
 
49
50
 
50
- require 'rcov/rcovtask'
51
- Rcov::RcovTask.new do |test|
52
- test.libs << 'test'
53
- test.pattern = 'test/**/test_*.rb'
54
- test.verbose = true
55
- end
51
+ # require 'rcov/rcovtask'
52
+ # Rcov::RcovTask.new do |test|
53
+ # test.libs << 'test'
54
+ # test.pattern = 'test/**/test_*.rb'
55
+ # test.verbose = true
56
+ # end
56
57
 
57
58
  task :default => :test
58
59
 
59
- require 'rake/rdoctask'
60
- Rake::RDocTask.new do |rdoc|
61
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
60
+ # require 'rake/rdoctask'
61
+ # Rake::RDocTask.new do |rdoc|
62
+ # version = File.exist?('VERSION') ? File.read('VERSION') : ""
62
63
 
63
- rdoc.rdoc_dir = 'rdoc'
64
- rdoc.title = "bio-gff3 #{version}"
65
- rdoc.rdoc_files.include('README*')
66
- rdoc.rdoc_files.include('lib/**/*.rb')
67
- end
64
+ # rdoc.rdoc_dir = 'rdoc'
65
+ # rdoc.title = "bio-gff3 #{version}"
66
+ # rdoc.rdoc_files.include('README*')
67
+ # rdoc.rdoc_files.include('lib/**/*.rb')
68
+ # end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.7
1
+ 0.9.0
@@ -1,14 +1,13 @@
1
- #! /usr/bin/ruby
1
+ #! /usr/bin/env ruby
2
2
  #
3
3
  # Author:: Pjotr Prins
4
- # Copyright:: August 2010
5
4
  # License:: Ruby License
6
- #
7
- # Copyright (C) 2010,2011 Pjotr Prins <pjotr.prins@thebird.nl>
5
+
6
+ COPYRIGHT = "Copyright (C) 2010-2012 Pjotr Prins <pjotr.prins@thebird.nl>"
8
7
 
9
8
  USAGE = <<EOM
10
9
 
11
- Fetch and assemble GFF3 types (e.g. ORF, mRNA, CDS) + print in FASTA format.
10
+ Fetch and assemble GFF3 types (ORF, mRNA, CDS) + print in FASTA format.
12
11
 
13
12
  gff3-fetch [options] type [filename.fa] filename.gff3
14
13
 
@@ -41,10 +40,10 @@ USAGE = <<EOM
41
40
  Where (NYI == Not Yet Implemented):
42
41
 
43
42
  Multiple GFF3 files can be used. With external FASTA files, always the last
44
- one before the GFF3 filename is matched.
43
+ one before the GFF3 filename is matched. Make sure the FASTA file
44
+ comes before the GFF3 file on the command line.
45
45
 
46
- Note that above switches are only partially implemented at this stage. Full
47
- feature support is projected Feb. 2011.
46
+ Note that above switches are only partially implemented at this stage.
48
47
 
49
48
  Examples:
50
49
 
@@ -126,11 +125,15 @@ on an 8 CPU, 2.6 GHz (6MB cache), 16 GB RAM machine.
126
125
 
127
126
  If you use this software, please cite
128
127
 
128
+ http://dx.doi.org/10.1093/bioinformatics/bts080
129
+
130
+ or
131
+
129
132
  http://dx.doi.org/10.1093/bioinformatics/btq475
130
133
 
131
134
  == Copyright
132
135
 
133
- Copyright (C) 2010,2011 Pjotr Prins <pjotr.prins@thebird.nl>
136
+ #{COPYRIGHT}
134
137
 
135
138
  EOM
136
139
 
@@ -144,7 +147,7 @@ require 'optparse'
144
147
  require 'ostruct'
145
148
  require 'bio/output/gfffastawriter'
146
149
 
147
- $stderr.print "BioRuby GFF3 Plugin "+GFF3_VERSION+" Copyright (C) 2010,2011 Pjotr Prins <pjotr.prins@thebird.nl>\n\n"
150
+ $stderr.print "gff3-fetch (biogem Ruby #{RUBY_VERSION}) "+GFF3_VERSION+" "+COPYRIGHT+"\n\n"
148
151
 
149
152
  if ARGV.size == 0
150
153
  print USAGE
@@ -158,7 +161,7 @@ options = OpenStruct.new()
158
161
  # ---- Default options
159
162
  options.parser = :line
160
163
 
161
- opts = OptionParser.new() { |opts|
164
+ opts2 = OptionParser.new() { |opts|
162
165
  opts.on_tail("-h", "--help", "Show help and examples") {
163
166
  print(opts)
164
167
  print USAGE
@@ -239,6 +242,7 @@ opts = OptionParser.new() { |opts|
239
242
  end
240
243
 
241
244
  }
245
+ opts = opts2
242
246
  opts.parse!(ARGV)
243
247
 
244
248
  Bio::Log::CLI.configure('bio-gff3')
@@ -4,23 +4,21 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{bio-gff3}
8
- s.version = "0.8.7"
7
+ s.name = "bio-gff3"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Pjotr Prins}]
12
- s.date = %q{2011-07-31}
13
- s.description = %q{GFF3 (genome browser) information and digest mRNA and CDS sequences.
14
- Options for low memory use and caching of records.
15
- Support for external FASTA files.
16
- }
17
- s.email = %q{pjotr.prins@thebird.nl}
18
- s.executables = [%q{gff3-fetch}]
11
+ s.authors = ["Pjotr Prins"]
12
+ s.date = "2012-08-20"
13
+ s.description = "GFF3 (genome browser) information and digest mRNA and CDS sequences.\nOptions for low memory use and caching of records.\nSupport for external FASTA files.\n"
14
+ s.email = "pjotr.prins@thebird.nl"
15
+ s.executables = ["gff3-fetch"]
19
16
  s.extra_rdoc_files = [
20
17
  "LICENSE.txt",
21
18
  "README.rdoc"
22
19
  ]
23
20
  s.files = [
21
+ ".travis.yml",
24
22
  "Gemfile",
25
23
  "Gemfile.lock",
26
24
  "LICENSE.txt",
@@ -59,6 +57,8 @@ Support for external FASTA files.
59
57
  "test/data/gff/MhA1_Contig1133.gff3",
60
58
  "test/data/gff/MhA1_Contig125.fa",
61
59
  "test/data/gff/MhA1_Contig125.gff3",
60
+ "test/data/gff/m_hapla.WS232.annotations.part.gff3",
61
+ "test/data/gff/m_hapla.WS232.genomic.part.fa",
62
62
  "test/data/gff/standard.gff3",
63
63
  "test/data/gff/test-cds.gff3",
64
64
  "test/data/gff/test-ext-fasta.fa",
@@ -66,30 +66,21 @@ Support for external FASTA files.
66
66
  "test/data/gff/test.gff3",
67
67
  "test/data/regression/test_ext_gff3.rtest",
68
68
  "test/data/regression/test_gff3.rtest",
69
+ "test/data/regression/test_latest_wormbase_ext_gff3.ref",
70
+ "test/data/regression/test_latest_wormbase_ext_gff3.rtest",
69
71
  "test/data/regression/test_lrucache_ext_gff3.rtest",
70
72
  "test/data/regression/test_lrucache_gff3.rtest",
71
73
  "test/data/regression/test_nocache_ext_gff3.rtest",
72
74
  "test/data/regression/test_nocache_gff3.rtest",
73
75
  "test/helper.rb",
74
- "test/regressiontest.rb",
75
- "test/test_bio-gff3.rb"
76
- ]
77
- s.homepage = %q{https://github.com/pjotrp/bioruby-gff3-plugin}
78
- s.licenses = [%q{MIT}]
79
- s.require_paths = [%q{lib}]
80
- s.rubygems_version = %q{1.8.6}
81
- s.summary = %q{GFF3 parser for big data}
82
- s.test_files = [
83
- "spec/gff3_assemble2_spec.rb",
84
- "spec/gff3_assemble3_spec.rb",
85
- "spec/gff3_assemble_spec.rb",
86
- "spec/gff3_fileiterator_spec.rb",
87
- "spec/gffdb_spec.rb",
88
- "spec/gffparserec.rb",
89
- "test/helper.rb",
90
- "test/regressiontest.rb",
76
+ "test/regressiontest2.rb",
91
77
  "test/test_bio-gff3.rb"
92
78
  ]
79
+ s.homepage = "https://github.com/pjotrp/bioruby-gff3-plugin"
80
+ s.licenses = ["MIT"]
81
+ s.require_paths = ["lib"]
82
+ s.rubygems_version = "1.8.10"
83
+ s.summary = "GFF3 parser for big data"
93
84
 
94
85
  if s.respond_to? :specification_version then
95
86
  s.specification_version = 3
@@ -99,29 +90,29 @@ Support for external FASTA files.
99
90
  s.add_runtime_dependency(%q<log4r>, ["> 1.1.6"])
100
91
  s.add_runtime_dependency(%q<bio-logger>, ["> 0.8.0"])
101
92
  s.add_development_dependency(%q<shoulda>, [">= 0"])
102
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
103
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
104
- s.add_development_dependency(%q<rcov>, [">= 0"])
105
- s.add_development_dependency(%q<rspec>, [">= 2.3.0"])
93
+ s.add_development_dependency(%q<bundler>, ["~> 1.1.5"])
94
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
95
+ s.add_development_dependency(%q<rspec>, [">= 2.10.0"])
96
+ s.add_development_dependency(%q<regressiontest>, [">= 0"])
106
97
  else
107
98
  s.add_dependency(%q<bio>, [">= 1.3.1"])
108
99
  s.add_dependency(%q<log4r>, ["> 1.1.6"])
109
100
  s.add_dependency(%q<bio-logger>, ["> 0.8.0"])
110
101
  s.add_dependency(%q<shoulda>, [">= 0"])
111
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
112
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
113
- s.add_dependency(%q<rcov>, [">= 0"])
114
- s.add_dependency(%q<rspec>, [">= 2.3.0"])
102
+ s.add_dependency(%q<bundler>, ["~> 1.1.5"])
103
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
104
+ s.add_dependency(%q<rspec>, [">= 2.10.0"])
105
+ s.add_dependency(%q<regressiontest>, [">= 0"])
115
106
  end
116
107
  else
117
108
  s.add_dependency(%q<bio>, [">= 1.3.1"])
118
109
  s.add_dependency(%q<log4r>, ["> 1.1.6"])
119
110
  s.add_dependency(%q<bio-logger>, ["> 0.8.0"])
120
111
  s.add_dependency(%q<shoulda>, [">= 0"])
121
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
122
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
123
- s.add_dependency(%q<rcov>, [">= 0"])
124
- s.add_dependency(%q<rspec>, [">= 2.3.0"])
112
+ s.add_dependency(%q<bundler>, ["~> 1.1.5"])
113
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
114
+ s.add_dependency(%q<rspec>, [">= 2.10.0"])
115
+ s.add_dependency(%q<regressiontest>, [">= 0"])
125
116
  end
126
117
  end
127
118
 
@@ -69,23 +69,22 @@ module Bio
69
69
 
70
70
  def each_seq(gfftype)
71
71
  parse(gfftype) { | id, seq | yield id,seq }
72
-
73
72
  end
74
73
 
75
74
  def each_gene_seq
76
75
  each_seq('gene') { | id, seq | yield id,seq }
77
76
  end
77
+
78
78
  def each_mRNA_seq
79
79
  each_seq('mrna') { | id, seq | yield id,seq }
80
-
81
80
  end
81
+
82
82
  def each_exon_seq
83
83
  each_seq('exon') { | id, seq | yield id,seq }
84
-
85
84
  end
85
+
86
86
  def each_CDS_seq
87
87
  each_seq('cds') { | id, seq | yield id,seq }
88
-
89
88
  end
90
89
  end
91
90
  end