bio 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/bioruby +14 -122
- data/bin/br_biofetch.rb +2 -2
- data/bin/br_bioflat.rb +2 -2
- data/bin/br_biogetseq.rb +2 -2
- data/bin/br_pmfetch.rb +3 -3
- data/doc/Changes-0.7.rd +77 -0
- data/doc/KEGG_API.rd +523 -232
- data/doc/KEGG_API.rd.ja +529 -207
- data/doc/Tutorial.rd +48 -11
- data/lib/bio.rb +59 -6
- data/lib/bio/alignment.rb +713 -103
- data/lib/bio/appl/bl2seq/report.rb +2 -18
- data/lib/bio/appl/blast.rb +108 -91
- data/lib/bio/appl/blast/format0.rb +33 -18
- data/lib/bio/appl/blast/format8.rb +6 -20
- data/lib/bio/appl/blast/report.rb +293 -429
- data/lib/bio/appl/blast/rexml.rb +8 -22
- data/lib/bio/appl/blast/wublast.rb +21 -12
- data/lib/bio/appl/blast/xmlparser.rb +180 -183
- data/lib/bio/appl/blat/report.rb +127 -30
- data/lib/bio/appl/clustalw.rb +87 -59
- data/lib/bio/appl/clustalw/report.rb +20 -22
- data/lib/bio/appl/emboss.rb +113 -20
- data/lib/bio/appl/fasta.rb +173 -198
- data/lib/bio/appl/fasta/format10.rb +244 -347
- data/lib/bio/appl/gcg/msf.rb +212 -0
- data/lib/bio/appl/gcg/seq.rb +195 -0
- data/lib/bio/appl/genscan/report.rb +5 -23
- data/lib/bio/appl/hmmer.rb +8 -45
- data/lib/bio/appl/hmmer/report.rb +2 -20
- data/lib/bio/appl/iprscan/report.rb +374 -0
- data/lib/bio/appl/mafft.rb +87 -50
- data/lib/bio/appl/mafft/report.rb +151 -44
- data/lib/bio/appl/muscle.rb +52 -0
- data/lib/bio/appl/phylip/alignment.rb +129 -0
- data/lib/bio/appl/phylip/distance_matrix.rb +96 -0
- data/lib/bio/appl/probcons.rb +41 -0
- data/lib/bio/appl/psort.rb +89 -96
- data/lib/bio/appl/psort/report.rb +6 -22
- data/lib/bio/appl/pts1.rb +263 -0
- data/lib/bio/appl/sim4.rb +26 -36
- data/lib/bio/appl/sim4/report.rb +2 -18
- data/lib/bio/appl/sosui/report.rb +5 -20
- data/lib/bio/appl/spidey/report.rb +2 -2
- data/lib/bio/appl/targetp/report.rb +4 -20
- data/lib/bio/appl/tcoffee.rb +55 -0
- data/lib/bio/appl/tmhmm/report.rb +4 -20
- data/lib/bio/command.rb +235 -64
- data/lib/bio/data/aa.rb +21 -26
- data/lib/bio/data/codontable.rb +2 -20
- data/lib/bio/data/na.rb +19 -4
- data/lib/bio/db.rb +27 -12
- data/lib/bio/db/aaindex.rb +2 -20
- data/lib/bio/db/embl/common.rb +4 -21
- data/lib/bio/db/embl/embl.rb +33 -85
- data/lib/bio/db/embl/sptr.rb +612 -302
- data/lib/bio/db/embl/swissprot.rb +10 -29
- data/lib/bio/db/embl/trembl.rb +10 -29
- data/lib/bio/db/embl/uniprot.rb +10 -29
- data/lib/bio/db/fantom.rb +15 -20
- data/lib/bio/db/fasta.rb +3 -3
- data/lib/bio/db/genbank/common.rb +37 -46
- data/lib/bio/db/genbank/ddbj.rb +6 -18
- data/lib/bio/db/genbank/genbank.rb +47 -186
- data/lib/bio/db/genbank/genpept.rb +4 -17
- data/lib/bio/db/genbank/refseq.rb +4 -17
- data/lib/bio/db/gff.rb +103 -35
- data/lib/bio/db/go.rb +4 -20
- data/lib/bio/db/kegg/brite.rb +26 -36
- data/lib/bio/db/kegg/compound.rb +81 -85
- data/lib/bio/db/kegg/drug.rb +98 -0
- data/lib/bio/db/kegg/enzyme.rb +133 -110
- data/lib/bio/db/kegg/expression.rb +2 -20
- data/lib/bio/db/kegg/genes.rb +208 -238
- data/lib/bio/db/kegg/genome.rb +164 -285
- data/lib/bio/db/kegg/glycan.rb +114 -157
- data/lib/bio/db/kegg/keggtab.rb +242 -303
- data/lib/bio/db/kegg/kgml.rb +117 -160
- data/lib/bio/db/kegg/orthology.rb +112 -0
- data/lib/bio/db/kegg/reaction.rb +54 -69
- data/lib/bio/db/kegg/taxonomy.rb +331 -0
- data/lib/bio/db/lasergene.rb +209 -0
- data/lib/bio/db/litdb.rb +3 -27
- data/lib/bio/db/medline.rb +228 -249
- data/lib/bio/db/nbrf.rb +3 -3
- data/lib/bio/db/newick.rb +510 -0
- data/lib/bio/db/nexus.rb +1854 -0
- data/lib/bio/db/pdb.rb +5 -17
- data/lib/bio/db/pdb/atom.rb +2 -18
- data/lib/bio/db/pdb/chain.rb +2 -18
- data/lib/bio/db/pdb/chemicalcomponent.rb +2 -18
- data/lib/bio/db/pdb/model.rb +2 -18
- data/lib/bio/db/pdb/pdb.rb +73 -34
- data/lib/bio/db/pdb/residue.rb +4 -20
- data/lib/bio/db/pdb/utils.rb +2 -18
- data/lib/bio/db/prosite.rb +403 -422
- data/lib/bio/db/rebase.rb +84 -40
- data/lib/bio/db/soft.rb +404 -0
- data/lib/bio/db/transfac.rb +5 -17
- data/lib/bio/feature.rb +106 -52
- data/lib/bio/io/das.rb +32 -42
- data/lib/bio/io/dbget.rb +2 -20
- data/lib/bio/io/ddbjxml.rb +77 -138
- data/lib/bio/io/ebisoap.rb +158 -0
- data/lib/bio/io/ensembl.rb +229 -0
- data/lib/bio/io/fastacmd.rb +89 -82
- data/lib/bio/io/fetch.rb +163 -96
- data/lib/bio/io/flatfile.rb +170 -73
- data/lib/bio/io/flatfile/bdb.rb +3 -16
- data/lib/bio/io/flatfile/index.rb +2 -2
- data/lib/bio/io/flatfile/indexer.rb +3 -2
- data/lib/bio/io/higet.rb +12 -31
- data/lib/bio/io/keggapi.rb +210 -269
- data/lib/bio/io/ncbisoap.rb +155 -0
- data/lib/bio/io/pubmed.rb +169 -147
- data/lib/bio/io/registry.rb +4 -20
- data/lib/bio/io/soapwsdl.rb +43 -38
- data/lib/bio/io/sql.rb +242 -305
- data/lib/bio/location.rb +407 -285
- data/lib/bio/map.rb +410 -0
- data/lib/bio/pathway.rb +558 -695
- data/lib/bio/reference.rb +272 -75
- data/lib/bio/sequence.rb +255 -13
- data/lib/bio/sequence/aa.rb +71 -10
- data/lib/bio/sequence/common.rb +187 -33
- data/lib/bio/sequence/compat.rb +59 -4
- data/lib/bio/sequence/format.rb +54 -7
- data/lib/bio/sequence/generic.rb +3 -3
- data/lib/bio/sequence/na.rb +328 -26
- data/lib/bio/shell.rb +11 -4
- data/lib/bio/shell/core.rb +221 -160
- data/lib/bio/shell/demo.rb +18 -15
- data/lib/bio/shell/interface.rb +14 -12
- data/lib/bio/shell/irb.rb +95 -0
- data/lib/bio/shell/object.rb +45 -26
- data/lib/bio/shell/plugin/blast.rb +42 -0
- data/lib/bio/shell/plugin/codon.rb +22 -14
- data/lib/bio/shell/plugin/das.rb +58 -0
- data/lib/bio/shell/plugin/emboss.rb +2 -2
- data/lib/bio/shell/plugin/entry.rb +22 -11
- data/lib/bio/shell/plugin/flatfile.rb +2 -2
- data/lib/bio/shell/plugin/keggapi.rb +13 -6
- data/lib/bio/shell/plugin/midi.rb +4 -4
- data/lib/bio/shell/plugin/obda.rb +2 -2
- data/lib/bio/shell/plugin/psort.rb +56 -0
- data/lib/bio/shell/plugin/seq.rb +35 -8
- data/lib/bio/shell/plugin/soap.rb +87 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/bioruby_generator.rb +29 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_classes.rhtml +4 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_log.rhtml +27 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_methods.rhtml +11 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_modules.rhtml +4 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_variables.rhtml +7 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby-bg.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby-console.png +0 -0
- data/lib/bio/shell/rails/{public/images/icon.png → vendor/plugins/generators/bioruby/templates/bioruby-gem.png} +0 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby-link.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css +369 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.rhtml +47 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby_controller.rb +144 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby_helper.rb +47 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/commands.rhtml +8 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/history.rhtml +10 -0
- data/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/index.rhtml +22 -0
- data/lib/bio/shell/script.rb +25 -0
- data/lib/bio/shell/setup.rb +109 -0
- data/lib/bio/shell/web.rb +70 -58
- data/lib/bio/tree.rb +850 -0
- data/lib/bio/util/color_scheme.rb +84 -107
- data/lib/bio/util/color_scheme/buried.rb +5 -24
- data/lib/bio/util/color_scheme/helix.rb +5 -24
- data/lib/bio/util/color_scheme/hydropathy.rb +5 -24
- data/lib/bio/util/color_scheme/nucleotide.rb +5 -24
- data/lib/bio/util/color_scheme/strand.rb +5 -24
- data/lib/bio/util/color_scheme/taylor.rb +5 -24
- data/lib/bio/util/color_scheme/turn.rb +5 -24
- data/lib/bio/util/color_scheme/zappo.rb +5 -24
- data/lib/bio/util/contingency_table.rb +70 -43
- data/lib/bio/util/restriction_enzyme.rb +228 -0
- data/lib/bio/util/restriction_enzyme/analysis.rb +249 -0
- data/lib/bio/util/restriction_enzyme/analysis_basic.rb +217 -0
- data/lib/bio/util/restriction_enzyme/cut_symbol.rb +107 -0
- data/lib/bio/util/restriction_enzyme/double_stranded.rb +321 -0
- data/lib/bio/util/restriction_enzyme/double_stranded/aligned_strands.rb +130 -0
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair.rb +103 -0
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb +38 -0
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb +76 -0
- data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb +107 -0
- data/lib/bio/util/restriction_enzyme/enzymes.yaml +7061 -0
- data/lib/bio/util/restriction_enzyme/range/cut_range.rb +24 -0
- data/lib/bio/util/restriction_enzyme/range/cut_ranges.rb +47 -0
- data/lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb +67 -0
- data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +257 -0
- data/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb +242 -0
- data/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb +51 -0
- data/lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb +41 -0
- data/lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb +77 -0
- data/lib/bio/util/restriction_enzyme/single_strand.rb +199 -0
- data/lib/bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation.rb +135 -0
- data/lib/bio/util/restriction_enzyme/single_strand_complement.rb +23 -0
- data/lib/bio/util/restriction_enzyme/string_formatting.rb +111 -0
- data/lib/bio/util/sirna.rb +4 -22
- data/sample/color_scheme_na.rb +4 -12
- data/sample/enzymes.rb +78 -0
- data/sample/goslim.rb +5 -13
- data/sample/psortplot_html.rb +4 -12
- data/test/data/blast/2.2.15.blastp.m7 +876 -0
- data/test/data/embl/AB090716.embl.rel89 +63 -0
- data/test/data/fasta/example1.txt +75 -0
- data/test/data/fasta/example2.txt +21 -0
- data/test/data/iprscan/merged.raw +32 -0
- data/test/data/iprscan/merged.txt +74 -0
- data/test/data/soft/GDS100_partial.soft +92 -0
- data/test/data/soft/GSE3457_family_partial.soft +874 -0
- data/test/functional/bio/io/test_ensembl.rb +103 -0
- data/test/functional/bio/io/test_soapwsdl.rb +5 -17
- data/test/unit/bio/appl/bl2seq/test_report.rb +2 -2
- data/test/unit/bio/appl/blast/test_report.rb +3 -16
- data/test/unit/bio/appl/blast/test_xmlparser.rb +4 -16
- data/test/unit/bio/appl/genscan/test_report.rb +3 -16
- data/test/unit/bio/appl/hmmer/test_report.rb +3 -16
- data/test/unit/bio/appl/iprscan/test_report.rb +338 -0
- data/test/unit/bio/appl/mafft/test_report.rb +63 -0
- data/test/unit/bio/appl/sosui/test_report.rb +3 -16
- data/test/unit/bio/appl/targetp/test_report.rb +3 -16
- data/test/unit/bio/appl/test_blast.rb +3 -16
- data/test/unit/bio/appl/test_fasta.rb +4 -16
- data/test/unit/bio/appl/test_pts1.rb +140 -0
- data/test/unit/bio/appl/tmhmm/test_report.rb +3 -16
- data/test/unit/bio/data/test_aa.rb +4 -17
- data/test/unit/bio/data/test_codontable.rb +3 -16
- data/test/unit/bio/data/test_na.rb +3 -3
- data/test/unit/bio/db/embl/test_common.rb +3 -16
- data/test/unit/bio/db/embl/test_embl.rb +3 -16
- data/test/unit/bio/db/embl/test_embl_rel89.rb +219 -0
- data/test/unit/bio/db/embl/test_sptr.rb +1548 -41
- data/test/unit/bio/db/embl/test_uniprot.rb +3 -16
- data/test/unit/bio/db/kegg/test_genes.rb +3 -16
- data/test/unit/bio/db/pdb/test_pdb.rb +7 -24
- data/test/unit/bio/db/test_aaindex.rb +2 -2
- data/test/unit/bio/db/test_fasta.rb +3 -16
- data/test/unit/bio/db/test_gff.rb +3 -16
- data/test/unit/bio/db/test_lasergene.rb +95 -0
- data/test/unit/bio/db/test_newick.rb +56 -0
- data/test/unit/bio/db/test_nexus.rb +360 -0
- data/test/unit/bio/db/test_prosite.rb +5 -18
- data/test/unit/bio/db/test_rebase.rb +11 -25
- data/test/unit/bio/db/test_soft.rb +138 -0
- data/test/unit/bio/io/test_ddbjxml.rb +5 -17
- data/test/unit/bio/io/test_ensembl.rb +109 -0
- data/test/unit/bio/io/test_fastacmd.rb +3 -16
- data/test/unit/bio/io/test_flatfile.rb +237 -0
- data/test/unit/bio/io/test_soapwsdl.rb +4 -17
- data/test/unit/bio/sequence/test_aa.rb +3 -3
- data/test/unit/bio/sequence/test_common.rb +3 -16
- data/test/unit/bio/sequence/test_compat.rb +3 -16
- data/test/unit/bio/sequence/test_na.rb +29 -3
- data/test/unit/bio/shell/plugin/test_seq.rb +8 -8
- data/test/unit/bio/test_alignment.rb +16 -27
- data/test/unit/bio/test_command.rb +242 -25
- data/test/unit/bio/test_db.rb +3 -16
- data/test/unit/bio/test_feature.rb +4 -16
- data/test/unit/bio/test_location.rb +4 -16
- data/test/unit/bio/test_map.rb +230 -0
- data/test/unit/bio/test_pathway.rb +4 -16
- data/test/unit/bio/test_reference.rb +2 -2
- data/test/unit/bio/test_sequence.rb +7 -19
- data/test/unit/bio/test_shell.rb +3 -16
- data/test/unit/bio/test_tree.rb +593 -0
- data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +299 -0
- data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +103 -0
- data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +240 -0
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +100 -0
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +75 -0
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +73 -0
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +53 -0
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +104 -0
- data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +83 -0
- data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +246 -0
- data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +44 -0
- data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +115 -0
- data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +147 -0
- data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +147 -0
- data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +60 -0
- data/test/unit/bio/util/test_color_scheme.rb +6 -18
- data/test/unit/bio/util/test_contingency_table.rb +6 -18
- data/test/unit/bio/util/test_restriction_enzyme.rb +42 -0
- data/test/unit/bio/util/test_sirna.rb +3 -16
- metadata +228 -169
- data/doc/BioRuby.rd.ja +0 -225
- data/doc/Design.rd.ja +0 -341
- data/doc/TODO.rd.ja +0 -138
- data/lib/bio/appl/fasta/format6.rb +0 -37
- data/lib/bio/db/kegg/cell.rb +0 -88
- data/lib/bio/db/kegg/ko.rb +0 -178
- data/lib/bio/shell/rails/Rakefile +0 -10
- data/lib/bio/shell/rails/app/controllers/application.rb +0 -4
- data/lib/bio/shell/rails/app/controllers/shell_controller.rb +0 -94
- data/lib/bio/shell/rails/app/helpers/application_helper.rb +0 -3
- data/lib/bio/shell/rails/app/models/shell_connection.rb +0 -30
- data/lib/bio/shell/rails/app/views/layouts/shell.rhtml +0 -37
- data/lib/bio/shell/rails/app/views/shell/history.rhtml +0 -5
- data/lib/bio/shell/rails/app/views/shell/index.rhtml +0 -2
- data/lib/bio/shell/rails/app/views/shell/show.rhtml +0 -13
- data/lib/bio/shell/rails/config/boot.rb +0 -19
- data/lib/bio/shell/rails/config/database.yml +0 -85
- data/lib/bio/shell/rails/config/environment.rb +0 -53
- data/lib/bio/shell/rails/config/environments/development.rb +0 -19
- data/lib/bio/shell/rails/config/environments/production.rb +0 -19
- data/lib/bio/shell/rails/config/environments/test.rb +0 -19
- data/lib/bio/shell/rails/config/routes.rb +0 -19
- data/lib/bio/shell/rails/doc/README_FOR_APP +0 -2
- data/lib/bio/shell/rails/public/404.html +0 -8
- data/lib/bio/shell/rails/public/500.html +0 -8
- data/lib/bio/shell/rails/public/dispatch.cgi +0 -10
- data/lib/bio/shell/rails/public/dispatch.fcgi +0 -24
- data/lib/bio/shell/rails/public/dispatch.rb +0 -10
- data/lib/bio/shell/rails/public/favicon.ico +0 -0
- data/lib/bio/shell/rails/public/images/rails.png +0 -0
- data/lib/bio/shell/rails/public/index.html +0 -277
- data/lib/bio/shell/rails/public/javascripts/controls.js +0 -750
- data/lib/bio/shell/rails/public/javascripts/dragdrop.js +0 -584
- data/lib/bio/shell/rails/public/javascripts/effects.js +0 -854
- data/lib/bio/shell/rails/public/javascripts/prototype.js +0 -1785
- data/lib/bio/shell/rails/public/robots.txt +0 -1
- data/lib/bio/shell/rails/public/stylesheets/main.css +0 -187
- data/lib/bio/shell/rails/script/about +0 -3
- data/lib/bio/shell/rails/script/breakpointer +0 -3
- data/lib/bio/shell/rails/script/console +0 -3
- data/lib/bio/shell/rails/script/destroy +0 -3
- data/lib/bio/shell/rails/script/generate +0 -3
- data/lib/bio/shell/rails/script/performance/benchmarker +0 -3
- data/lib/bio/shell/rails/script/performance/profiler +0 -3
- data/lib/bio/shell/rails/script/plugin +0 -3
- data/lib/bio/shell/rails/script/process/reaper +0 -3
- data/lib/bio/shell/rails/script/process/spawner +0 -3
- data/lib/bio/shell/rails/script/process/spinner +0 -3
- data/lib/bio/shell/rails/script/runner +0 -3
- data/lib/bio/shell/rails/script/server +0 -42
- data/lib/bio/shell/rails/test/test_helper.rb +0 -28
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
#
|
|
2
|
-
# bio/db/genbank/genbank.rb - GenBank database class
|
|
2
|
+
# = bio/db/genbank/genbank.rb - GenBank database class
|
|
3
3
|
#
|
|
4
|
-
#
|
|
4
|
+
# Copyright:: Copyright (C) 2000-2005 Toshiaki Katayama <k@bioruby.org>
|
|
5
|
+
# License:: The Ruby License
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
-
# License as published by the Free Software Foundation; either
|
|
9
|
-
# version 2 of the License, or (at your option) any later version.
|
|
10
|
-
#
|
|
11
|
-
# This library is distributed in the hope that it will be useful,
|
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
-
# Lesser General Public License for more details.
|
|
15
|
-
#
|
|
16
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
-
# License along with this library; if not, write to the Free Software
|
|
18
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19
|
-
#
|
|
20
|
-
# $Id: genbank.rb,v 0.38 2005/12/07 11:23:51 k Exp $
|
|
7
|
+
# $Id: genbank.rb,v 0.40 2007/04/05 23:35:40 trevor Exp $
|
|
21
8
|
#
|
|
22
9
|
|
|
23
10
|
require 'bio/db'
|
|
24
11
|
require 'bio/db/genbank/common'
|
|
25
12
|
|
|
26
13
|
module Bio
|
|
14
|
+
|
|
15
|
+
# == Description
|
|
16
|
+
#
|
|
17
|
+
# Parses a GenBank formatted database entry
|
|
18
|
+
#
|
|
19
|
+
# == Example
|
|
20
|
+
#
|
|
21
|
+
# # entry is a string containing only one entry contents
|
|
22
|
+
# gb = Bio::GenBank.new(entry)
|
|
23
|
+
#
|
|
27
24
|
class GenBank < NCBIDB
|
|
28
25
|
|
|
29
26
|
include Bio::NCBIDB::Common
|
|
30
27
|
|
|
31
|
-
# LOCUS
|
|
28
|
+
# Parses the LOCUS line and returns contents of the LOCUS record
|
|
29
|
+
# as a Bio::GenBank::Locus object. Locus object is created automatically
|
|
30
|
+
# when Bio::GenBank#locus, entry_id etc. methods are called.
|
|
32
31
|
class Locus
|
|
33
32
|
def initialize(locus_line)
|
|
34
33
|
if locus_line.empty?
|
|
@@ -55,35 +54,23 @@ class GenBank < NCBIDB
|
|
|
55
54
|
:division, :date
|
|
56
55
|
end
|
|
57
56
|
|
|
57
|
+
# Accessor methods for the contents of the LOCUS record.
|
|
58
|
+
|
|
58
59
|
def locus
|
|
59
60
|
@data['LOCUS'] ||= Locus.new(get('LOCUS'))
|
|
60
61
|
end
|
|
61
|
-
def entry_id; locus.entry_id; end
|
|
62
|
-
def length; locus.length; end
|
|
63
|
-
def circular; locus.circular; end
|
|
64
|
-
def division; locus.division; end
|
|
65
|
-
def date; locus.date; end
|
|
66
62
|
|
|
67
|
-
def
|
|
68
|
-
def
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def seq
|
|
73
|
-
unless @data['SEQUENCE']
|
|
74
|
-
origin
|
|
75
|
-
end
|
|
76
|
-
Bio::Sequence::NA.new(@data['SEQUENCE'])
|
|
77
|
-
end
|
|
78
|
-
alias naseq seq
|
|
79
|
-
alias nalen length
|
|
63
|
+
def entry_id; locus.entry_id; end
|
|
64
|
+
def length; locus.length; end
|
|
65
|
+
def circular; locus.circular; end
|
|
66
|
+
def division; locus.division; end
|
|
67
|
+
def date; locus.date; end
|
|
80
68
|
|
|
81
|
-
def
|
|
82
|
-
|
|
83
|
-
end
|
|
69
|
+
def strand; locus.strand; end
|
|
70
|
+
def natype; locus.natype; end
|
|
84
71
|
|
|
85
72
|
|
|
86
|
-
# FEATURES
|
|
73
|
+
# FEATURES -- Iterate only for the 'CDS' portion of the Bio::Features.
|
|
87
74
|
def each_cds
|
|
88
75
|
features.each do |feature|
|
|
89
76
|
if feature.feature == 'CDS'
|
|
@@ -92,6 +79,7 @@ class GenBank < NCBIDB
|
|
|
92
79
|
end
|
|
93
80
|
end
|
|
94
81
|
|
|
82
|
+
# FEATURES -- Iterate only for the 'gene' portion of the Bio::Features.
|
|
95
83
|
def each_gene
|
|
96
84
|
features.each do |feature|
|
|
97
85
|
if feature.feature == 'gene'
|
|
@@ -101,7 +89,10 @@ class GenBank < NCBIDB
|
|
|
101
89
|
end
|
|
102
90
|
|
|
103
91
|
|
|
104
|
-
# BASE COUNT
|
|
92
|
+
# BASE COUNT (this field is obsoleted after GenBank release 138.0) --
|
|
93
|
+
# Returns the BASE COUNT as a Hash. When the base is specified, returns
|
|
94
|
+
# count of the base as a Fixnum. The base can be one of 'a', 't', 'g',
|
|
95
|
+
# 'c', and 'o' (others).
|
|
105
96
|
def basecount(base = nil)
|
|
106
97
|
unless @data['BASE COUNT']
|
|
107
98
|
hash = Hash.new(0)
|
|
@@ -119,6 +110,21 @@ class GenBank < NCBIDB
|
|
|
119
110
|
end
|
|
120
111
|
end
|
|
121
112
|
|
|
113
|
+
# ORIGIN -- Returns DNA sequence in the ORIGIN record as a
|
|
114
|
+
# Bio::Sequence::NA object.
|
|
115
|
+
def seq
|
|
116
|
+
unless @data['SEQUENCE']
|
|
117
|
+
origin
|
|
118
|
+
end
|
|
119
|
+
Bio::Sequence::NA.new(@data['SEQUENCE'])
|
|
120
|
+
end
|
|
121
|
+
alias naseq seq
|
|
122
|
+
alias nalen length
|
|
123
|
+
|
|
124
|
+
def seq_len
|
|
125
|
+
seq.length
|
|
126
|
+
end
|
|
127
|
+
|
|
122
128
|
end # GenBank
|
|
123
129
|
end # Bio
|
|
124
130
|
|
|
@@ -206,149 +212,4 @@ if __FILE__ == $0
|
|
|
206
212
|
end
|
|
207
213
|
|
|
208
214
|
|
|
209
|
-
=begin
|
|
210
|
-
|
|
211
|
-
= Bio::GenBank
|
|
212
|
-
|
|
213
|
-
=== Initialize
|
|
214
|
-
|
|
215
|
-
--- Bio::GenBank.new(entry)
|
|
216
|
-
|
|
217
|
-
=== LOCUS
|
|
218
|
-
|
|
219
|
-
--- Bio::GenBank#locus -> Bio::Locus
|
|
220
|
-
|
|
221
|
-
Returns contents of the LOCUS record as a Bio::GenBank::Locus object.
|
|
222
|
-
|
|
223
|
-
--- Bio::GenBank#entry_id -> String
|
|
224
|
-
--- Bio::GenBank#nalen -> Fixnum
|
|
225
|
-
--- Bio::GenBank#strand -> String
|
|
226
|
-
--- Bio::GenBank#natype -> String
|
|
227
|
-
--- Bio::GenBank#circular -> String
|
|
228
|
-
--- Bio::GenBank#division -> String
|
|
229
|
-
--- Bio::GenBank#date -> String
|
|
230
|
-
|
|
231
|
-
Access methods for the contents of the LOCUS record.
|
|
232
|
-
|
|
233
|
-
=== DEFINITION
|
|
234
|
-
|
|
235
|
-
--- Bio::GenBank#definition -> String
|
|
236
|
-
|
|
237
|
-
Returns contents of the DEFINITION record as a String.
|
|
238
|
-
|
|
239
|
-
=== ACCESSION
|
|
240
|
-
|
|
241
|
-
--- Bio::GenBank#accessions -> Array
|
|
242
|
-
|
|
243
|
-
Returns contents of the ACCESSION record as an Array.
|
|
244
|
-
|
|
245
|
-
=== VERSION
|
|
246
|
-
|
|
247
|
-
--- Bio::GenBank#versions -> Array
|
|
248
|
-
|
|
249
|
-
Returns contents of the VERSION record as an Array of Strings.
|
|
250
|
-
|
|
251
|
-
--- Bio::GenBank#acc_version -> String
|
|
252
|
-
--- Bio::GenBank#accession -> String
|
|
253
|
-
--- Bio::GenBank#version -> Fixnum
|
|
254
|
-
--- Bio::GenBank#gi -> String
|
|
255
|
-
|
|
256
|
-
Access methods for the contents of the VERSION record.
|
|
257
|
-
|
|
258
|
-
The 'acc_version' method returns the first part of the VERSION record
|
|
259
|
-
as a "ACCESSION.VERSION" String, 'accession' method returns the ACCESSION
|
|
260
|
-
part of the acc_version, 'version' method returns the VERSION part of the
|
|
261
|
-
acc_version as a Fixnum, and the 'gi' method returns the second part of
|
|
262
|
-
the VERSION record as a "GI:#######" String.
|
|
263
|
-
|
|
264
|
-
=== NID
|
|
265
|
-
|
|
266
|
-
--- Bio::GenBank#nid -> String
|
|
267
|
-
|
|
268
|
-
Returns contents of the NID record as a String.
|
|
269
|
-
|
|
270
|
-
=== KEYWORDS
|
|
271
|
-
|
|
272
|
-
--- Bio::GenBank#keywords -> Array
|
|
273
|
-
|
|
274
|
-
Returns contents of the KEYWORDS record as an Array of Strings.
|
|
275
|
-
|
|
276
|
-
=== SEGMENT
|
|
277
|
-
|
|
278
|
-
--- Bio::GenBank#segment -> String
|
|
279
|
-
|
|
280
|
-
Returns contents of the SEGMENT record as a "m/n" form String.
|
|
281
|
-
|
|
282
|
-
=== SOURCE
|
|
283
|
-
|
|
284
|
-
--- Bio::GenBank#source -> Hash
|
|
285
|
-
|
|
286
|
-
Returns contents of the SOURCE record as a Hash.
|
|
287
|
-
|
|
288
|
-
--- Bio::GenBank#common_name -> String
|
|
289
|
-
--- Bio::GenBank#vernacular_name -> String
|
|
290
|
-
--- Bio::GenBank#organism -> String
|
|
291
|
-
--- Bio::GenBank#taxonomy -> String
|
|
292
|
-
|
|
293
|
-
Access methods for the contents of the SOURCE record.
|
|
294
|
-
|
|
295
|
-
The 'common_name' method is same as source['common_name'].
|
|
296
|
-
The 'vernacular_name' method is an alias for the 'common_name'.
|
|
297
|
-
The 'organism' method is same as source['organism'].
|
|
298
|
-
The 'taxonomy' method is same as source['taxonomy'].
|
|
299
|
-
|
|
300
|
-
=== REFERENCE
|
|
301
|
-
|
|
302
|
-
--- Bio::GenBank#references -> Array
|
|
303
|
-
|
|
304
|
-
Returns contents of the REFERENCE records as an Array of Bio::Reference
|
|
305
|
-
objects.
|
|
306
|
-
|
|
307
|
-
=== COMMENT
|
|
308
|
-
|
|
309
|
-
--- Bio::GenBank#comment -> String
|
|
310
|
-
|
|
311
|
-
Returns contents of the COMMENT record as a String.
|
|
312
|
-
|
|
313
|
-
=== FEATURES
|
|
314
|
-
|
|
315
|
-
--- Bio::GenBank#features -> Bio::Features
|
|
316
|
-
|
|
317
|
-
Returns contents of the FEATURES record as a Bio::Features object.
|
|
318
|
-
|
|
319
|
-
--- Bio::GenBank#each_cds -> Array
|
|
320
|
-
|
|
321
|
-
Iterate only for the 'CDS' portion of the Bio::Features.
|
|
322
|
-
|
|
323
|
-
--- Bio::GenBank#each_gene -> Array
|
|
324
|
-
|
|
325
|
-
Iterate only for the 'gene' portion of the Bio::Features.
|
|
326
|
-
|
|
327
|
-
=== BASE COUNT
|
|
328
|
-
|
|
329
|
-
--- Bio::GenBank#basecount(base = nil) -> Hash or Fixnum
|
|
330
|
-
|
|
331
|
-
Returns the BASE COUNT as a Hash. When the base is specified, returns
|
|
332
|
-
count of the base as a Fixnum. The base can be one of 'a', 't', 'g',
|
|
333
|
-
'c', and 'o' (others).
|
|
334
|
-
|
|
335
|
-
=== ORIGIN
|
|
336
|
-
|
|
337
|
-
--- Bio::GenBank#origin -> String
|
|
338
|
-
|
|
339
|
-
Returns contents of the ORIGIN record as a String.
|
|
340
|
-
|
|
341
|
-
--- Bio::GenBank#naseq -> Bio::Sequence::NA
|
|
342
|
-
--- Bio::GenBank#seq -> Bio::Sequence::NA
|
|
343
|
-
|
|
344
|
-
Returns DNA sequence in the ORIGIN record as a Bio::Sequence::NA object.
|
|
345
|
-
|
|
346
|
-
== SEE ALSO
|
|
347
|
-
|
|
348
|
-
* ((<URL:ftp://ftp.ncbi.nih.gov/genbank/gbrel.txt>))
|
|
349
|
-
* ((<URL:http://www.ncbi.nlm.nih.gov/collab/FT/index.html>))
|
|
350
|
-
|
|
351
|
-
=end
|
|
352
|
-
|
|
353
|
-
|
|
354
215
|
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
#
|
|
2
|
-
# bio/db/genbank/genpept.rb - GenPept database class
|
|
2
|
+
# = bio/db/genbank/genpept.rb - GenPept database class
|
|
3
3
|
#
|
|
4
|
-
#
|
|
4
|
+
# Copyright:: Copyright (C) 2002-2004 Toshiaki Katayama <k@bioruby.org>
|
|
5
|
+
# License:: The Ruby License
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
-
# License as published by the Free Software Foundation; either
|
|
9
|
-
# version 2 of the License, or (at your option) any later version.
|
|
10
|
-
#
|
|
11
|
-
# This library is distributed in the hope that it will be useful,
|
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
-
# Lesser General Public License for more details.
|
|
15
|
-
#
|
|
16
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
-
# License along with this library; if not, write to the Free Software
|
|
18
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19
|
-
#
|
|
20
|
-
# $Id: genpept.rb,v 1.10 2005/10/23 07:20:37 k Exp $
|
|
7
|
+
# $Id: genpept.rb,v 1.12 2007/04/05 23:35:40 trevor Exp $
|
|
21
8
|
#
|
|
22
9
|
|
|
23
10
|
require 'bio/db/genbank/common'
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
#
|
|
2
|
-
# bio/db/genbank/refseq.rb - RefSeq database class
|
|
2
|
+
# = bio/db/genbank/refseq.rb - RefSeq database class
|
|
3
3
|
#
|
|
4
|
-
#
|
|
4
|
+
# Copyright:: Copyright (C) 2000-2004 Toshiaki Katayama <k@bioruby.org>
|
|
5
|
+
# License:: The Ruby License
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
8
|
-
# License as published by the Free Software Foundation; either
|
|
9
|
-
# version 2 of the License, or (at your option) any later version.
|
|
10
|
-
#
|
|
11
|
-
# This library is distributed in the hope that it will be useful,
|
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
-
# Lesser General Public License for more details.
|
|
15
|
-
#
|
|
16
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
17
|
-
# License along with this library; if not, write to the Free Software
|
|
18
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19
|
-
#
|
|
20
|
-
# $Id: refseq.rb,v 1.6 2004/08/23 23:40:35 k Exp $
|
|
7
|
+
# $Id: refseq.rb,v 1.8 2007/04/05 23:35:40 trevor Exp $
|
|
21
8
|
#
|
|
22
9
|
|
|
23
10
|
require 'bio/db/genbank/genbank'
|
data/lib/bio/db/gff.rb
CHANGED
|
@@ -3,45 +3,59 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Copyright:: Copyright (C) 2003, 2005
|
|
5
5
|
# Toshiaki Katayama <k@bioruby.org>
|
|
6
|
-
#
|
|
6
|
+
# 2006 Jan Aerts <jan.aerts@bbsrc.ac.uk>
|
|
7
|
+
# License:: The Ruby License
|
|
7
8
|
#
|
|
8
|
-
# $Id: gff.rb,v 1.
|
|
9
|
-
#
|
|
10
|
-
# == Description
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
# == Example
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
# == References
|
|
17
|
-
#
|
|
18
|
-
# * http://www.sanger.ac.uk/Software/formats/GFF/
|
|
19
|
-
#
|
|
20
|
-
#--
|
|
21
|
-
#
|
|
22
|
-
# This library is free software; you can redistribute it and/or
|
|
23
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
24
|
-
# License as published by the Free Software Foundation; either
|
|
25
|
-
# version 2 of the License, or (at your option) any later version.
|
|
26
|
-
#
|
|
27
|
-
# This library is distributed in the hope that it will be useful,
|
|
28
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
29
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
30
|
-
# Lesser General Public License for more details.
|
|
31
|
-
#
|
|
32
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
33
|
-
# License along with this library; if not, write to the Free Software
|
|
34
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
35
|
-
#
|
|
36
|
-
#++
|
|
9
|
+
# $Id: gff.rb,v 1.9 2007/05/18 15:23:42 k Exp $
|
|
37
10
|
#
|
|
38
11
|
|
|
39
12
|
module Bio
|
|
40
|
-
|
|
13
|
+
# == DESCRIPTION
|
|
14
|
+
# The Bio::GFF and Bio::GFF::Record classes describe data contained in a
|
|
15
|
+
# GFF-formatted file. For information on the GFF format, see
|
|
16
|
+
# http://www.sanger.ac.uk/Software/formats/GFF/. Data are represented in tab-
|
|
17
|
+
# delimited format, including
|
|
18
|
+
# * seqname
|
|
19
|
+
# * source
|
|
20
|
+
# * feature
|
|
21
|
+
# * start
|
|
22
|
+
# * end
|
|
23
|
+
# * score
|
|
24
|
+
# * strand
|
|
25
|
+
# * frame
|
|
26
|
+
# * attributes (optional)
|
|
27
|
+
#
|
|
28
|
+
# For example:
|
|
29
|
+
# SEQ1 EMBL atg 103 105 . + 0
|
|
30
|
+
# SEQ1 EMBL exon 103 172 . + 0
|
|
31
|
+
# SEQ1 EMBL splice5 172 173 . + .
|
|
32
|
+
# SEQ1 netgene splice5 172 173 0.94 + .
|
|
33
|
+
# SEQ1 genie sp5-20 163 182 2.3 + .
|
|
34
|
+
# SEQ1 genie sp5-10 168 177 2.1 + .
|
|
35
|
+
# SEQ1 grail ATG 17 19 2.1 - 0
|
|
36
|
+
#
|
|
37
|
+
# The Bio::GFF object is a container for Bio::GFF::Record objects, each
|
|
38
|
+
# representing a single line in the GFF file.
|
|
41
39
|
class GFF
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
# Creates a Bio::GFF object by building a collection of Bio::GFF::Record
|
|
41
|
+
# objects.
|
|
42
|
+
#
|
|
43
|
+
# Create a Bio::GFF object the hard way
|
|
44
|
+
# this_gff = "SEQ1\tEMBL\tatg\t103\t105\t.\t+\t0\n"
|
|
45
|
+
# this_gff << "SEQ1\tEMBL\texon\t103\t172\t.\t+\t0\n"
|
|
46
|
+
# this_gff << "SEQ1\tEMBL\tsplice5\t172\t173\t.\t+\t.\n"
|
|
47
|
+
# this_gff << "SEQ1\tnetgene\tsplice5\t172\t173\t0.94\t+\t.\n"
|
|
48
|
+
# this_gff << "SEQ1\tgenie\tsp5-20\t163\t182\t2.3\t+\t.\n"
|
|
49
|
+
# this_gff << "SEQ1\tgenie\tsp5-10\t168\t177\t2.1\t+\t.\n"
|
|
50
|
+
# this_gff << "SEQ1\tgrail\tATG\t17\t19\t2.1\t-\t0\n"
|
|
51
|
+
# p Bio::GFF.new(this_gff)
|
|
52
|
+
#
|
|
53
|
+
# or create one based on a GFF-formatted file:
|
|
54
|
+
# p Bio::GFF.new(File.open('my_data.gff')
|
|
55
|
+
# ---
|
|
56
|
+
# *Arguments*:
|
|
57
|
+
# * _str_: string in GFF format
|
|
58
|
+
# *Returns*:: Bio::GFF object
|
|
45
59
|
def initialize(str = '')
|
|
46
60
|
@records = Array.new
|
|
47
61
|
str.each_line do |line|
|
|
@@ -49,19 +63,48 @@ class GFF
|
|
|
49
63
|
end
|
|
50
64
|
end
|
|
51
65
|
|
|
66
|
+
# An array of Bio::GFF::Record objects.
|
|
67
|
+
attr_accessor :records
|
|
68
|
+
|
|
69
|
+
# Represents a single line of a GFF-formatted file. See Bio::GFF for more
|
|
70
|
+
# information.
|
|
52
71
|
class Record
|
|
53
72
|
|
|
73
|
+
# Name of the reference sequence
|
|
54
74
|
attr_accessor :seqname
|
|
75
|
+
|
|
76
|
+
# Name of the source of the feature (e.g. program that did prediction)
|
|
55
77
|
attr_accessor :source
|
|
78
|
+
|
|
79
|
+
# Name of the feature
|
|
56
80
|
attr_accessor :feature
|
|
81
|
+
|
|
82
|
+
# Start position of feature on reference sequence
|
|
57
83
|
attr_accessor :start
|
|
84
|
+
|
|
85
|
+
# End position of feature on reference sequence
|
|
58
86
|
attr_accessor :end
|
|
87
|
+
|
|
88
|
+
# Score of annotation (e.g. e-value for BLAST search)
|
|
59
89
|
attr_accessor :score
|
|
90
|
+
|
|
91
|
+
# Strand that feature is located on
|
|
60
92
|
attr_accessor :strand
|
|
93
|
+
|
|
94
|
+
# For features of type 'exon': indicates where feature begins in the reading frame
|
|
61
95
|
attr_accessor :frame
|
|
96
|
+
|
|
97
|
+
# List of tag=value pairs (e.g. to store name of the feature: ID=my_id)
|
|
62
98
|
attr_accessor :attributes
|
|
99
|
+
|
|
100
|
+
# Comments for the GFF record
|
|
63
101
|
attr_accessor :comments
|
|
64
102
|
|
|
103
|
+
# Creates a Bio::GFF::Record object. Is typically not called directly, but
|
|
104
|
+
# is called automatically when creating a Bio::GFF object.
|
|
105
|
+
# ---
|
|
106
|
+
# *Arguments*:
|
|
107
|
+
# * _str_: a tab-delimited line in GFF format
|
|
65
108
|
def initialize(str)
|
|
66
109
|
@comments = str.chomp[/#.*/]
|
|
67
110
|
return if /^#/.match(str)
|
|
@@ -82,12 +125,30 @@ class GFF
|
|
|
82
125
|
end
|
|
83
126
|
end
|
|
84
127
|
|
|
128
|
+
# = DESCRIPTION
|
|
129
|
+
# Represents version 2 of GFF specification. Is completely implemented by the
|
|
130
|
+
# Bio::GFF class.
|
|
85
131
|
class GFF2 < GFF
|
|
86
132
|
VERSION = 2
|
|
87
133
|
end
|
|
88
134
|
|
|
135
|
+
# = DESCRIPTION
|
|
136
|
+
# Represents version 3 of GFF specification. Is completely implemented by the
|
|
137
|
+
# Bio::GFF class. For more information on version GFF3, see
|
|
138
|
+
# http://flybase.bio.indiana.edu/annot/gff3.html
|
|
89
139
|
class GFF3 < GFF
|
|
90
140
|
VERSION = 3
|
|
141
|
+
|
|
142
|
+
private
|
|
143
|
+
|
|
144
|
+
def parse_attributes(attributes)
|
|
145
|
+
hash = Hash.new
|
|
146
|
+
attributes.split(/[^\\];/).each do |atr|
|
|
147
|
+
key, value = atr.split('=', 2)
|
|
148
|
+
hash[key] = value
|
|
149
|
+
end
|
|
150
|
+
return hash
|
|
151
|
+
end
|
|
91
152
|
end
|
|
92
153
|
|
|
93
154
|
end # class GFF
|
|
@@ -102,5 +163,12 @@ if __FILE__ == $0
|
|
|
102
163
|
rescue LoadError
|
|
103
164
|
end
|
|
104
165
|
|
|
105
|
-
|
|
166
|
+
this_gff = "SEQ1\tEMBL\tatg\t103\t105\t.\t+\t0\n"
|
|
167
|
+
this_gff << "SEQ1\tEMBL\texon\t103\t172\t.\t+\t0\n"
|
|
168
|
+
this_gff << "SEQ1\tEMBL\tsplice5\t172\t173\t.\t+\t.\n"
|
|
169
|
+
this_gff << "SEQ1\tnetgene\tsplice5\t172\t173\t0.94\t+\t.\n"
|
|
170
|
+
this_gff << "SEQ1\tgenie\tsp5-20\t163\t182\t2.3\t+\t.\n"
|
|
171
|
+
this_gff << "SEQ1\tgenie\tsp5-10\t168\t177\t2.1\t+\t.\n"
|
|
172
|
+
this_gff << "SEQ1\tgrail\tATG\t17\t19\t2.1\t-\t0\n"
|
|
173
|
+
p Bio::GFF.new(this_gff)
|
|
106
174
|
end
|