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
data/lib/bio/db/pdb.rb
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
#
|
|
2
|
-
# bio/db/pdb.rb - PDB database classes
|
|
2
|
+
# = bio/db/pdb.rb - PDB database classes
|
|
3
3
|
#
|
|
4
|
-
#
|
|
4
|
+
# Copyright:: Copyright (C) 2004
|
|
5
|
+
# GOTO Naohisa <ngoto@gen-info.osaka-u.ac.jp>
|
|
6
|
+
# License:: The Ruby License
|
|
5
7
|
#
|
|
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: pdb.rb,v 1.6 2006/01/29 06:54:13 ngoto Exp $
|
|
8
|
+
# $Id: pdb.rb,v 1.8 2007/04/05 23:35:40 trevor Exp $
|
|
21
9
|
#
|
|
22
10
|
|
|
23
11
|
require 'bio/db'
|
data/lib/bio/db/pdb/atom.rb
CHANGED
|
@@ -4,25 +4,9 @@
|
|
|
4
4
|
# Copyright:: Copyright (C) 2004, 2006
|
|
5
5
|
# Alex Gutteridge <alexg@ebi.ac.uk>
|
|
6
6
|
# Naohisa Goto <ng@bioruby.org>
|
|
7
|
-
# License::
|
|
7
|
+
# License:: The Ruby License
|
|
8
8
|
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#--
|
|
12
|
-
# This library is free software; you can redistribute it and/or
|
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
-
# License as published by the Free Software Foundation; either
|
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
|
16
|
-
#
|
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
-
# Lesser General Public License for more details.
|
|
21
|
-
#
|
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
-
# License along with this library; if not, write to the Free Software
|
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
-
#++
|
|
9
|
+
# $Id: atom.rb,v 1.8 2007/04/05 23:35:41 trevor Exp $
|
|
26
10
|
#
|
|
27
11
|
# = Bio::PDB::Coordinate
|
|
28
12
|
#
|
data/lib/bio/db/pdb/chain.rb
CHANGED
|
@@ -4,25 +4,9 @@
|
|
|
4
4
|
# Copyright:: Copyright (C) 2004, 2006
|
|
5
5
|
# Alex Gutteridge <alexg@ebi.ac.uk>
|
|
6
6
|
# Naohisa Goto <ng@bioruby.org>
|
|
7
|
-
# License::
|
|
7
|
+
# License:: The Ruby License
|
|
8
8
|
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#--
|
|
12
|
-
# This library is free software; you can redistribute it and/or
|
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
-
# License as published by the Free Software Foundation; either
|
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
|
16
|
-
#
|
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
-
# Lesser General Public License for more details.
|
|
21
|
-
#
|
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
-
# License along with this library; if not, write to the Free Software
|
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
-
#++
|
|
9
|
+
# $Id: chain.rb,v 1.8 2007/04/05 23:35:41 trevor Exp $
|
|
26
10
|
#
|
|
27
11
|
# = Bio::PDB::Chain
|
|
28
12
|
#
|
|
@@ -3,25 +3,9 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Copyright:: Copyright (C) 2006
|
|
5
5
|
# GOTO Naohisa <ngoto@gen-info.osaka-u.ac.jp>
|
|
6
|
-
# License::
|
|
6
|
+
# License:: The Ruby License
|
|
7
7
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#--
|
|
11
|
-
# This library is free software; you can redistribute it and/or
|
|
12
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
13
|
-
# License as published by the Free Software Foundation; either
|
|
14
|
-
# version 2 of the License, or (at your option) any later version.
|
|
15
|
-
#
|
|
16
|
-
# This library is distributed in the hope that it will be useful,
|
|
17
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19
|
-
# Lesser General Public License for more details.
|
|
20
|
-
#
|
|
21
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
22
|
-
# License along with this library; if not, write to the Free Software
|
|
23
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
24
|
-
#++
|
|
8
|
+
# $Id: chemicalcomponent.rb,v 1.3 2007/04/05 23:35:41 trevor Exp $
|
|
25
9
|
#
|
|
26
10
|
# = About Bio::PDB::ChemicalComponent
|
|
27
11
|
#
|
data/lib/bio/db/pdb/model.rb
CHANGED
|
@@ -4,25 +4,9 @@
|
|
|
4
4
|
# Copyright:: Copyright (C) 2004, 2006
|
|
5
5
|
# Alex Gutteridge <alexg@ebi.ac.uk>
|
|
6
6
|
# Naohisa Goto <ng@bioruby.org>
|
|
7
|
-
# License::
|
|
7
|
+
# License:: The Ruby License
|
|
8
8
|
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#--
|
|
12
|
-
# This library is free software; you can redistribute it and/or
|
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
-
# License as published by the Free Software Foundation; either
|
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
|
16
|
-
#
|
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
-
# Lesser General Public License for more details.
|
|
21
|
-
#
|
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
-
# License along with this library; if not, write to the Free Software
|
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
-
#++
|
|
9
|
+
# $Id: model.rb,v 1.9 2007/04/05 23:35:41 trevor Exp $
|
|
26
10
|
#
|
|
27
11
|
# = Bio::PDB::Model
|
|
28
12
|
#
|
data/lib/bio/db/pdb/pdb.rb
CHANGED
|
@@ -4,25 +4,9 @@
|
|
|
4
4
|
# Copyright:: Copyright (C) 2003-2006
|
|
5
5
|
# GOTO Naohisa <ngoto@gen-info.osaka-u.ac.jp>
|
|
6
6
|
# Alex Gutteridge <alexg@ebi.ac.uk>
|
|
7
|
-
# License::
|
|
7
|
+
# License:: The Ruby License
|
|
8
8
|
#
|
|
9
|
-
# $Id: pdb.rb,v 1.
|
|
10
|
-
#
|
|
11
|
-
#--
|
|
12
|
-
# This library is free software; you can redistribute it and/or
|
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
-
# License as published by the Free Software Foundation; either
|
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
|
16
|
-
#
|
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
-
# Lesser General Public License for more details.
|
|
21
|
-
#
|
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
-
# License along with this library; if not, write to the Free Software
|
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
-
#++
|
|
9
|
+
# $Id: pdb.rb,v 1.23 2007/07/10 10:44:46 ngoto Exp $
|
|
26
10
|
#
|
|
27
11
|
# = About Bio::PDB
|
|
28
12
|
#
|
|
@@ -135,7 +119,7 @@ module Bio
|
|
|
135
119
|
m
|
|
136
120
|
end
|
|
137
121
|
def self.new(str)
|
|
138
|
-
String.new(str)
|
|
122
|
+
String.new(str.to_s)
|
|
139
123
|
end
|
|
140
124
|
end
|
|
141
125
|
|
|
@@ -354,7 +338,7 @@ module Bio
|
|
|
354
338
|
# need to call it .
|
|
355
339
|
#
|
|
356
340
|
def do_parse
|
|
357
|
-
return self if @parsed
|
|
341
|
+
return self if @parsed or !@str
|
|
358
342
|
str = @str
|
|
359
343
|
each_symbol do |key, klass, ranges|
|
|
360
344
|
#If we only have one range then pull that out
|
|
@@ -990,31 +974,79 @@ module Bio
|
|
|
990
974
|
end
|
|
991
975
|
|
|
992
976
|
def do_parse
|
|
993
|
-
return self if @parsed
|
|
977
|
+
return self if @parsed or !@str
|
|
994
978
|
self.serial = @str[6..10].to_i
|
|
995
|
-
self.name = @str[12..15]
|
|
979
|
+
self.name = @str[12..15].strip
|
|
996
980
|
self.altLoc = @str[16..16]
|
|
997
|
-
self.resName = @str[17..19].
|
|
981
|
+
self.resName = @str[17..19].strip
|
|
998
982
|
self.chainID = @str[21..21]
|
|
999
983
|
self.resSeq = @str[22..25].to_i
|
|
1000
|
-
self.iCode = @str[26..26]
|
|
984
|
+
self.iCode = @str[26..26].strip
|
|
1001
985
|
self.x = @str[30..37].to_f
|
|
1002
986
|
self.y = @str[38..45].to_f
|
|
1003
987
|
self.z = @str[46..53].to_f
|
|
1004
988
|
self.occupancy = @str[54..59].to_f
|
|
1005
989
|
self.tempFactor = @str[60..65].to_f
|
|
1006
|
-
self.segID = @str[72..75]
|
|
1007
|
-
self.element = @str[76..77]
|
|
1008
|
-
self.charge = @str[78..79]
|
|
990
|
+
self.segID = @str[72..75].to_s.rstrip
|
|
991
|
+
self.element = @str[76..77].to_s.lstrip
|
|
992
|
+
self.charge = @str[78..79].to_s.strip
|
|
1009
993
|
@parsed = true
|
|
1010
994
|
self
|
|
1011
995
|
end
|
|
1012
996
|
|
|
997
|
+
def justify_atomname
|
|
998
|
+
atomname = self.name.to_s
|
|
999
|
+
return atomname[0, 4] if atomname.length >= 4
|
|
1000
|
+
case atomname.length
|
|
1001
|
+
when 0
|
|
1002
|
+
return ' '
|
|
1003
|
+
when 1
|
|
1004
|
+
return ' ' + atomname + ' '
|
|
1005
|
+
when 2
|
|
1006
|
+
if /\A[0-9]/ =~ atomname then
|
|
1007
|
+
return sprintf('%-4s', atomname)
|
|
1008
|
+
elsif /[0-9]\z/ =~ atomname then
|
|
1009
|
+
return sprintf(' %-3s', atomname)
|
|
1010
|
+
end
|
|
1011
|
+
when 3
|
|
1012
|
+
if /\A[0-9]/ =~ atomname then
|
|
1013
|
+
return sprintf('%-4s', atomname)
|
|
1014
|
+
end
|
|
1015
|
+
end
|
|
1016
|
+
# ambiguous case for two- or three-letter name
|
|
1017
|
+
elem = self.element.to_s.strip
|
|
1018
|
+
if elem.size > 0 and i = atomname.index(elem) then
|
|
1019
|
+
if i == 0 and elem.size == 1 then
|
|
1020
|
+
return sprintf(' %-3s', atomname)
|
|
1021
|
+
else
|
|
1022
|
+
return sprintf('%-4s', atomname)
|
|
1023
|
+
end
|
|
1024
|
+
end
|
|
1025
|
+
if self.kind_of?(HETATM) then
|
|
1026
|
+
if /\A(B[^AEHIKR]|C[^ADEFLMORSU]|F[^EMR]|H[^EFGOS]|I[^NR]|K[^R]|N[^ABDEIOP]|O[^S]|P[^ABDMORTU]|S[^BCEGIMNR]|V|W|Y[^B])/ =~
|
|
1027
|
+
atomname then
|
|
1028
|
+
return sprintf(' %-3s', atomname)
|
|
1029
|
+
else
|
|
1030
|
+
return sprintf('%-4s', atomname)
|
|
1031
|
+
end
|
|
1032
|
+
else # ATOM
|
|
1033
|
+
if /\A[CHONSP]/ =~ atomname then
|
|
1034
|
+
return sprintf(' %-3s', atomname)
|
|
1035
|
+
else
|
|
1036
|
+
return sprintf('%-4s', atomname)
|
|
1037
|
+
end
|
|
1038
|
+
end
|
|
1039
|
+
# could not be reached here
|
|
1040
|
+
raise 'bug!'
|
|
1041
|
+
end
|
|
1042
|
+
private :justify_atomname
|
|
1043
|
+
|
|
1013
1044
|
def to_s
|
|
1045
|
+
atomname = justify_atomname
|
|
1014
1046
|
sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s %8.3f%8.3f%8.3f%6.2f%6.2f %-4s%2s%-2s\n",
|
|
1015
1047
|
self.record_name,
|
|
1016
1048
|
self.serial,
|
|
1017
|
-
|
|
1049
|
+
atomname,
|
|
1018
1050
|
self.altLoc,
|
|
1019
1051
|
self.resName,
|
|
1020
1052
|
self.chainID,
|
|
@@ -1503,6 +1535,7 @@ module Bio
|
|
|
1503
1535
|
|
|
1504
1536
|
when 'MODEL'
|
|
1505
1537
|
c_atom = nil
|
|
1538
|
+
cChain = nil
|
|
1506
1539
|
if cModel.model_serial or cModel.chains.size > 0 then
|
|
1507
1540
|
self.addModel(cModel)
|
|
1508
1541
|
end
|
|
@@ -1641,7 +1674,7 @@ module Bio
|
|
|
1641
1674
|
# p pdb.record['HETATM']
|
|
1642
1675
|
#
|
|
1643
1676
|
def record(name = nil)
|
|
1644
|
-
name ? @hash[name] : @hash
|
|
1677
|
+
name ? (@hash[name] || []) : @hash
|
|
1645
1678
|
end
|
|
1646
1679
|
|
|
1647
1680
|
#--
|
|
@@ -1804,12 +1837,13 @@ module Bio
|
|
|
1804
1837
|
|
|
1805
1838
|
# Classification in "HEADER".
|
|
1806
1839
|
def classification
|
|
1807
|
-
self.record('HEADER').first
|
|
1840
|
+
f = self.record('HEADER').first
|
|
1841
|
+
f ? f.classification : nil
|
|
1808
1842
|
end
|
|
1809
1843
|
|
|
1810
1844
|
# Get authors in "AUTHOR".
|
|
1811
1845
|
def authors
|
|
1812
|
-
self.record('AUTHOR').
|
|
1846
|
+
self.record('AUTHOR').collect { |f| f.authorList }.flatten
|
|
1813
1847
|
end
|
|
1814
1848
|
|
|
1815
1849
|
#--
|
|
@@ -1818,7 +1852,10 @@ module Bio
|
|
|
1818
1852
|
|
|
1819
1853
|
# PDB identifier written in "HEADER". (e.g. 1A00)
|
|
1820
1854
|
def entry_id
|
|
1821
|
-
|
|
1855
|
+
unless @id
|
|
1856
|
+
f = self.record('HEADER').first
|
|
1857
|
+
@id = f ? f.idCode : nil
|
|
1858
|
+
end
|
|
1822
1859
|
@id
|
|
1823
1860
|
end
|
|
1824
1861
|
|
|
@@ -1829,12 +1866,14 @@ module Bio
|
|
|
1829
1866
|
|
|
1830
1867
|
# Title of this entry in "TITLE".
|
|
1831
1868
|
def definition
|
|
1832
|
-
self.record('TITLE').first
|
|
1869
|
+
f = self.record('TITLE').first
|
|
1870
|
+
f ? f.title : nil
|
|
1833
1871
|
end
|
|
1834
1872
|
|
|
1835
1873
|
# Current modification number in "REVDAT".
|
|
1836
1874
|
def version
|
|
1837
|
-
self.record('REVDAT').first
|
|
1875
|
+
f = self.record('REVDAT').first
|
|
1876
|
+
f ? f.modNum : nil
|
|
1838
1877
|
end
|
|
1839
1878
|
|
|
1840
1879
|
end #class PDB
|
data/lib/bio/db/pdb/residue.rb
CHANGED
|
@@ -4,25 +4,9 @@
|
|
|
4
4
|
# Copyright:: Copyright (C) 2004, 2006
|
|
5
5
|
# Alex Gutteridge <alexg@ebi.ac.uk>
|
|
6
6
|
# Naohisa Goto <ng@bioruby.org>
|
|
7
|
-
# License::
|
|
7
|
+
# License:: The Ruby License
|
|
8
8
|
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#--
|
|
12
|
-
# This library is free software; you can redistribute it and/or
|
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
-
# License as published by the Free Software Foundation; either
|
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
|
16
|
-
#
|
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
-
# Lesser General Public License for more details.
|
|
21
|
-
#
|
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
-
# License along with this library; if not, write to the Free Software
|
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
-
#++
|
|
9
|
+
# $Id: residue.rb,v 1.13 2007/04/23 16:03:25 ngoto Exp $
|
|
26
10
|
#
|
|
27
11
|
# = Bio::PDB::Residue
|
|
28
12
|
#
|
|
@@ -81,9 +65,9 @@ module Bio
|
|
|
81
65
|
# Now, Residue#id is an alias of residue_id.
|
|
82
66
|
alias id residue_id
|
|
83
67
|
|
|
84
|
-
#Keyed access to atoms based on
|
|
68
|
+
#Keyed access to atoms based on atom name e.g. ["CA"]
|
|
85
69
|
def [](key)
|
|
86
|
-
atom = @atoms.find{ |atom| key == atom.
|
|
70
|
+
atom = @atoms.find{ |atom| key == atom.name }
|
|
87
71
|
end
|
|
88
72
|
|
|
89
73
|
# Updates residue id. This is a private method.
|
data/lib/bio/db/pdb/utils.rb
CHANGED
|
@@ -4,25 +4,9 @@
|
|
|
4
4
|
# Copyright:: Copyright (C) 2004, 2006
|
|
5
5
|
# Alex Gutteridge <alexg@ebi.ac.uk>
|
|
6
6
|
# Naohisa Goto <ng@bioruby.org>
|
|
7
|
-
# License::
|
|
7
|
+
# License:: The Ruby License
|
|
8
8
|
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#--
|
|
12
|
-
# This library is free software; you can redistribute it and/or
|
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
-
# License as published by the Free Software Foundation; either
|
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
|
16
|
-
#
|
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
-
# Lesser General Public License for more details.
|
|
21
|
-
#
|
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
-
# License along with this library; if not, write to the Free Software
|
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
-
#++
|
|
9
|
+
# $Id: utils.rb,v 1.7 2007/04/05 23:35:41 trevor Exp $
|
|
26
10
|
#
|
|
27
11
|
# = Bio::PDB::Utils
|
|
28
12
|
#
|
data/lib/bio/db/prosite.rb
CHANGED
|
@@ -1,525 +1,506 @@
|
|
|
1
1
|
#
|
|
2
2
|
# = bio/db/prosite.rb - PROSITE database class
|
|
3
3
|
#
|
|
4
|
-
# Copyright:: Copyright (C) 2001
|
|
5
|
-
# Licence::
|
|
4
|
+
# Copyright:: Copyright (C) 2001 Toshiaki Katayama <k@bioruby.org>
|
|
5
|
+
# Licence:: Ruby's
|
|
6
6
|
#
|
|
7
|
-
# $Id: prosite.rb,v 0.
|
|
8
|
-
#
|
|
9
|
-
# == Description
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# == Example
|
|
13
|
-
# == References
|
|
14
|
-
#--
|
|
15
|
-
#
|
|
16
|
-
# This library is free software; you can redistribute it and/or
|
|
17
|
-
# modify it under the terms of the GNU Lesser General Public
|
|
18
|
-
# License as published by the Free Software Foundation; either
|
|
19
|
-
# version 2 of the License, or (at your option) any later version.
|
|
20
|
-
#
|
|
21
|
-
# This library is distributed in the hope that it will be useful,
|
|
22
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
23
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
24
|
-
# Lesser General Public License for more details.
|
|
25
|
-
#
|
|
26
|
-
# You should have received a copy of the GNU Lesser General Public
|
|
27
|
-
# License along with this library; if not, write to the Free Software
|
|
28
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
29
|
-
#
|
|
30
|
-
#++
|
|
7
|
+
# $Id: prosite.rb,v 0.16 2006/09/19 06:03:51 k Exp $
|
|
31
8
|
#
|
|
32
9
|
|
|
33
10
|
require 'bio/db'
|
|
34
11
|
|
|
35
12
|
module Bio
|
|
36
13
|
|
|
37
|
-
|
|
14
|
+
class PROSITE < EMBLDB
|
|
38
15
|
|
|
39
|
-
|
|
40
|
-
|
|
16
|
+
# Delimiter
|
|
17
|
+
DELIMITER = "\n//\n"
|
|
41
18
|
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
# Delimiter
|
|
20
|
+
RS = DELIMITER
|
|
44
21
|
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
# Bio::DB API
|
|
23
|
+
TAGSIZE = 5
|
|
47
24
|
|
|
48
25
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
26
|
+
def initialize(entry)
|
|
27
|
+
super(entry, TAGSIZE)
|
|
28
|
+
end
|
|
52
29
|
|
|
53
30
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
end
|
|
63
|
-
@data['ID']
|
|
31
|
+
# ID Identification (Begins each entry; 1 per entry)
|
|
32
|
+
#
|
|
33
|
+
# ID ENTRY_NAME; ENTRY_TYPE. (ENTRY_TYPE : PATTERN, MATRIX, RULE)
|
|
34
|
+
#
|
|
35
|
+
# Returns
|
|
36
|
+
def name
|
|
37
|
+
unless @data['ID']
|
|
38
|
+
@data['ID'], @data['TYPE'] = fetch('ID').chomp('.').split('; ')
|
|
64
39
|
end
|
|
40
|
+
@data['ID']
|
|
41
|
+
end
|
|
65
42
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
end
|
|
71
|
-
@data['TYPE']
|
|
43
|
+
# Returns
|
|
44
|
+
def division
|
|
45
|
+
unless @data['TYPE']
|
|
46
|
+
name
|
|
72
47
|
end
|
|
48
|
+
@data['TYPE']
|
|
49
|
+
end
|
|
73
50
|
|
|
74
51
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
end
|
|
84
|
-
@data['AC']
|
|
52
|
+
# AC Accession number (1 per entry)
|
|
53
|
+
#
|
|
54
|
+
# AC PSnnnnn;
|
|
55
|
+
#
|
|
56
|
+
# Returns
|
|
57
|
+
def ac
|
|
58
|
+
unless @data['AC']
|
|
59
|
+
@data['AC'] = fetch('AC').chomp(';')
|
|
85
60
|
end
|
|
61
|
+
@data['AC']
|
|
62
|
+
end
|
|
86
63
|
|
|
87
|
-
|
|
64
|
+
alias entry_id ac
|
|
88
65
|
|
|
89
66
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
67
|
+
# DT Date (1 per entry)
|
|
68
|
+
#
|
|
69
|
+
# DT MMM-YYYY (CREATED); MMM-YYYY (DATA UPDATE); MMM-YYYY (INFO UPDATE).
|
|
70
|
+
#
|
|
71
|
+
# Returns
|
|
72
|
+
def dt
|
|
73
|
+
field_fetch('DT')
|
|
74
|
+
end
|
|
98
75
|
|
|
99
|
-
|
|
76
|
+
alias date dt
|
|
100
77
|
|
|
101
78
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
79
|
+
# DE Short description (1 per entry)
|
|
80
|
+
#
|
|
81
|
+
# DE Description.
|
|
82
|
+
#
|
|
83
|
+
# Returns
|
|
84
|
+
def de
|
|
85
|
+
field_fetch('DE')
|
|
86
|
+
end
|
|
110
87
|
|
|
111
|
-
|
|
88
|
+
alias definition de
|
|
112
89
|
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
91
|
+
# PA Pattern (>=0 per entry)
|
|
92
|
+
#
|
|
93
|
+
# see - pa2re method
|
|
94
|
+
#
|
|
95
|
+
# Returns
|
|
96
|
+
def pa
|
|
97
|
+
field_fetch('PA')
|
|
98
|
+
@data['PA'] = fetch('PA') unless @data['PA']
|
|
99
|
+
@data['PA'].gsub!(/\s+/, '') if @data['PA']
|
|
100
|
+
@data['PA']
|
|
101
|
+
end
|
|
125
102
|
|
|
126
|
-
|
|
103
|
+
alias pattern pa
|
|
127
104
|
|
|
128
105
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
106
|
+
# MA Matrix/profile (>=0 per entry)
|
|
107
|
+
#
|
|
108
|
+
# see - ma2re method
|
|
109
|
+
#
|
|
110
|
+
# Returns
|
|
111
|
+
def ma
|
|
112
|
+
field_fetch('MA')
|
|
113
|
+
end
|
|
137
114
|
|
|
138
|
-
|
|
115
|
+
alias profile ma
|
|
139
116
|
|
|
140
117
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
118
|
+
# RU Rule (>=0 per entry)
|
|
119
|
+
#
|
|
120
|
+
# RU Rule_Description.
|
|
121
|
+
#
|
|
122
|
+
# The rule is described in ordinary English and is free-format.
|
|
123
|
+
#
|
|
124
|
+
# Returns
|
|
125
|
+
def ru
|
|
126
|
+
field_fetch('RU')
|
|
127
|
+
end
|
|
151
128
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
end
|
|
188
|
-
hash[k] = v
|
|
129
|
+
alias rule ru
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# NR Numerical results (>=0 per entry)
|
|
133
|
+
#
|
|
134
|
+
# - SWISS-PROT scan statistics of true and false positives/negatives
|
|
135
|
+
#
|
|
136
|
+
# /RELEASE SWISS-PROT release number and total number of sequence
|
|
137
|
+
# entries in that release.
|
|
138
|
+
# /TOTAL Total number of hits in SWISS-PROT.
|
|
139
|
+
# /POSITIVE Number of hits on proteins that are known to belong to the
|
|
140
|
+
# set in consideration.
|
|
141
|
+
# /UNKNOWN Number of hits on proteins that could possibly belong to
|
|
142
|
+
# the set in consideration.
|
|
143
|
+
# /FALSE_POS Number of false hits (on unrelated proteins).
|
|
144
|
+
# /FALSE_NEG Number of known missed hits.
|
|
145
|
+
# /PARTIAL Number of partial sequences which belong to the set in
|
|
146
|
+
# consideration, but which are not hit by the pattern or
|
|
147
|
+
# profile because they are partial (fragment) sequences.
|
|
148
|
+
#
|
|
149
|
+
# Returns
|
|
150
|
+
def nr
|
|
151
|
+
unless @data['NR']
|
|
152
|
+
hash = {} # temporal hash
|
|
153
|
+
fetch('NR').scan(%r{/(\S+)=([^;]+);}).each do |k, v|
|
|
154
|
+
if v =~ /^(\d+)\((\d+)\)$/
|
|
155
|
+
hits = $1.to_i # the number of hits
|
|
156
|
+
seqs = $2.to_i # the number of sequences
|
|
157
|
+
v = [hits, seqs]
|
|
158
|
+
elsif v =~ /([\d\.]+),(\d+)/
|
|
159
|
+
sprel = $1 # the number of SWISS-PROT release
|
|
160
|
+
spseq = $2.to_i # the number of SWISS-PROT sequences
|
|
161
|
+
v = [sprel, spseq]
|
|
162
|
+
else
|
|
163
|
+
v = v.to_i
|
|
189
164
|
end
|
|
190
|
-
|
|
165
|
+
hash[k] = v
|
|
191
166
|
end
|
|
192
|
-
@data['NR']
|
|
167
|
+
@data['NR'] = hash
|
|
193
168
|
end
|
|
169
|
+
@data['NR']
|
|
170
|
+
end
|
|
194
171
|
|
|
195
|
-
|
|
172
|
+
alias statistics nr
|
|
196
173
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
174
|
+
# Returns
|
|
175
|
+
def release
|
|
176
|
+
statistics['RELEASE']
|
|
177
|
+
end
|
|
201
178
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
179
|
+
# Returns
|
|
180
|
+
def swissprot_release_number
|
|
181
|
+
release.first
|
|
182
|
+
end
|
|
206
183
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
184
|
+
# Returns
|
|
185
|
+
def swissprot_release_sequences
|
|
186
|
+
release.last
|
|
187
|
+
end
|
|
211
188
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
189
|
+
# Returns
|
|
190
|
+
def total
|
|
191
|
+
statistics['TOTAL']
|
|
192
|
+
end
|
|
216
193
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
194
|
+
# Returns
|
|
195
|
+
def total_hits
|
|
196
|
+
total.first
|
|
197
|
+
end
|
|
221
198
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
199
|
+
# Returns
|
|
200
|
+
def total_sequences
|
|
201
|
+
total.last
|
|
202
|
+
end
|
|
226
203
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
204
|
+
# Returns
|
|
205
|
+
def positive
|
|
206
|
+
statistics['POSITIVE']
|
|
207
|
+
end
|
|
231
208
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
209
|
+
# Returns
|
|
210
|
+
def positive_hits
|
|
211
|
+
positive.first
|
|
212
|
+
end
|
|
236
213
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
214
|
+
# Returns
|
|
215
|
+
def positive_sequences
|
|
216
|
+
positive.last
|
|
217
|
+
end
|
|
241
218
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
219
|
+
# Returns
|
|
220
|
+
def unknown
|
|
221
|
+
statistics['UNKNOWN']
|
|
222
|
+
end
|
|
246
223
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
224
|
+
# Returns
|
|
225
|
+
def unknown_hits
|
|
226
|
+
unknown.first
|
|
227
|
+
end
|
|
251
228
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
229
|
+
# Returns
|
|
230
|
+
def unknown_sequences
|
|
231
|
+
unknown.last
|
|
232
|
+
end
|
|
256
233
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
234
|
+
# Returns
|
|
235
|
+
def false_pos
|
|
236
|
+
statistics['FALSE_POS']
|
|
237
|
+
end
|
|
261
238
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
239
|
+
# Returns
|
|
240
|
+
def false_positive_hits
|
|
241
|
+
false_pos.first
|
|
242
|
+
end
|
|
266
243
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
244
|
+
# Returns
|
|
245
|
+
def false_positive_sequences
|
|
246
|
+
false_pos.last
|
|
247
|
+
end
|
|
271
248
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
249
|
+
# Returns
|
|
250
|
+
def false_neg
|
|
251
|
+
statistics['FALSE_NEG']
|
|
252
|
+
end
|
|
253
|
+
alias false_negative_hits false_neg
|
|
277
254
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
255
|
+
# Returns
|
|
256
|
+
def partial
|
|
257
|
+
statistics['PARTIAL']
|
|
258
|
+
end
|
|
282
259
|
|
|
283
260
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
end
|
|
302
|
-
@data['CC'] = hash
|
|
261
|
+
# CC Comments (>=0 per entry)
|
|
262
|
+
#
|
|
263
|
+
# CC /QUALIFIER=data; /QUALIFIER=data; .......
|
|
264
|
+
#
|
|
265
|
+
# /TAXO-RANGE Taxonomic range.
|
|
266
|
+
# /MAX-REPEAT Maximum known number of repetitions of the pattern in a
|
|
267
|
+
# single protein.
|
|
268
|
+
# /SITE Indication of an `interesting' site in the pattern.
|
|
269
|
+
# /SKIP-FLAG Indication of an entry that can be, in some cases, ignored
|
|
270
|
+
# by a program (because it is too unspecific).
|
|
271
|
+
#
|
|
272
|
+
# Returns
|
|
273
|
+
def cc
|
|
274
|
+
unless @data['CC']
|
|
275
|
+
hash = {} # temporal hash
|
|
276
|
+
fetch('CC').scan(%r{/(\S+)=([^;]+);}).each do |k, v|
|
|
277
|
+
hash[k] = v
|
|
303
278
|
end
|
|
304
|
-
@data['CC']
|
|
279
|
+
@data['CC'] = hash
|
|
305
280
|
end
|
|
281
|
+
@data['CC']
|
|
282
|
+
end
|
|
306
283
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
end
|
|
284
|
+
alias comment cc
|
|
285
|
+
|
|
286
|
+
# Returns
|
|
287
|
+
def taxon_range(expand = nil)
|
|
288
|
+
range = comment['TAXO-RANGE']
|
|
289
|
+
if range and expand
|
|
290
|
+
expand = []
|
|
291
|
+
range.scan(/./) do |x|
|
|
292
|
+
case x
|
|
293
|
+
when 'A'; expand.push('archaebacteria')
|
|
294
|
+
when 'B'; expand.push('bacteriophages')
|
|
295
|
+
when 'E'; expand.push('eukaryotes')
|
|
296
|
+
when 'P'; expand.push('prokaryotes')
|
|
297
|
+
when 'V'; expand.push('eukaryotic viruses')
|
|
322
298
|
end
|
|
323
|
-
range = expand
|
|
324
299
|
end
|
|
325
|
-
|
|
300
|
+
range = expand
|
|
326
301
|
end
|
|
302
|
+
return range
|
|
303
|
+
end
|
|
327
304
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
305
|
+
# Returns
|
|
306
|
+
def max_repeat
|
|
307
|
+
comment['MAX-REPEAT'].to_i
|
|
308
|
+
end
|
|
332
309
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
end
|
|
338
|
-
return [num.to_i, desc]
|
|
310
|
+
# Returns
|
|
311
|
+
def site
|
|
312
|
+
if comment['SITE']
|
|
313
|
+
num, desc = comment['SITE'].split(',')
|
|
339
314
|
end
|
|
315
|
+
return [num.to_i, desc]
|
|
316
|
+
end
|
|
340
317
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
end
|
|
318
|
+
# Returns
|
|
319
|
+
def skip_flag
|
|
320
|
+
if comment['SKIP-FLAG'] == 'TRUE'
|
|
321
|
+
return true
|
|
346
322
|
end
|
|
323
|
+
end
|
|
347
324
|
|
|
348
325
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
end
|
|
326
|
+
# DR Cross-references to SWISS-PROT (>=0 per entry)
|
|
327
|
+
#
|
|
328
|
+
# DR AC_NB, ENTRY_NAME, C; AC_NB, ENTRY_NAME, C; AC_NB, ENTRY_NAME, C;
|
|
329
|
+
#
|
|
330
|
+
# - `AC_NB' is the SWISS-PROT primary accession number of the entry to
|
|
331
|
+
# which reference is being made.
|
|
332
|
+
# - `ENTRY_NAME' is the SWISS-PROT entry name.
|
|
333
|
+
# - `C' is a one character flag that can be one of the following:
|
|
334
|
+
#
|
|
335
|
+
# T For a true positive.
|
|
336
|
+
# N For a false negative; a sequence which belongs to the set under
|
|
337
|
+
# consideration, but which has not been picked up by the pattern or
|
|
338
|
+
# profile.
|
|
339
|
+
# P For a `potential' hit; a sequence that belongs to the set under
|
|
340
|
+
# consideration, but which was not picked up because the region(s) that
|
|
341
|
+
# are used as a 'fingerprint' (pattern or profile) is not yet available
|
|
342
|
+
# in the data bank (partial sequence).
|
|
343
|
+
# ? For an unknown; a sequence which possibly could belong to the set under
|
|
344
|
+
# consideration.
|
|
345
|
+
# F For a false positive; a sequence which does not belong to the set in
|
|
346
|
+
# consideration.
|
|
347
|
+
#
|
|
348
|
+
# Returns
|
|
349
|
+
def dr
|
|
350
|
+
unless @data['DR']
|
|
351
|
+
hash = {} # temporal hash
|
|
352
|
+
if fetch('DR')
|
|
353
|
+
fetch('DR').scan(/(\w+)\s*, (\w+)\s*, (.);/).each do |a, e, c|
|
|
354
|
+
hash[a] = [e, c] # SWISS-PROT : accession, entry, true/false
|
|
379
355
|
end
|
|
380
|
-
@data['DR'] = hash
|
|
381
356
|
end
|
|
382
|
-
@data['DR']
|
|
357
|
+
@data['DR'] = hash
|
|
383
358
|
end
|
|
359
|
+
@data['DR']
|
|
360
|
+
end
|
|
384
361
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
end
|
|
362
|
+
alias sp_xref dr
|
|
363
|
+
|
|
364
|
+
# Returns
|
|
365
|
+
def list_xref(flag, by_name = nil)
|
|
366
|
+
ary = []
|
|
367
|
+
sp_xref.each do |sp_acc, value|
|
|
368
|
+
if value[1] == flag
|
|
369
|
+
if by_name
|
|
370
|
+
sp_name = value[0]
|
|
371
|
+
ary.push(sp_name)
|
|
372
|
+
else
|
|
373
|
+
ary.push(sp_acc)
|
|
398
374
|
end
|
|
399
375
|
end
|
|
400
|
-
return ary
|
|
401
376
|
end
|
|
377
|
+
return ary
|
|
378
|
+
end
|
|
402
379
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
380
|
+
# Returns
|
|
381
|
+
def list_truepositive(by_name = nil)
|
|
382
|
+
list_xref('T', by_name)
|
|
383
|
+
end
|
|
407
384
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
385
|
+
# Returns
|
|
386
|
+
def list_falsenegative(by_name = nil)
|
|
387
|
+
list_xref('F', by_name)
|
|
388
|
+
end
|
|
412
389
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
390
|
+
# Returns
|
|
391
|
+
def list_falsepositive(by_name = nil)
|
|
392
|
+
list_xref('P', by_name)
|
|
393
|
+
end
|
|
417
394
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
395
|
+
# Returns
|
|
396
|
+
def list_potentialhit(by_name = nil)
|
|
397
|
+
list_xref('P', by_name)
|
|
398
|
+
end
|
|
422
399
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
400
|
+
# Returns
|
|
401
|
+
def list_unknown(by_name = nil)
|
|
402
|
+
list_xref('?', by_name)
|
|
403
|
+
end
|
|
427
404
|
|
|
428
405
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
end
|
|
438
|
-
@data['3D']
|
|
406
|
+
# 3D Cross-references to PDB (>=0 per entry)
|
|
407
|
+
#
|
|
408
|
+
# 3D name; [name2;...]
|
|
409
|
+
#
|
|
410
|
+
# Returns
|
|
411
|
+
def pdb_xref
|
|
412
|
+
unless @data['3D']
|
|
413
|
+
@data['3D'] = fetch('3D').split(/; */)
|
|
439
414
|
end
|
|
415
|
+
@data['3D']
|
|
416
|
+
end
|
|
440
417
|
|
|
441
418
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
419
|
+
# DO Pointer to the documentation file (1 per entry)
|
|
420
|
+
#
|
|
421
|
+
# DO PDOCnnnnn;
|
|
422
|
+
#
|
|
423
|
+
# Returns
|
|
424
|
+
def pdoc_xref
|
|
425
|
+
@data['DO'] = fetch('DO').chomp(';')
|
|
426
|
+
end
|
|
450
427
|
|
|
451
428
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
429
|
+
### prosite pattern to regular expression
|
|
430
|
+
#
|
|
431
|
+
# prosite/prosuser.txt:
|
|
432
|
+
#
|
|
433
|
+
# The PA (PAttern) lines contains the definition of a PROSITE pattern. The
|
|
434
|
+
# patterns are described using the following conventions:
|
|
435
|
+
#
|
|
436
|
+
# 0) The standard IUPAC one-letter codes for the amino acids are used.
|
|
437
|
+
# 0) Ambiguities are indicated by listing the acceptable amino acids for a
|
|
438
|
+
# given position, between square parentheses `[ ]'. For example: [ALT]
|
|
439
|
+
# stands for Ala or Leu or Thr.
|
|
440
|
+
# 1) A period ends the pattern.
|
|
441
|
+
# 2) When a pattern is restricted to either the N- or C-terminal of a
|
|
442
|
+
# sequence, that pattern either starts with a `<' symbol or respectively
|
|
443
|
+
# ends with a `>' symbol.
|
|
444
|
+
# 3) Ambiguities are also indicated by listing between a pair of curly
|
|
445
|
+
# brackets `{ }' the amino acids that are not accepted at a given
|
|
446
|
+
# position. For example: {AM} stands for any amino acid except Ala and
|
|
447
|
+
# Met.
|
|
448
|
+
# 4) Repetition of an element of the pattern can be indicated by following
|
|
449
|
+
# that element with a numerical value or a numerical range between
|
|
450
|
+
# parenthesis. Examples: x(3) corresponds to x-x-x, x(2,4) corresponds to
|
|
451
|
+
# x-x or x-x-x or x-x-x-x.
|
|
452
|
+
# 5) The symbol `x' is used for a position where any amino acid is accepted.
|
|
453
|
+
# 6) Each element in a pattern is separated from its neighbor by a `-'.
|
|
454
|
+
#
|
|
455
|
+
# Examples:
|
|
456
|
+
#
|
|
457
|
+
# PA [AC]-x-V-x(4)-{ED}.
|
|
458
|
+
#
|
|
459
|
+
# This pattern is translated as: [Ala or Cys]-any-Val-any-any-any-any-{any
|
|
460
|
+
# but Glu or Asp}
|
|
461
|
+
#
|
|
462
|
+
# PA <A-x-[ST](2)-x(0,1)-V.
|
|
463
|
+
#
|
|
464
|
+
# This pattern, which must be in the N-terminal of the sequence (`<'), is
|
|
465
|
+
# translated as: Ala-any-[Ser or Thr]-[Ser or Thr]-(any or none)-Val
|
|
466
|
+
#
|
|
467
|
+
def self.pa2re(pattern)
|
|
468
|
+
pattern.gsub!(/\s/, '') # remove white spaces
|
|
469
|
+
pattern.sub!(/\.$/, '') # (1) remove trailing '.'
|
|
470
|
+
pattern.sub!(/^</, '^') # (2) restricted to the N-terminal : `<'
|
|
471
|
+
pattern.sub!(/>$/, '$') # (2) restricted to the C-terminal : `>'
|
|
472
|
+
pattern.gsub!(/\{(\w+)\}/) { |m|
|
|
473
|
+
'[^' + $1 + ']' # (3) not accepted at a given position : '{}'
|
|
474
|
+
}
|
|
475
|
+
pattern.gsub!(/\(([\d,]+)\)/) { |m|
|
|
476
|
+
'{' + $1 + '}' # (4) repetition of an element : (n), (n,m)
|
|
477
|
+
}
|
|
478
|
+
pattern.tr!('x', '.') # (5) any amino acid is accepted : 'x'
|
|
479
|
+
pattern.tr!('-', '') # (6) each element is separated by a '-'
|
|
480
|
+
Regexp.new(pattern, Regexp::IGNORECASE)
|
|
481
|
+
end
|
|
505
482
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
483
|
+
def pa2re(pattern)
|
|
484
|
+
self.class.pa2re(pattern)
|
|
485
|
+
end
|
|
509
486
|
|
|
487
|
+
def re
|
|
488
|
+
self.class.pa2re(self.pa)
|
|
489
|
+
end
|
|
510
490
|
|
|
511
|
-
### prosite profile to regular expression
|
|
512
|
-
#
|
|
513
|
-
# prosite/profile.txt:
|
|
514
|
-
#
|
|
515
|
-
# Returns
|
|
516
|
-
def ma2re(matrix)
|
|
517
|
-
raise NotImplementedError
|
|
518
|
-
end
|
|
519
491
|
|
|
492
|
+
### prosite profile to regular expression
|
|
493
|
+
#
|
|
494
|
+
# prosite/profile.txt:
|
|
495
|
+
#
|
|
496
|
+
# Returns
|
|
497
|
+
def ma2re(matrix)
|
|
498
|
+
raise NotImplementedError
|
|
520
499
|
end
|
|
521
500
|
|
|
522
|
-
end
|
|
501
|
+
end # PROSITE
|
|
502
|
+
|
|
503
|
+
end # Bio
|
|
523
504
|
|
|
524
505
|
|
|
525
506
|
if __FILE__ == $0
|