bio 1.5.2 → 1.6.0.pre.20181210
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +12 -11
- data/ChangeLog +14 -3106
- data/{gemfiles/Gemfile.travis-ruby2.2 → Gemfile} +0 -1
- data/KNOWN_ISSUES.rdoc +0 -5
- data/README.rdoc +11 -18
- data/RELEASE_NOTES.rdoc +34 -291
- data/Rakefile +13 -9
- data/appveyor.yml +21 -0
- data/bioruby.gemspec +7 -78
- data/bioruby.gemspec.erb +8 -27
- data/doc/ChangeLog-1.5.0 +2919 -0
- data/doc/RELEASE_NOTES-1.5.0.rdoc +285 -0
- data/doc/Tutorial.rd +6 -108
- data/doc/Tutorial.rd.html +19 -98
- data/gemfiles/Gemfile.travis-jruby1.8 +3 -5
- data/gemfiles/Gemfile.travis-jruby1.9 +0 -3
- data/gemfiles/Gemfile.travis-rbx +0 -1
- data/gemfiles/Gemfile.travis-ruby1.8 +4 -4
- data/gemfiles/Gemfile.travis-ruby1.9 +0 -1
- data/gemfiles/prepare-gemspec.rb +4 -0
- data/lib/bio.rb +0 -10
- data/lib/bio/data/codontable.rb +99 -3
- data/lib/bio/io/togows.rb +5 -5
- data/lib/bio/version.rb +6 -8
- data/sample/test_restriction_enzyme_long.rb +1 -1
- data/test/unit/bio/data/test_codontable.rb +3 -0
- metadata +11 -77
- data/bin/bioruby +0 -47
- data/bin/br_biofetch.rb +0 -71
- data/bin/br_bioflat.rb +0 -293
- data/bin/br_biogetseq.rb +0 -45
- data/bin/br_pmfetch.rb +0 -422
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +0 -78
- data/lib/bio/db/biosql/sequence.rb +0 -444
- data/lib/bio/db/phyloxml/phyloxml.xsd +0 -582
- data/lib/bio/db/phyloxml/phyloxml_elements.rb +0 -1197
- data/lib/bio/db/phyloxml/phyloxml_parser.rb +0 -1001
- data/lib/bio/db/phyloxml/phyloxml_writer.rb +0 -227
- data/lib/bio/io/biosql/ar-biosql.rb +0 -257
- data/lib/bio/io/biosql/biosql.rb +0 -39
- data/lib/bio/io/biosql/config/database.yml +0 -21
- data/lib/bio/io/sql.rb +0 -79
- data/lib/bio/shell.rb +0 -44
- data/lib/bio/shell/core.rb +0 -578
- data/lib/bio/shell/demo.rb +0 -146
- data/lib/bio/shell/interface.rb +0 -217
- data/lib/bio/shell/irb.rb +0 -94
- data/lib/bio/shell/object.rb +0 -71
- data/lib/bio/shell/plugin/blast.rb +0 -42
- data/lib/bio/shell/plugin/codon.rb +0 -218
- data/lib/bio/shell/plugin/das.rb +0 -58
- data/lib/bio/shell/plugin/emboss.rb +0 -23
- data/lib/bio/shell/plugin/entry.rb +0 -137
- data/lib/bio/shell/plugin/flatfile.rb +0 -101
- data/lib/bio/shell/plugin/midi.rb +0 -430
- data/lib/bio/shell/plugin/ncbirest.rb +0 -68
- data/lib/bio/shell/plugin/obda.rb +0 -45
- data/lib/bio/shell/plugin/psort.rb +0 -56
- data/lib/bio/shell/plugin/seq.rb +0 -248
- data/lib/bio/shell/plugin/togows.rb +0 -40
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/bioruby_generator.rb +0 -29
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_classes.rhtml +0 -4
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_log.rhtml +0 -27
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_methods.rhtml +0 -11
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_modules.rhtml +0 -4
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_variables.rhtml +0 -7
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-bg.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-gem.png +0 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-link.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.css +0 -368
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.rhtml +0 -47
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_controller.rb +0 -144
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb +0 -47
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/commands.rhtml +0 -8
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/history.rhtml +0 -10
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/index.rhtml +0 -26
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/spinner.gif +0 -0
- data/lib/bio/shell/script.rb +0 -25
- data/lib/bio/shell/setup.rb +0 -108
- data/lib/bio/shell/web.rb +0 -102
- data/sample/test_phyloxml_big.rb +0 -205
- data/test/data/phyloxml/apaf.xml +0 -666
- data/test/data/phyloxml/bcl_2.xml +0 -2097
- data/test/data/phyloxml/made_up.xml +0 -144
- data/test/data/phyloxml/ncbi_taxonomy_mollusca_short.xml +0 -65
- data/test/data/phyloxml/phyloxml_examples.xml +0 -415
- data/test/unit/bio/db/biosql/tc_biosql.rb +0 -114
- data/test/unit/bio/db/biosql/ts_suite_biosql.rb +0 -8
- data/test/unit/bio/db/test_phyloxml.rb +0 -821
- data/test/unit/bio/db/test_phyloxml_writer.rb +0 -334
- data/test/unit/bio/shell/plugin/test_seq.rb +0 -187
- data/test/unit/bio/test_shell.rb +0 -20
@@ -0,0 +1,285 @@
|
|
1
|
+
= BioRuby 1.5.0 RELEASE NOTES
|
2
|
+
|
3
|
+
A lot of changes have been made to the BioRuby 1.5.0 after the version 1.4.3
|
4
|
+
is released. This document describes important and/or incompatible changes
|
5
|
+
since the BioRuby 1.4.3 release.
|
6
|
+
|
7
|
+
For known problems, see KNOWN_ISSUES.rdoc.
|
8
|
+
|
9
|
+
== NEWS
|
10
|
+
|
11
|
+
=== Full support of Ruby 2.0.0, 2.1, and 2.2
|
12
|
+
|
13
|
+
Ruby 2.0.0, 2.1, and 2.2 are now recommended Ruby versions for running
|
14
|
+
BioRuby codes.
|
15
|
+
|
16
|
+
=== Support of Ruby 1.8 will be stopped
|
17
|
+
|
18
|
+
This release is the final BioRuby version that can be run on Ruby 1.8.
|
19
|
+
|
20
|
+
=== License is updated to the new Ruby's License
|
21
|
+
|
22
|
+
BioRuby is distributed under the same license as Ruby's. In October 2011,
|
23
|
+
Ruby's License was changed from a dual license with GPLv2 to a dual license
|
24
|
+
with 2-clause BSDL. Since BioRuby 1.5.0, we have updated to the
|
25
|
+
new version of Ruby's License. For details about the license, see COPYING
|
26
|
+
or COPYING.ja and BSDL. In addition, please do not forget to see LEGAL for
|
27
|
+
exception files that are subjected to different licenses.
|
28
|
+
|
29
|
+
=== Semantic Versioning will be introduced
|
30
|
+
|
31
|
+
We will adopt the Semantic Versioning since the next release version, which
|
32
|
+
will be BioRuby 1.5.1. This means that BioRuby 1.5.0 is NOT subject to the
|
33
|
+
Semantic Versioning.
|
34
|
+
|
35
|
+
|
36
|
+
== New features and improvements
|
37
|
+
|
38
|
+
=== New method Bio::FastaFormat#first_name
|
39
|
+
|
40
|
+
Bio::FastaFormat#first_name method is added to get the first word in the
|
41
|
+
definition line. This method was proposed by Ben J. Woodcroft.
|
42
|
+
|
43
|
+
=== Accuracy of Bio::SiRNA
|
44
|
+
|
45
|
+
Accuracy of siRNA designing algorithms in Bio::SiRNA is improved,
|
46
|
+
contributed by meso_cacase.
|
47
|
+
|
48
|
+
=== Speed up of Bio::ClustalW::Report
|
49
|
+
|
50
|
+
Running speed of Bio::ClustalW::Report is optimized, contributed by
|
51
|
+
Andrew Grimm.
|
52
|
+
|
53
|
+
=== Many warning messages are squashed
|
54
|
+
|
55
|
+
Most warning messages when running ruby with "-w" option, e.g. "assigned
|
56
|
+
but unused variable", "instance variable @xxx not initialized", are
|
57
|
+
suppressed. Fixes are contributed by Kenichi Kamiya, Andrew Grimm, and
|
58
|
+
BioRuby core members.
|
59
|
+
|
60
|
+
=== Refactoring of codes
|
61
|
+
|
62
|
+
Many existing codes are reviewed and refactored. Patches are contributed
|
63
|
+
by Iain Barnett, Kenichi Kamiya, and BioRuby core members.
|
64
|
+
|
65
|
+
|
66
|
+
== Bug fixes
|
67
|
+
|
68
|
+
=== Bugs due to remote server changes
|
69
|
+
|
70
|
+
==== Bio::PubMed
|
71
|
+
|
72
|
+
Bio::PubMed#search, query, and pmfetch are re-implemented by using NCBI
|
73
|
+
E-Utilities. They were broken because unofficial API was used.
|
74
|
+
Paul Leader reported the bug and gave discussion.
|
75
|
+
|
76
|
+
==== Bio::Hinv
|
77
|
+
|
78
|
+
Bio::Hinv did not work because of the API server URL is changed.
|
79
|
+
|
80
|
+
==== Bio::TogoWS::REST
|
81
|
+
|
82
|
+
* Bio::TogoWS::REST#search with offset and limit did not work due to
|
83
|
+
TogoWS server spec change about URI escape.
|
84
|
+
* Bio::TogoWS::REST#convert did not work because of the spec change of
|
85
|
+
TogoWS REST API.
|
86
|
+
|
87
|
+
=== Bio::Fetch
|
88
|
+
|
89
|
+
Bio::Fetch with default parameters did not work because BioRuby's default
|
90
|
+
BioFetch server had been down. We have decided not to restore the service.
|
91
|
+
For smooth migration of codes using BioRuby's BioFetch server, we provide
|
92
|
+
"bio-old-biofetch-emulator" gem. See below "Imcompatible changes" for details.
|
93
|
+
|
94
|
+
The bug was reported and discussed by Jose Irizarry, Robert A. Heiler, and
|
95
|
+
others.
|
96
|
+
|
97
|
+
=== BioSQL
|
98
|
+
|
99
|
+
* Only do gsub on bio_ref.reference.authors if it exists.
|
100
|
+
* Missing require when generating genbank output for BioSQL sequence.
|
101
|
+
|
102
|
+
Contributed by Brynjar Smari Bjarnason.
|
103
|
+
|
104
|
+
=== Bugs found in data format parsers
|
105
|
+
|
106
|
+
* Bio::PDB#seqres SEQRES serNum digits were extended in PDB v3.2 (2008).
|
107
|
+
Thanks to a researcher who sent the patch.
|
108
|
+
* Bio::Blast::Default::Report parse error when subject sequence contains
|
109
|
+
spaces. Edward Rice reported the bug.
|
110
|
+
* Bio::UniProtKB#gene_name raised NoMethodError when gene_names method
|
111
|
+
returns nil. It should return nil. Candidate fix sent by Jose Irizarry.
|
112
|
+
* Bio::PhyloXML::Parser.open_uri did not return block return value when
|
113
|
+
giving a block.
|
114
|
+
|
115
|
+
=== Other bugs
|
116
|
+
|
117
|
+
* lib/bio/shell/plugin/seq.rb: String#step and #skip (extended by bioruby
|
118
|
+
shell) did not yield the last part of the string due to a change from
|
119
|
+
Ruby 1.8 to 1.9.
|
120
|
+
* Documentation and typo fixes. Contributed by many persons, including
|
121
|
+
Iain Barnett and ctSkennerton.
|
122
|
+
|
123
|
+
|
124
|
+
== Renamed features
|
125
|
+
|
126
|
+
=== Bio::SPTR, Bio::UniProt, Bio::SwissProt, and Bio::TrEMBL => Bio::UniProtKB
|
127
|
+
|
128
|
+
The classes for parsing UniProtKB (former SwissProt and TrEMBL) data,
|
129
|
+
Bio::SPTR, Bio::UniProt, Bio::SwissProt, and Bio::TrEMBL, are unified into
|
130
|
+
the new class name Bio::UniProtKB, and old names are deprecated.
|
131
|
+
|
132
|
+
For keeping backward compatibility, old class names Bio::SPTR, Bio::UniProt,
|
133
|
+
Bio::SwissProt, and Bio::TrEMBL are still available, but warning message
|
134
|
+
will be shown when using the old class names. These old class names will be
|
135
|
+
deleted in the future.
|
136
|
+
|
137
|
+
The file contatining Bio::UniProtKB class definition is also changed to
|
138
|
+
lib/bio/db/embl/uniprotkb.rb. For keeping backward compatibility, old
|
139
|
+
files sptr.rb, uniprot.rb, tremble.rb are still kept, but they will be
|
140
|
+
removed in the future.
|
141
|
+
|
142
|
+
|
143
|
+
== Deprecated features
|
144
|
+
|
145
|
+
=== Bio::RefSeq, Bio::DDBJ
|
146
|
+
|
147
|
+
Bio::RefSeq and Bio::DDBJ are deprecated because they are only an alias of
|
148
|
+
Bio::GenBank. Warning message will be shown when loading the classes and
|
149
|
+
initializing new instances. Please use Bio::GenBank instead.
|
150
|
+
|
151
|
+
lib/bio/db/genbank/ddbj.rb and lib/bio/db/genbank/refseq.rb which contain
|
152
|
+
Bio::DDBJ and Bio::RefSeq, respectively, are also deprecated. For keeping
|
153
|
+
backward compatibility, old file are still kept, but they will be removed
|
154
|
+
in the future.
|
155
|
+
|
156
|
+
|
157
|
+
== Removed features
|
158
|
+
|
159
|
+
=== Bio::SOAPWSDL
|
160
|
+
|
161
|
+
Bio::SOAPWSDL (lib/bio/io/soapwsdl.rb) is removed because SOAP4R
|
162
|
+
(SOAP/WSDL library in Ruby) is no longer bundled with Ruby since Ruby 1.9.
|
163
|
+
For Ruby 1.9 or later, some gems of SOAP4R are available, but we think they
|
164
|
+
are not well-maintained. Moreover, many SOAP servers have been retired
|
165
|
+
(see below). So, we give up maintaining Bio::SOAPWSDL and all SOAP client
|
166
|
+
classes in BioRuby.
|
167
|
+
|
168
|
+
=== Bio::EBI::SOAP
|
169
|
+
|
170
|
+
Bio::EBI::SOAP (lib/bio/io/ebisoap.rb) is removed because Bio::SOAPWSDL
|
171
|
+
is removed.
|
172
|
+
|
173
|
+
=== Bio::KEGG::API
|
174
|
+
|
175
|
+
Bio::KEGG::API is removed because KEGG API SOAP service was discontinued in
|
176
|
+
December 31, 2012. See http://www.kegg.jp/kegg/rest/ for the announcement
|
177
|
+
of service discontinuation.
|
178
|
+
|
179
|
+
=== Bio::DBGET
|
180
|
+
|
181
|
+
Bio::DBGET is removed because it only supports old original DBGET protocols
|
182
|
+
that was discontinued in 2004. Note that the DBGET is still available via
|
183
|
+
the web. See http://www.genome.jp/en/gn_dbget.html for details.
|
184
|
+
|
185
|
+
=== Bio::Ensembl
|
186
|
+
|
187
|
+
Bio::Ensembl is removed because it does not work after the renewal of Ensembl
|
188
|
+
web site in 2008. Instead, bio-ensembl gem which supports recent ensembl API
|
189
|
+
is available.
|
190
|
+
|
191
|
+
=== Bio::DDBJ::XML, Bio::DDBJ::REST
|
192
|
+
|
193
|
+
Bio::DDBJ::XML and Bio::DDBJ::REST are removed because DDBJ Web API (WABI)
|
194
|
+
web services were suspended in 2012 and then they were completely renewed
|
195
|
+
with incompatible APIs in 2013.
|
196
|
+
|
197
|
+
=== Bio::HGC::HiGet
|
198
|
+
|
199
|
+
Bio::HGC::HiGet (lib/bio/io/higet.rb) is removed because the HiGet web server
|
200
|
+
http://higet.hgc.jp/ have been down since 2011, and we think that the server
|
201
|
+
will not be restored again.
|
202
|
+
|
203
|
+
=== Bio::NCBI::SOAP
|
204
|
+
|
205
|
+
Bio::NCBI::SOAP is removed because it always raises error during the parsing
|
206
|
+
of WSDL files provided by NCBI. In addition, NCBI announced that the SOAP
|
207
|
+
web service for the E-utilities will be terminated on July 1, 2015. Instead,
|
208
|
+
Bio::NCBI::REST, REST client for the NCBI E-utility web service, is available.
|
209
|
+
|
210
|
+
=== Bio::KEGG::Taxonomy
|
211
|
+
|
212
|
+
Bio::KEGG::Taxonomy is removed because it does not work correctly. It raises
|
213
|
+
error, it falls into infinite loop, or it returns apparently broken data.
|
214
|
+
Moreover, KEGG closed public FTP site and the file "taxonomy" could only be
|
215
|
+
obtained by paid subscribers.
|
216
|
+
|
217
|
+
=== Bio.method_missing
|
218
|
+
|
219
|
+
Bio.method_missing, that aims to provide shortcuts of Bio::Shell methods
|
220
|
+
with shorter name without typing "Shell", is removed because most of the
|
221
|
+
methods raises error mainly due to bypassing of initialization procedure.
|
222
|
+
In addition, we now think that the use of method_missing should generally
|
223
|
+
be avoid unless it is really necessary.
|
224
|
+
|
225
|
+
=== extconf.rb
|
226
|
+
|
227
|
+
extconf.rb, an alternative way to install BioRuby to the system, is removed
|
228
|
+
because of avoiding potential confusions. Nowadays, extconf.rb is usually
|
229
|
+
only used for building native extensions, but no native extensions are
|
230
|
+
included in this release. Use gem or setup.rb to install BioRuby.
|
231
|
+
|
232
|
+
|
233
|
+
== Incompatible changes
|
234
|
+
|
235
|
+
Also see the above "Renamed features", "Deprecated features", and
|
236
|
+
"Removed features" sections.
|
237
|
+
|
238
|
+
=== Bio::Fetch
|
239
|
+
|
240
|
+
The BioRuby default BioFetch server http://bioruby.org/cgi-bin/biofetch.rb,
|
241
|
+
that was the default server for Bio::Fetch before BioRuby 1.4, is deprecated.
|
242
|
+
Due to the service stop, default server URL in Bio::Fetch is removed, and
|
243
|
+
we decide not to give any server URL by default for Bio::Fetch.
|
244
|
+
|
245
|
+
As an alternative, new class Bio::Fetch::EBI which uses the EBI Dbfetch
|
246
|
+
server is added. When changing codes form Bio::Fetch to Bio::Fetch::EBI,
|
247
|
+
be careful of the differences of database names, default and available
|
248
|
+
data formats between the former BioRuby BioFetch server and the EBI Dbfetch
|
249
|
+
server.
|
250
|
+
|
251
|
+
Methods directly affected are:
|
252
|
+
|
253
|
+
* Bio::Fetch.new (Bio::Fetch#initialize) does not have default server URL,
|
254
|
+
and URL of a server must always be explicitly given as the first argument.
|
255
|
+
* Bio::Fetch.query is removed.
|
256
|
+
|
257
|
+
For the purpose running old codes, it is recommended to install
|
258
|
+
bio-old-biofetch-emulator gem. The bio-old-biofetch-emulator gem emulates
|
259
|
+
old BioRuby's default BioFetch server by using other existing web services.
|
260
|
+
See https://rubygems.org/gems/bio-old-biofetch-emulator for details.
|
261
|
+
We think many codes can run with no changes by simply installing the gem and
|
262
|
+
adding "-r bio-old-biofetch-emulator" into the command-line when executing
|
263
|
+
ruby.
|
264
|
+
|
265
|
+
|
266
|
+
== Known issues
|
267
|
+
|
268
|
+
The following issues are added or updated. See KNOWN_ISSUES.rdoc for other
|
269
|
+
already known issues.
|
270
|
+
|
271
|
+
=== Bio::PDB
|
272
|
+
|
273
|
+
Bio::PDB should be updated to follow PDB format version 3.3.
|
274
|
+
|
275
|
+
=== Bio::Blast::Report
|
276
|
+
|
277
|
+
NCBI announces that that they are makeing a new version of BLAST XML data
|
278
|
+
format. BioRuby should support it.
|
279
|
+
|
280
|
+
=== Bio::Blast::Default::Report
|
281
|
+
|
282
|
+
Bio::Blast::Default::Report currently supports legacy BLAST only.
|
283
|
+
It may be better to support BLAST+ text output format, although NCBI
|
284
|
+
do not recommend to do so because the format is unstable.
|
285
|
+
|
data/doc/Tutorial.rd
CHANGED
@@ -1248,102 +1248,13 @@ annotated phylogenetic trees. PhyloXML's parser in BioRuby is implemented in
|
|
1248
1248
|
Bio::PhyloXML::Parser, and its writer in Bio::PhyloXML::Writer.
|
1249
1249
|
More information can be found at ((<www.phyloxml.org|URL:http://www.phyloxml.org>)).
|
1250
1250
|
|
1251
|
-
|
1251
|
+
Bio::PhyloXML have been split out from BioRuby core and have been released
|
1252
|
+
as bio-phyloxml gem. To use Bio::PhyloXML, install the bio-phyloxml gem.
|
1252
1253
|
|
1253
|
-
|
1254
|
-
|
1255
|
-
% gem install -r libxml-ruby
|
1256
|
-
|
1257
|
-
For more information see the ((<libxml installer page|URL:http://libxml.rubyforge.org/install.xml>))
|
1258
|
-
|
1259
|
-
== Parsing a file
|
1260
|
-
|
1261
|
-
require 'bio'
|
1262
|
-
|
1263
|
-
# Create new phyloxml parser
|
1264
|
-
phyloxml = Bio::PhyloXML::Parser.open('example.xml')
|
1265
|
-
|
1266
|
-
# Print the names of all trees in the file
|
1267
|
-
phyloxml.each do |tree|
|
1268
|
-
puts tree.name
|
1269
|
-
end
|
1270
|
-
|
1271
|
-
If there are several trees in the file, you can access the one you wish by specifying its index:
|
1272
|
-
|
1273
|
-
tree = phyloxml[3]
|
1274
|
-
|
1275
|
-
You can use all Bio::Tree methods on the tree, since PhyloXML::Tree inherits from Bio::Tree. For example,
|
1276
|
-
|
1277
|
-
tree.leaves.each do |node|
|
1278
|
-
puts node.name
|
1279
|
-
end
|
1280
|
-
|
1281
|
-
PhyloXML files can hold additional information besides phylogenies at the end of the file. This info can be accessed through the 'other' array of the parser object.
|
1282
|
-
|
1283
|
-
phyloxml = Bio::PhyloXML::Parser.open('example.xml')
|
1284
|
-
while tree = phyloxml.next_tree
|
1285
|
-
# do stuff with trees
|
1286
|
-
end
|
1287
|
-
|
1288
|
-
puts phyloxml.other
|
1289
|
-
|
1290
|
-
== Writing a file
|
1291
|
-
|
1292
|
-
# Create new phyloxml writer
|
1293
|
-
writer = Bio::PhyloXML::Writer.new('tree.xml')
|
1294
|
-
|
1295
|
-
# Write tree to the file tree.xml
|
1296
|
-
writer.write(tree1)
|
1297
|
-
|
1298
|
-
# Add another tree to the file
|
1299
|
-
writer.write(tree2)
|
1300
|
-
|
1301
|
-
== Retrieving data
|
1302
|
-
|
1303
|
-
Here is an example of how to retrieve the scientific name of the clades included in each tree.
|
1304
|
-
|
1305
|
-
require 'bio'
|
1306
|
-
|
1307
|
-
phyloxml = Bio::PhyloXML::Parser.open('ncbi_taxonomy_mollusca.xml')
|
1308
|
-
phyloxml.each do |tree|
|
1309
|
-
tree.each_node do |node|
|
1310
|
-
print "Scientific name: ", node.taxonomies[0].scientific_name, "\n"
|
1311
|
-
end
|
1312
|
-
end
|
1313
|
-
|
1314
|
-
== Retrieving 'other' data
|
1315
|
-
|
1316
|
-
require 'bio'
|
1317
|
-
|
1318
|
-
phyloxml = Bio::PhyloXML::Parser.open('phyloxml_examples.xml')
|
1319
|
-
while tree = phyloxml.next_tree
|
1320
|
-
#do something with the trees
|
1321
|
-
end
|
1322
|
-
|
1323
|
-
p phyloxml.other
|
1324
|
-
puts "\n"
|
1325
|
-
#=> output is an object representation
|
1326
|
-
|
1327
|
-
#Print in a readable way
|
1328
|
-
puts phyloxml.other[0].to_xml, "\n"
|
1329
|
-
#=>:
|
1330
|
-
#
|
1331
|
-
#<align:alignment xmlns:align="http://example.org/align">
|
1332
|
-
# <seq name="A">acgtcgcggcccgtggaagtcctctcct</seq>
|
1333
|
-
# <seq name="B">aggtcgcggcctgtggaagtcctctcct</seq>
|
1334
|
-
# <seq name="C">taaatcgc--cccgtgg-agtccc-cct</seq>
|
1335
|
-
#</align:alignment>
|
1336
|
-
|
1337
|
-
#Once we know whats there, lets output just sequences
|
1338
|
-
phyloxml.other[0].children.each do |node|
|
1339
|
-
puts node.value
|
1340
|
-
end
|
1341
|
-
#=>
|
1342
|
-
#
|
1343
|
-
#acgtcgcggcccgtggaagtcctctcct
|
1344
|
-
#aggtcgcggcctgtggaagtcctctcct
|
1345
|
-
#taaatcgc--cccgtgg-agtccc-cct
|
1254
|
+
% gem install bio-phyloxml
|
1346
1255
|
|
1256
|
+
The tutorial of Bio::PhyloXML is bundled in bio-phyloxml.
|
1257
|
+
((<URL:https://github.com/bioruby/bioruby-phyloxml/blob/master/doc/Tutorial.rd>))
|
1347
1258
|
|
1348
1259
|
== The BioRuby example programs
|
1349
1260
|
|
@@ -1446,8 +1357,7 @@ At the moment there is no easy way of accessing BioPerl or BioPython directly fr
|
|
1446
1357
|
|
1447
1358
|
== Installing required external libraries
|
1448
1359
|
|
1449
|
-
At this point for using BioRuby no additional libraries are needed
|
1450
|
-
you are using the Bio::PhyloXML module; then you have to install libxml-ruby.
|
1360
|
+
At this point for using BioRuby no additional libraries are needed.
|
1451
1361
|
|
1452
1362
|
This may change, so keep an eye on the Bioruby website. Also when
|
1453
1363
|
a package is missing BioRuby should show an informative message.
|
@@ -1457,18 +1367,6 @@ painful, as the gem standard for packages evolved late and some still
|
|
1457
1367
|
force you to copy things by hand. Therefore read the README's
|
1458
1368
|
carefully that come with each package.
|
1459
1369
|
|
1460
|
-
=== Installing libxml-ruby
|
1461
|
-
|
1462
|
-
The simplest way is to use the RubyGems packaging system:
|
1463
|
-
|
1464
|
-
gem install -r libxml-ruby
|
1465
|
-
|
1466
|
-
If you get `require': no such file to load - mkmf (LoadError) error then do
|
1467
|
-
|
1468
|
-
sudo apt-get install ruby-dev
|
1469
|
-
|
1470
|
-
If you have other problems with installation, then see ((<URL:http://libxml.rubyforge.org/install.xml>)).
|
1471
|
-
|
1472
1370
|
== Trouble shooting
|
1473
1371
|
|
1474
1372
|
* Error: in `require': no such file to load -- bio (LoadError)
|
data/doc/Tutorial.rd.html
CHANGED
@@ -1011,99 +1011,27 @@ ToDo: add exemaples from George. I remember he did some cool post on BioSQL and
|
|
1011
1011
|
annotated phylogenetic trees. PhyloXML's parser in BioRuby is implemented in
|
1012
1012
|
Bio::PhyloXML::Parser, and its writer in Bio::PhyloXML::Writer.
|
1013
1013
|
More information can be found at <a href="http://www.phyloxml.org">www.phyloxml.org</a>.</p>
|
1014
|
-
<
|
1015
|
-
|
1016
|
-
<pre>% gem install -
|
1017
|
-
<p>
|
1018
|
-
<
|
1019
|
-
<
|
1020
|
-
|
1021
|
-
# Create new phyloxml parser
|
1022
|
-
phyloxml = Bio::PhyloXML::Parser.open('example.xml')
|
1023
|
-
|
1024
|
-
# Print the names of all trees in the file
|
1025
|
-
phyloxml.each do |tree|
|
1026
|
-
puts tree.name
|
1027
|
-
end</pre>
|
1028
|
-
<p>If there are several trees in the file, you can access the one you wish by specifying its index:</p>
|
1029
|
-
<pre>tree = phyloxml[3]</pre>
|
1030
|
-
<p>You can use all Bio::Tree methods on the tree, since PhyloXML::Tree inherits from Bio::Tree. For example, </p>
|
1031
|
-
<pre>tree.leaves.each do |node|
|
1032
|
-
puts node.name
|
1033
|
-
end</pre>
|
1034
|
-
<p>PhyloXML files can hold additional information besides phylogenies at the end of the file. This info can be accessed through the 'other' array of the parser object.</p>
|
1035
|
-
<pre>phyloxml = Bio::PhyloXML::Parser.open('example.xml')
|
1036
|
-
while tree = phyloxml.next_tree
|
1037
|
-
# do stuff with trees
|
1038
|
-
end
|
1039
|
-
|
1040
|
-
puts phyloxml.other</pre>
|
1041
|
-
<h2><a name="label-26" id="label-26">Writing a file</a></h2><!-- RDLabel: "Writing a file" -->
|
1042
|
-
<pre># Create new phyloxml writer
|
1043
|
-
writer = Bio::PhyloXML::Writer.new('tree.xml')
|
1044
|
-
|
1045
|
-
# Write tree to the file tree.xml
|
1046
|
-
writer.write(tree1)
|
1047
|
-
|
1048
|
-
# Add another tree to the file
|
1049
|
-
writer.write(tree2)</pre>
|
1050
|
-
<h2><a name="label-27" id="label-27">Retrieving data</a></h2><!-- RDLabel: "Retrieving data" -->
|
1051
|
-
<p>Here is an example of how to retrieve the scientific name of the clades included in each tree.</p>
|
1052
|
-
<pre>require 'bio'
|
1053
|
-
|
1054
|
-
phyloxml = Bio::PhyloXML::Parser.open('ncbi_taxonomy_mollusca.xml')
|
1055
|
-
phyloxml.each do |tree|
|
1056
|
-
tree.each_node do |node|
|
1057
|
-
print "Scientific name: ", node.taxonomies[0].scientific_name, "\n"
|
1058
|
-
end
|
1059
|
-
end</pre>
|
1060
|
-
<h2><a name="label-28" id="label-28">Retrieving 'other' data</a></h2><!-- RDLabel: "Retrieving 'other' data" -->
|
1061
|
-
<pre>require 'bio'
|
1062
|
-
|
1063
|
-
phyloxml = Bio::PhyloXML::Parser.open('phyloxml_examples.xml')
|
1064
|
-
while tree = phyloxml.next_tree
|
1065
|
-
#do something with the trees
|
1066
|
-
end
|
1067
|
-
|
1068
|
-
p phyloxml.other
|
1069
|
-
puts "\n"
|
1070
|
-
#=> output is an object representation
|
1071
|
-
|
1072
|
-
#Print in a readable way
|
1073
|
-
puts phyloxml.other[0].to_xml, "\n"
|
1074
|
-
#=>:
|
1075
|
-
#
|
1076
|
-
#<align:alignment xmlns:align="http://example.org/align">
|
1077
|
-
# <seq name="A">acgtcgcggcccgtggaagtcctctcct</seq>
|
1078
|
-
# <seq name="B">aggtcgcggcctgtggaagtcctctcct</seq>
|
1079
|
-
# <seq name="C">taaatcgc--cccgtgg-agtccc-cct</seq>
|
1080
|
-
#</align:alignment>
|
1081
|
-
|
1082
|
-
#Once we know whats there, lets output just sequences
|
1083
|
-
phyloxml.other[0].children.each do |node|
|
1084
|
-
puts node.value
|
1085
|
-
end
|
1086
|
-
#=>
|
1087
|
-
#
|
1088
|
-
#acgtcgcggcccgtggaagtcctctcct
|
1089
|
-
#aggtcgcggcctgtggaagtcctctcct
|
1090
|
-
#taaatcgc--cccgtgg-agtccc-cct</pre>
|
1091
|
-
<h2><a name="label-29" id="label-29">The BioRuby example programs</a></h2><!-- RDLabel: "The BioRuby example programs" -->
|
1014
|
+
<p>Bio::PhyloXML have been split out from BioRuby core and have been released
|
1015
|
+
as bio-phyloxml gem. To use Bio::PhyloXML, install the bio-phyloxml gem.</p>
|
1016
|
+
<pre>% gem install bio-phyloxml</pre>
|
1017
|
+
<p>The tutorial of Bio::PhyloXML is bundled in bio-phyloxml.
|
1018
|
+
<a href="https://github.com/bioruby/bioruby-phyloxml/blob/master/doc/Tutorial.rd"><URL:https://github.com/bioruby/bioruby-phyloxml/blob/master/doc/Tutorial.rd></a></p>
|
1019
|
+
<h2><a name="label-24" id="label-24">The BioRuby example programs</a></h2><!-- RDLabel: "The BioRuby example programs" -->
|
1092
1020
|
<p>Some sample programs are stored in ./samples/ directory. For example, the n2aa.rb program (transforms a nucleic acid sequence into an amino acid sequence) can be run using:</p>
|
1093
1021
|
<pre>./sample/na2aa.rb test/data/fasta/example1.txt </pre>
|
1094
|
-
<h2><a name="label-
|
1022
|
+
<h2><a name="label-25" id="label-25">Unit testing and doctests</a></h2><!-- RDLabel: "Unit testing and doctests" -->
|
1095
1023
|
<p>BioRuby comes with an extensive testing framework with over 1300 tests and 2700
|
1096
1024
|
assertions. To run the unit tests:</p>
|
1097
1025
|
<pre>cd test
|
1098
1026
|
ruby runner.rb</pre>
|
1099
1027
|
<p>We have also started with doctest for Ruby. We are porting the examples
|
1100
1028
|
in this tutorial to doctest - more info upcoming.</p>
|
1101
|
-
<h2><a name="label-
|
1029
|
+
<h2><a name="label-26" id="label-26">Further reading</a></h2><!-- RDLabel: "Further reading" -->
|
1102
1030
|
<p>See the BioRuby in anger Wiki. A lot of BioRuby's documentation exists in the
|
1103
1031
|
source code and unit tests. To really dive in you will need the latest source
|
1104
1032
|
code tree. The embedded rdoc documentation for the BioRuby source code can be viewed online at
|
1105
1033
|
<a href="http://bioruby.org/rdoc/"><URL:http://bioruby.org/rdoc/></a>.</p>
|
1106
|
-
<h2><a name="label-
|
1034
|
+
<h2><a name="label-27" id="label-27">BioRuby Shell</a></h2><!-- RDLabel: "BioRuby Shell" -->
|
1107
1035
|
<p>The BioRuby shell implementation is located in ./lib/bio/shell. It is very interesting
|
1108
1036
|
as it uses IRB (the Ruby intepreter) which is a powerful environment described in
|
1109
1037
|
<a href="http://ruby-doc.org/docs/ProgrammingRuby/html/irb.html">Programming Ruby's IRB chapter</a>. IRB commands can be typed directly into the shell, e.g.</p>
|
@@ -1112,26 +1040,26 @@ as it uses IRB (the Ruby intepreter) which is a powerful environment described i
|
|
1112
1040
|
<p>Additionally, you also may want to install the optional Ruby readline support -
|
1113
1041
|
with Debian libreadline-ruby. To edit a previous line you may have to press
|
1114
1042
|
line down (down arrow) first.</p>
|
1115
|
-
<h1><a name="label-
|
1043
|
+
<h1><a name="label-28" id="label-28">Helpful tools</a></h1><!-- RDLabel: "Helpful tools" -->
|
1116
1044
|
<p>Apart from rdoc you may also want to use rtags - which allows jumping around
|
1117
1045
|
source code by clicking on class and method names. </p>
|
1118
1046
|
<pre>cd bioruby/lib
|
1119
1047
|
rtags -R --vi</pre>
|
1120
1048
|
<p>For a tutorial see <a href="http://rtags.rubyforge.org/">here</a></p>
|
1121
|
-
<h1><a name="label-
|
1122
|
-
<h2><a name="label-
|
1049
|
+
<h1><a name="label-29" id="label-29">APPENDIX</a></h1><!-- RDLabel: "APPENDIX" -->
|
1050
|
+
<h2><a name="label-30" id="label-30">Biogem: Additional BioRuby plugins</a></h2><!-- RDLabel: "Biogem: Additional BioRuby plugins" -->
|
1123
1051
|
<p>Biogem is one of the exciting developments for Ruby in bioinformatics! Biogems
|
1124
1052
|
add new functionality next to the BioRuby core project (BioRuby is a biogem itself). A biogem is simply installed with </p>
|
1125
1053
|
<pre>gem install bio # The core BioRuby gem
|
1126
1054
|
gem install bio-core # BioRuby + stable pure Ruby biogems
|
1127
1055
|
gem install bio-core-ext # bio-core + stable Ruby extensions</pre>
|
1128
1056
|
<p>Information on these biogems, and the many others available, see <a href="http://biogems.info/">Biogems.info</a> or <a href="http://gems.bioruby.org/">gems.bioruby.org</a>.</p>
|
1129
|
-
<h2><a name="label-
|
1057
|
+
<h2><a name="label-31" id="label-31">Ruby Ensembl API</a></h2><!-- RDLabel: "Ruby Ensembl API" -->
|
1130
1058
|
<p>The Ruby Ensembl API is a Ruby API to the Ensembl database. It is NOT currently
|
1131
1059
|
included in the BioRuby archives. To install it, see
|
1132
1060
|
<a href="http://wiki.github.com/jandot/ruby-ensembl-api">the Ruby-Ensembl Github</a>
|
1133
1061
|
for more information.</p>
|
1134
|
-
<h3><a name="label-
|
1062
|
+
<h3><a name="label-32" id="label-32">Gene Ontology (GO) through the Ruby Ensembl API</a></h3><!-- RDLabel: "Gene Ontology (GO) through the Ruby Ensembl API" -->
|
1135
1063
|
<p>Gene Ontologies can be fetched through the Ruby Ensembl API package:</p>
|
1136
1064
|
<pre>require 'ensembl'
|
1137
1065
|
Ensembl::Core::DBConnection.connect('drosophila_melanogaster')
|
@@ -1148,32 +1076,25 @@ infile.each do |line|
|
|
1148
1076
|
end</pre>
|
1149
1077
|
<p>Prints each mosq. accession/uniq identifier and the GO terms from the Drosphila
|
1150
1078
|
homologues.</p>
|
1151
|
-
<h2><a name="label-
|
1079
|
+
<h2><a name="label-33" id="label-33">Using BioPerl or BioPython from Ruby</a></h2><!-- RDLabel: "Using BioPerl or BioPython from Ruby" -->
|
1152
1080
|
<p>A possible route is to opt for JRuby and Jython on the JAVA virtual machine (JVM).</p>
|
1153
1081
|
<p>At the moment there is no easy way of accessing BioPerl or BioPython directly from Ruby. A possibility is to create a Perl or Python server that gets accessed through XML/RPC or SOAP.</p>
|
1154
|
-
<h2><a name="label-
|
1155
|
-
<p>At this point for using BioRuby no additional libraries are needed
|
1156
|
-
you are using the Bio::PhyloXML module; then you have to install libxml-ruby.</p>
|
1082
|
+
<h2><a name="label-34" id="label-34">Installing required external libraries</a></h2><!-- RDLabel: "Installing required external libraries" -->
|
1083
|
+
<p>At this point for using BioRuby no additional libraries are needed.</p>
|
1157
1084
|
<p>This may change, so keep an eye on the Bioruby website. Also when
|
1158
1085
|
a package is missing BioRuby should show an informative message.</p>
|
1159
1086
|
<p>At this point installing third party Ruby packages can be a bit
|
1160
1087
|
painful, as the gem standard for packages evolved late and some still
|
1161
1088
|
force you to copy things by hand. Therefore read the README's
|
1162
1089
|
carefully that come with each package.</p>
|
1163
|
-
<
|
1164
|
-
<p>The simplest way is to use the RubyGems packaging system:</p>
|
1165
|
-
<pre>gem install -r libxml-ruby</pre>
|
1166
|
-
<p>If you get `require': no such file to load - mkmf (LoadError) error then do</p>
|
1167
|
-
<pre>sudo apt-get install ruby-dev</pre>
|
1168
|
-
<p>If you have other problems with installation, then see <a href="http://libxml.rubyforge.org/install.xml"><URL:http://libxml.rubyforge.org/install.xml></a>.</p>
|
1169
|
-
<h2><a name="label-41" id="label-41">Trouble shooting</a></h2><!-- RDLabel: "Trouble shooting" -->
|
1090
|
+
<h2><a name="label-35" id="label-35">Trouble shooting</a></h2><!-- RDLabel: "Trouble shooting" -->
|
1170
1091
|
<ul>
|
1171
1092
|
<li>Error: in `require': no such file to load -- bio (LoadError)</li>
|
1172
1093
|
</ul>
|
1173
1094
|
<p>Ruby is failing to find the BioRuby libraries - add it to the RUBYLIB path, or pass
|
1174
1095
|
it to the interpeter. For example:</p>
|
1175
1096
|
<pre>ruby -I$BIORUBYPATH/lib yourprogram.rb</pre>
|
1176
|
-
<h2><a name="label-
|
1097
|
+
<h2><a name="label-36" id="label-36">Modifying this page</a></h2><!-- RDLabel: "Modifying this page" -->
|
1177
1098
|
<p>IMPORTANT NOTICE: This page is maintained in the BioRuby source code
|
1178
1099
|
repository. Please edit the file there otherwise changes may get
|
1179
1100
|
lost. See <!-- Reference, RDLabel "BioRuby Developer Information" doesn't exist --><em class="label-not-found">BioRuby Developer Information</em><!-- Reference end --> for repository and mailing list
|