ngoto-bio 1.2.9.9001
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +2046 -0
- data/README.rdoc +223 -0
- data/README_DEV.rdoc +285 -0
- data/Rakefile +70 -0
- data/bin/bioruby +44 -0
- data/bin/br_biofetch.rb +47 -0
- data/bin/br_bioflat.rb +293 -0
- data/bin/br_biogetseq.rb +45 -0
- data/bin/br_pmfetch.rb +421 -0
- data/bioruby.gemspec +463 -0
- data/bioruby.gemspec.erb +79 -0
- data/doc/Changes-0.7.rd +369 -0
- data/doc/Changes-1.3.rdoc +195 -0
- data/doc/KEGG_API.rd +1843 -0
- data/doc/KEGG_API.rd.ja +1834 -0
- data/doc/Tutorial.rd +1296 -0
- data/doc/Tutorial.rd.ja +2640 -0
- data/etc/bioinformatics/seqdatabase.ini +210 -0
- data/extconf.rb +2 -0
- data/lib/bio/alignment.rb +2518 -0
- data/lib/bio/appl/bl2seq/report.rb +334 -0
- data/lib/bio/appl/blast/ddbj.rb +142 -0
- data/lib/bio/appl/blast/format0.rb +1438 -0
- data/lib/bio/appl/blast/format8.rb +83 -0
- data/lib/bio/appl/blast/genomenet.rb +263 -0
- data/lib/bio/appl/blast/ncbioptions.rb +220 -0
- data/lib/bio/appl/blast/remote.rb +105 -0
- data/lib/bio/appl/blast/report.rb +767 -0
- data/lib/bio/appl/blast/rexml.rb +144 -0
- data/lib/bio/appl/blast/rpsblast.rb +277 -0
- data/lib/bio/appl/blast/wublast.rb +671 -0
- data/lib/bio/appl/blast/xmlparser.rb +236 -0
- data/lib/bio/appl/blast.rb +505 -0
- data/lib/bio/appl/blat/report.rb +530 -0
- data/lib/bio/appl/clustalw/report.rb +152 -0
- data/lib/bio/appl/clustalw.rb +219 -0
- data/lib/bio/appl/emboss.rb +203 -0
- data/lib/bio/appl/fasta/format10.rb +325 -0
- data/lib/bio/appl/fasta.rb +235 -0
- 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 +552 -0
- data/lib/bio/appl/hmmer/report.rb +683 -0
- data/lib/bio/appl/hmmer.rb +126 -0
- data/lib/bio/appl/iprscan/report.rb +374 -0
- data/lib/bio/appl/mafft/report.rb +226 -0
- data/lib/bio/appl/mafft.rb +259 -0
- data/lib/bio/appl/muscle.rb +52 -0
- data/lib/bio/appl/paml/baseml/report.rb +32 -0
- data/lib/bio/appl/paml/baseml.rb +95 -0
- data/lib/bio/appl/paml/codeml/rates.rb +67 -0
- data/lib/bio/appl/paml/codeml/report.rb +67 -0
- data/lib/bio/appl/paml/codeml.rb +242 -0
- data/lib/bio/appl/paml/common.rb +348 -0
- data/lib/bio/appl/paml/common_report.rb +38 -0
- data/lib/bio/appl/paml/yn00/report.rb +32 -0
- data/lib/bio/appl/paml/yn00.rb +103 -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/report.rb +457 -0
- data/lib/bio/appl/psort.rb +548 -0
- data/lib/bio/appl/pts1.rb +263 -0
- data/lib/bio/appl/sim4/report.rb +485 -0
- data/lib/bio/appl/sim4.rb +124 -0
- data/lib/bio/appl/sosui/report.rb +151 -0
- data/lib/bio/appl/spidey/report.rb +593 -0
- data/lib/bio/appl/targetp/report.rb +267 -0
- data/lib/bio/appl/tcoffee.rb +55 -0
- data/lib/bio/appl/tmhmm/report.rb +231 -0
- data/lib/bio/command.rb +593 -0
- data/lib/bio/compat/features.rb +157 -0
- data/lib/bio/compat/references.rb +128 -0
- data/lib/bio/data/aa.rb +349 -0
- data/lib/bio/data/codontable.rb +722 -0
- data/lib/bio/data/na.rb +223 -0
- data/lib/bio/db/aaindex.rb +357 -0
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +67 -0
- data/lib/bio/db/biosql/sequence.rb +508 -0
- data/lib/bio/db/embl/common.rb +352 -0
- data/lib/bio/db/embl/embl.rb +500 -0
- data/lib/bio/db/embl/embl_to_biosequence.rb +85 -0
- data/lib/bio/db/embl/format_embl.rb +190 -0
- data/lib/bio/db/embl/sptr.rb +1283 -0
- data/lib/bio/db/embl/swissprot.rb +42 -0
- data/lib/bio/db/embl/trembl.rb +41 -0
- data/lib/bio/db/embl/uniprot.rb +42 -0
- data/lib/bio/db/fantom.rb +597 -0
- data/lib/bio/db/fasta/defline.rb +532 -0
- data/lib/bio/db/fasta/fasta_to_biosequence.rb +63 -0
- data/lib/bio/db/fasta/format_fasta.rb +97 -0
- data/lib/bio/db/fasta.rb +410 -0
- data/lib/bio/db/genbank/common.rb +307 -0
- data/lib/bio/db/genbank/ddbj.rb +22 -0
- data/lib/bio/db/genbank/format_genbank.rb +187 -0
- data/lib/bio/db/genbank/genbank.rb +250 -0
- data/lib/bio/db/genbank/genbank_to_biosequence.rb +86 -0
- data/lib/bio/db/genbank/genpept.rb +60 -0
- data/lib/bio/db/genbank/refseq.rb +18 -0
- data/lib/bio/db/gff.rb +1846 -0
- data/lib/bio/db/go.rb +481 -0
- data/lib/bio/db/kegg/brite.rb +41 -0
- data/lib/bio/db/kegg/compound.rb +131 -0
- data/lib/bio/db/kegg/drug.rb +98 -0
- data/lib/bio/db/kegg/enzyme.rb +148 -0
- data/lib/bio/db/kegg/expression.rb +155 -0
- data/lib/bio/db/kegg/genes.rb +263 -0
- data/lib/bio/db/kegg/genome.rb +241 -0
- data/lib/bio/db/kegg/glycan.rb +166 -0
- data/lib/bio/db/kegg/keggtab.rb +357 -0
- data/lib/bio/db/kegg/kgml.rb +256 -0
- data/lib/bio/db/kegg/orthology.rb +136 -0
- data/lib/bio/db/kegg/reaction.rb +82 -0
- data/lib/bio/db/kegg/taxonomy.rb +331 -0
- data/lib/bio/db/lasergene.rb +209 -0
- data/lib/bio/db/litdb.rb +107 -0
- data/lib/bio/db/medline.rb +326 -0
- data/lib/bio/db/nbrf.rb +191 -0
- data/lib/bio/db/newick.rb +658 -0
- data/lib/bio/db/nexus.rb +1854 -0
- data/lib/bio/db/pdb/atom.rb +77 -0
- data/lib/bio/db/pdb/chain.rb +210 -0
- data/lib/bio/db/pdb/chemicalcomponent.rb +224 -0
- data/lib/bio/db/pdb/model.rb +148 -0
- data/lib/bio/db/pdb/pdb.rb +1911 -0
- data/lib/bio/db/pdb/residue.rb +176 -0
- data/lib/bio/db/pdb/utils.rb +399 -0
- data/lib/bio/db/pdb.rb +29 -0
- data/lib/bio/db/prosite.rb +597 -0
- data/lib/bio/db/rebase.rb +456 -0
- data/lib/bio/db/soft.rb +404 -0
- data/lib/bio/db/transfac.rb +375 -0
- data/lib/bio/db.rb +329 -0
- data/lib/bio/feature.rb +139 -0
- data/lib/bio/io/biosql/biodatabase.rb +64 -0
- data/lib/bio/io/biosql/bioentry.rb +29 -0
- data/lib/bio/io/biosql/bioentry_dbxref.rb +11 -0
- data/lib/bio/io/biosql/bioentry_path.rb +12 -0
- data/lib/bio/io/biosql/bioentry_qualifier_value.rb +10 -0
- data/lib/bio/io/biosql/bioentry_reference.rb +10 -0
- data/lib/bio/io/biosql/bioentry_relationship.rb +10 -0
- data/lib/bio/io/biosql/biosequence.rb +11 -0
- data/lib/bio/io/biosql/comment.rb +7 -0
- data/lib/bio/io/biosql/config/database.yml +20 -0
- data/lib/bio/io/biosql/dbxref.rb +13 -0
- data/lib/bio/io/biosql/dbxref_qualifier_value.rb +12 -0
- data/lib/bio/io/biosql/location.rb +32 -0
- data/lib/bio/io/biosql/location_qualifier_value.rb +11 -0
- data/lib/bio/io/biosql/ontology.rb +10 -0
- data/lib/bio/io/biosql/reference.rb +9 -0
- data/lib/bio/io/biosql/seqfeature.rb +32 -0
- data/lib/bio/io/biosql/seqfeature_dbxref.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_path.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_qualifier_value.rb +20 -0
- data/lib/bio/io/biosql/seqfeature_relationship.rb +11 -0
- data/lib/bio/io/biosql/taxon.rb +12 -0
- data/lib/bio/io/biosql/taxon_name.rb +9 -0
- data/lib/bio/io/biosql/term.rb +27 -0
- data/lib/bio/io/biosql/term_dbxref.rb +11 -0
- data/lib/bio/io/biosql/term_path.rb +12 -0
- data/lib/bio/io/biosql/term_relationship.rb +13 -0
- data/lib/bio/io/biosql/term_relationship_term.rb +11 -0
- data/lib/bio/io/biosql/term_synonym.rb +10 -0
- data/lib/bio/io/das.rb +461 -0
- data/lib/bio/io/dbget.rb +194 -0
- data/lib/bio/io/ddbjxml.rb +638 -0
- data/lib/bio/io/ebisoap.rb +158 -0
- data/lib/bio/io/ensembl.rb +229 -0
- data/lib/bio/io/fastacmd.rb +163 -0
- data/lib/bio/io/fetch.rb +195 -0
- data/lib/bio/io/flatfile/autodetection.rb +545 -0
- data/lib/bio/io/flatfile/bdb.rb +253 -0
- data/lib/bio/io/flatfile/buffer.rb +237 -0
- data/lib/bio/io/flatfile/index.rb +1381 -0
- data/lib/bio/io/flatfile/indexer.rb +805 -0
- data/lib/bio/io/flatfile/splitter.rb +297 -0
- data/lib/bio/io/flatfile.rb +473 -0
- data/lib/bio/io/higet.rb +73 -0
- data/lib/bio/io/hinv.rb +442 -0
- data/lib/bio/io/keggapi.rb +805 -0
- data/lib/bio/io/ncbirest.rb +733 -0
- data/lib/bio/io/ncbisoap.rb +155 -0
- data/lib/bio/io/pubmed.rb +307 -0
- data/lib/bio/io/registry.rb +292 -0
- data/lib/bio/io/soapwsdl.rb +119 -0
- data/lib/bio/io/sql.rb +186 -0
- data/lib/bio/location.rb +867 -0
- data/lib/bio/map.rb +410 -0
- data/lib/bio/pathway.rb +960 -0
- data/lib/bio/reference.rb +602 -0
- data/lib/bio/sequence/aa.rb +125 -0
- data/lib/bio/sequence/adapter.rb +108 -0
- data/lib/bio/sequence/common.rb +310 -0
- data/lib/bio/sequence/compat.rb +123 -0
- data/lib/bio/sequence/dblink.rb +54 -0
- data/lib/bio/sequence/format.rb +358 -0
- data/lib/bio/sequence/format_raw.rb +23 -0
- data/lib/bio/sequence/generic.rb +24 -0
- data/lib/bio/sequence/na.rb +491 -0
- data/lib/bio/sequence.rb +456 -0
- data/lib/bio/shell/core.rb +578 -0
- data/lib/bio/shell/demo.rb +146 -0
- data/lib/bio/shell/interface.rb +218 -0
- data/lib/bio/shell/irb.rb +95 -0
- data/lib/bio/shell/object.rb +71 -0
- data/lib/bio/shell/plugin/blast.rb +42 -0
- data/lib/bio/shell/plugin/codon.rb +218 -0
- data/lib/bio/shell/plugin/das.rb +58 -0
- data/lib/bio/shell/plugin/emboss.rb +23 -0
- data/lib/bio/shell/plugin/entry.rb +105 -0
- data/lib/bio/shell/plugin/flatfile.rb +101 -0
- data/lib/bio/shell/plugin/keggapi.rb +181 -0
- data/lib/bio/shell/plugin/midi.rb +430 -0
- data/lib/bio/shell/plugin/obda.rb +45 -0
- data/lib/bio/shell/plugin/psort.rb +56 -0
- data/lib/bio/shell/plugin/seq.rb +247 -0
- data/lib/bio/shell/plugin/soap.rb +87 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/bioruby_generator.rb +29 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_classes.rhtml +4 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_log.rhtml +27 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_methods.rhtml +11 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_modules.rhtml +4 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_variables.rhtml +7 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-bg.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-gem.png +0 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-link.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.css +368 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.rhtml +47 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_controller.rb +144 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb +47 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/commands.rhtml +8 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/history.rhtml +10 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/index.rhtml +26 -0
- data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/spinner.gif +0 -0
- data/lib/bio/shell/script.rb +25 -0
- data/lib/bio/shell/setup.rb +109 -0
- data/lib/bio/shell/web.rb +102 -0
- data/lib/bio/shell.rb +44 -0
- data/lib/bio/tree.rb +852 -0
- data/lib/bio/util/color_scheme/buried.rb +59 -0
- data/lib/bio/util/color_scheme/helix.rb +59 -0
- data/lib/bio/util/color_scheme/hydropathy.rb +64 -0
- data/lib/bio/util/color_scheme/nucleotide.rb +31 -0
- data/lib/bio/util/color_scheme/strand.rb +59 -0
- data/lib/bio/util/color_scheme/taylor.rb +50 -0
- data/lib/bio/util/color_scheme/turn.rb +59 -0
- data/lib/bio/util/color_scheme/zappo.rb +50 -0
- data/lib/bio/util/color_scheme.rb +191 -0
- data/lib/bio/util/contingency_table.rb +370 -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/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/double_stranded.rb +321 -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/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/sequence_range.rb +257 -0
- data/lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb +77 -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.rb +200 -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/restriction_enzyme.rb +228 -0
- data/lib/bio/util/sirna.rb +288 -0
- data/lib/bio.rb +300 -0
- data/rdoc.zsh +8 -0
- data/sample/any2fasta.rb +59 -0
- data/sample/biofetch.rb +475 -0
- data/sample/color_scheme_na.rb +91 -0
- data/sample/dbget +37 -0
- data/sample/demo_sequence.rb +158 -0
- data/sample/enzymes.rb +78 -0
- data/sample/fasta2tab.rb +99 -0
- data/sample/fastagrep.rb +72 -0
- data/sample/fastasort.rb +54 -0
- data/sample/fsplit.rb +51 -0
- data/sample/gb2fasta.rb +30 -0
- data/sample/gb2tab.rb +325 -0
- data/sample/gbtab2mysql.rb +161 -0
- data/sample/genes2nuc.rb +33 -0
- data/sample/genes2pep.rb +33 -0
- data/sample/genes2tab.rb +81 -0
- data/sample/genome2rb.rb +29 -0
- data/sample/genome2tab.rb +76 -0
- data/sample/goslim.rb +303 -0
- data/sample/gt2fasta.rb +47 -0
- data/sample/na2aa.rb +34 -0
- data/sample/pmfetch.rb +42 -0
- data/sample/pmsearch.rb +42 -0
- data/sample/psortplot_html.rb +214 -0
- data/sample/ssearch2tab.rb +96 -0
- data/sample/tdiary.rb +158 -0
- data/sample/tfastx2tab.rb +100 -0
- data/sample/vs-genes.rb +212 -0
- data/setup.rb +1596 -0
- data/test/data/HMMER/hmmpfam.out +64 -0
- data/test/data/HMMER/hmmsearch.out +88 -0
- data/test/data/SOSUI/sample.report +11 -0
- data/test/data/TMHMM/sample.report +21 -0
- data/test/data/aaindex/DAYM780301 +30 -0
- data/test/data/aaindex/PRAM900102 +20 -0
- data/test/data/bl2seq/cd8a_cd8b_blastp.bl2seq +53 -0
- data/test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq +37 -0
- data/test/data/blast/2.2.15.blastp.m7 +876 -0
- data/test/data/blast/b0002.faa +15 -0
- data/test/data/blast/b0002.faa.m0 +128 -0
- data/test/data/blast/b0002.faa.m7 +65 -0
- data/test/data/blast/b0002.faa.m8 +1 -0
- data/test/data/blast/blastp-multi.m7 +188 -0
- data/test/data/command/echoarg2.bat +1 -0
- data/test/data/embl/AB090716.embl +65 -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/genscan/sample.report +63 -0
- data/test/data/iprscan/merged.raw +32 -0
- data/test/data/iprscan/merged.txt +74 -0
- data/test/data/paml/codeml/control_file.txt +30 -0
- data/test/data/paml/codeml/output.txt +78 -0
- data/test/data/paml/codeml/rates +217 -0
- data/test/data/prosite/prosite.dat +2233 -0
- data/test/data/refseq/nm_126355.entret +64 -0
- data/test/data/rpsblast/misc.rpsblast +193 -0
- data/test/data/soft/GDS100_partial.soft +92 -0
- data/test/data/soft/GSE3457_family_partial.soft +874 -0
- data/test/data/uniprot/p53_human.uniprot +1456 -0
- data/test/functional/bio/appl/test_pts1.rb +115 -0
- data/test/functional/bio/io/test_ensembl.rb +229 -0
- data/test/functional/bio/io/test_soapwsdl.rb +52 -0
- data/test/functional/bio/sequence/test_output_embl.rb +51 -0
- data/test/functional/bio/test_command.rb +301 -0
- data/test/runner.rb +23 -0
- data/test/unit/bio/appl/bl2seq/test_report.rb +134 -0
- data/test/unit/bio/appl/blast/test_ncbioptions.rb +112 -0
- data/test/unit/bio/appl/blast/test_report.rb +1135 -0
- data/test/unit/bio/appl/blast/test_rpsblast.rb +398 -0
- data/test/unit/bio/appl/genscan/test_report.rb +182 -0
- data/test/unit/bio/appl/hmmer/test_report.rb +342 -0
- 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/paml/codeml/test_rates.rb +45 -0
- data/test/unit/bio/appl/paml/codeml/test_report.rb +45 -0
- data/test/unit/bio/appl/paml/test_codeml.rb +174 -0
- data/test/unit/bio/appl/sosui/test_report.rb +81 -0
- data/test/unit/bio/appl/targetp/test_report.rb +146 -0
- data/test/unit/bio/appl/test_blast.rb +277 -0
- data/test/unit/bio/appl/test_fasta.rb +130 -0
- data/test/unit/bio/appl/test_pts1.rb +77 -0
- data/test/unit/bio/appl/tmhmm/test_report.rb +126 -0
- data/test/unit/bio/data/test_aa.rb +90 -0
- data/test/unit/bio/data/test_codontable.rb +107 -0
- data/test/unit/bio/data/test_na.rb +80 -0
- data/test/unit/bio/db/embl/test_common.rb +117 -0
- data/test/unit/bio/db/embl/test_embl.rb +214 -0
- data/test/unit/bio/db/embl/test_embl_rel89.rb +219 -0
- data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +203 -0
- data/test/unit/bio/db/embl/test_sptr.rb +1812 -0
- data/test/unit/bio/db/embl/test_uniprot.rb +31 -0
- data/test/unit/bio/db/kegg/test_genes.rb +45 -0
- data/test/unit/bio/db/pdb/test_pdb.rb +152 -0
- data/test/unit/bio/db/test_aaindex.rb +197 -0
- data/test/unit/bio/db/test_fasta.rb +250 -0
- data/test/unit/bio/db/test_gff.rb +1190 -0
- data/test/unit/bio/db/test_lasergene.rb +95 -0
- data/test/unit/bio/db/test_medline.rb +127 -0
- data/test/unit/bio/db/test_newick.rb +293 -0
- data/test/unit/bio/db/test_nexus.rb +364 -0
- data/test/unit/bio/db/test_prosite.rb +1437 -0
- data/test/unit/bio/db/test_rebase.rb +101 -0
- data/test/unit/bio/db/test_soft.rb +138 -0
- data/test/unit/bio/io/flatfile/test_autodetection.rb +375 -0
- data/test/unit/bio/io/flatfile/test_buffer.rb +251 -0
- data/test/unit/bio/io/flatfile/test_splitter.rb +369 -0
- data/test/unit/bio/io/test_ddbjxml.rb +80 -0
- data/test/unit/bio/io/test_ensembl.rb +109 -0
- data/test/unit/bio/io/test_fastacmd.rb +42 -0
- data/test/unit/bio/io/test_flatfile.rb +488 -0
- data/test/unit/bio/io/test_soapwsdl.rb +32 -0
- data/test/unit/bio/sequence/test_aa.rb +103 -0
- data/test/unit/bio/sequence/test_common.rb +373 -0
- data/test/unit/bio/sequence/test_compat.rb +69 -0
- data/test/unit/bio/sequence/test_dblink.rb +58 -0
- data/test/unit/bio/sequence/test_na.rb +330 -0
- data/test/unit/bio/shell/plugin/test_seq.rb +185 -0
- data/test/unit/bio/test_alignment.rb +1025 -0
- data/test/unit/bio/test_command.rb +349 -0
- data/test/unit/bio/test_db.rb +96 -0
- data/test/unit/bio/test_feature.rb +144 -0
- data/test/unit/bio/test_location.rb +599 -0
- data/test/unit/bio/test_map.rb +230 -0
- data/test/unit/bio/test_pathway.rb +499 -0
- data/test/unit/bio/test_reference.rb +252 -0
- data/test/unit/bio/test_sequence.rb +329 -0
- data/test/unit/bio/test_shell.rb +18 -0
- 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 +101 -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 +33 -0
- data/test/unit/bio/util/test_contingency_table.rb +94 -0
- data/test/unit/bio/util/test_restriction_enzyme.rb +42 -0
- data/test/unit/bio/util/test_sirna.rb +245 -0
- metadata +484 -0
data/sample/biofetch.rb
ADDED
@@ -0,0 +1,475 @@
|
|
1
|
+
#!/usr/proj/bioruby/bin/ruby
|
2
|
+
#
|
3
|
+
# biofetch.rb : BioFetch server (interface to GenomeNet/DBGET via KEGG API)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2002-2004 KATAYAMA Toshiaki <k@bioruby.org>
|
6
|
+
#
|
7
|
+
# This program is free software; you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation; either version 2 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with this program; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
20
|
+
#
|
21
|
+
# $Id: biofetch.rb,v 1.16 2005/08/07 10:02:41 k Exp $
|
22
|
+
#
|
23
|
+
|
24
|
+
require 'cgi'
|
25
|
+
require 'html/template'
|
26
|
+
require 'bio/io/keggapi'
|
27
|
+
|
28
|
+
MAX_ID_NUM = 50
|
29
|
+
|
30
|
+
|
31
|
+
module BioFetchError
|
32
|
+
|
33
|
+
def print_text_page(str)
|
34
|
+
print "Content-type: text/plain; charset=UTF-8\n\n"
|
35
|
+
puts str
|
36
|
+
exit
|
37
|
+
end
|
38
|
+
|
39
|
+
def error1(db)
|
40
|
+
str = "ERROR 1 Unknown database [#{db}]."
|
41
|
+
print_text_page(str)
|
42
|
+
end
|
43
|
+
|
44
|
+
def error2(style)
|
45
|
+
str = "ERROR 2 Unknown style [#{style}]."
|
46
|
+
print_text_page(str)
|
47
|
+
end
|
48
|
+
|
49
|
+
def error3(format, db)
|
50
|
+
str = "ERROR 3 Format [#{format}] not known for database [#{db}]."
|
51
|
+
print_text_page(str)
|
52
|
+
end
|
53
|
+
|
54
|
+
def error4(entry_id, db)
|
55
|
+
str = "ERROR 4 ID [#{entry_id}] not found in database [#{db}]."
|
56
|
+
print_text_page(str)
|
57
|
+
end
|
58
|
+
|
59
|
+
def error5(count)
|
60
|
+
str = "ERROR 5 Too many IDs [#{count}]. Max [#{MAX_ID_NUM}] allowed."
|
61
|
+
print_text_page(str)
|
62
|
+
end
|
63
|
+
|
64
|
+
def error6(info)
|
65
|
+
str = "ERROR 6 Illegal information request [#{info}]."
|
66
|
+
print_text_page(str)
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
module KeggAPI
|
74
|
+
|
75
|
+
include BioFetchError
|
76
|
+
|
77
|
+
def list_databases
|
78
|
+
serv = Bio::KEGG::API.new
|
79
|
+
results = serv.list_databases
|
80
|
+
results.collect {|x| x.entry_id}
|
81
|
+
end
|
82
|
+
|
83
|
+
def bget(db, id_list, format)
|
84
|
+
serv = Bio::KEGG::API.new
|
85
|
+
results = ''
|
86
|
+
id_list.each do |query_id|
|
87
|
+
entry_id = "#{db}:#{query_id}"
|
88
|
+
result = serv.get_entries([entry_id])
|
89
|
+
if result.empty?
|
90
|
+
error4(query_id, db)
|
91
|
+
else
|
92
|
+
results << result
|
93
|
+
end
|
94
|
+
end
|
95
|
+
return results
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
class BioFetch
|
104
|
+
|
105
|
+
include BioFetchError
|
106
|
+
include KeggAPI
|
107
|
+
|
108
|
+
def initialize(db, id_list, style, format)
|
109
|
+
check_style(style)
|
110
|
+
check_format(format, db)
|
111
|
+
check_number_of_id(id_list.length)
|
112
|
+
check_dbname(db)
|
113
|
+
|
114
|
+
if /html/.match(style)
|
115
|
+
goto_html_style_page(db, id_list, format)
|
116
|
+
end
|
117
|
+
|
118
|
+
entries = bget(db, id_list, format)
|
119
|
+
|
120
|
+
if /fasta/.match(format) and entries
|
121
|
+
entries = convert_to_fasta_format(entries, db)
|
122
|
+
end
|
123
|
+
|
124
|
+
print_text_page(entries)
|
125
|
+
end
|
126
|
+
|
127
|
+
private
|
128
|
+
|
129
|
+
def convert_to_fasta_format(str, db)
|
130
|
+
require 'bio'
|
131
|
+
require 'stringio'
|
132
|
+
|
133
|
+
fasta = Array.new
|
134
|
+
|
135
|
+
entries = StringIO.new(str)
|
136
|
+
Bio::FlatFile.auto(entries) do |ff|
|
137
|
+
ff.each do |entry|
|
138
|
+
seq = nil
|
139
|
+
if entry.respond_to?(:seq)
|
140
|
+
seq = entry.seq
|
141
|
+
elsif entry.respond_to?(:aaseq)
|
142
|
+
seq = entry.aaseq
|
143
|
+
elsif entry.respond_to?(:naseq)
|
144
|
+
seq = entry.naseq
|
145
|
+
end
|
146
|
+
if seq
|
147
|
+
entry_id = entry.respond_to?(:entry_id) ? entry.entry_id : ''
|
148
|
+
definition = entry.respond_to?(:definition) ? entry.definition : ''
|
149
|
+
fasta << seq.to_fasta("#{db}:#{entry_id} #{definition}", 60)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
return fasta.join
|
154
|
+
end
|
155
|
+
|
156
|
+
def goto_html_style_page(db, id_list, format)
|
157
|
+
url = "http://www.genome.jp/dbget-bin/www_bget"
|
158
|
+
opt = '-f+' if /fasta/.match(format)
|
159
|
+
ids = id_list.join('%2B')
|
160
|
+
print "Location: #{url}?#{opt}#{db}+#{ids}\n\n"
|
161
|
+
exit
|
162
|
+
end
|
163
|
+
|
164
|
+
def check_style(style)
|
165
|
+
error2(style) unless /html|raw/.match(style)
|
166
|
+
end
|
167
|
+
|
168
|
+
def check_format(format, db)
|
169
|
+
error3(format, db) if format && ! /fasta|default/.match(format)
|
170
|
+
end
|
171
|
+
|
172
|
+
def check_number_of_id(num)
|
173
|
+
error5(num) if num > MAX_ID_NUM
|
174
|
+
end
|
175
|
+
|
176
|
+
def check_dbname(db)
|
177
|
+
error1(db) unless list_databases.include?(db)
|
178
|
+
end
|
179
|
+
|
180
|
+
end
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
class BioFetchInfo
|
185
|
+
|
186
|
+
include BioFetchError
|
187
|
+
include KeggAPI
|
188
|
+
|
189
|
+
def initialize(info, db)
|
190
|
+
@db = db
|
191
|
+
begin
|
192
|
+
send(info)
|
193
|
+
rescue
|
194
|
+
error6(info)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
private
|
199
|
+
|
200
|
+
def dbs
|
201
|
+
str = list_databases.sort.join(' ')
|
202
|
+
print_text_page(str)
|
203
|
+
end
|
204
|
+
|
205
|
+
def formats
|
206
|
+
fasta = " fasta" if check_fasta_ok
|
207
|
+
str = "default#{fasta}"
|
208
|
+
print_text_page(str)
|
209
|
+
end
|
210
|
+
|
211
|
+
def maxids
|
212
|
+
str = MAX_ID_NUM.to_s
|
213
|
+
print_text_page(str)
|
214
|
+
end
|
215
|
+
|
216
|
+
def check_fasta_ok
|
217
|
+
# sequence databases supported by Bio::FlatFile.auto
|
218
|
+
/genes|gb|genbank|genpept|rs|refseq|emb|sp|swiss|pir/.match(@db)
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
class BioFetchCGI
|
226
|
+
|
227
|
+
def initialize(cgi)
|
228
|
+
@cgi = cgi
|
229
|
+
show_page
|
230
|
+
end
|
231
|
+
|
232
|
+
private
|
233
|
+
|
234
|
+
def show_page
|
235
|
+
if info.empty?
|
236
|
+
if id_list.empty?
|
237
|
+
show_query_page
|
238
|
+
else
|
239
|
+
show_result_page(db, id_list, style, format)
|
240
|
+
end
|
241
|
+
else
|
242
|
+
show_info_page(info, db)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
def show_query_page
|
247
|
+
html = HTML::Template.new
|
248
|
+
html.set_html(DATA.read)
|
249
|
+
html.param('max_id_num' => MAX_ID_NUM)
|
250
|
+
@cgi.out do
|
251
|
+
html.output
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
def show_result_page(db, id_list, style, format)
|
256
|
+
BioFetch.new(db, id_list, style, format)
|
257
|
+
end
|
258
|
+
|
259
|
+
def show_info_page(info, db)
|
260
|
+
BioFetchInfo.new(info, db)
|
261
|
+
end
|
262
|
+
|
263
|
+
def info
|
264
|
+
@cgi['info'].downcase
|
265
|
+
end
|
266
|
+
|
267
|
+
def db
|
268
|
+
@cgi['db'].downcase
|
269
|
+
end
|
270
|
+
|
271
|
+
def id_list
|
272
|
+
@cgi['id'].split(/\W/) # not only ','
|
273
|
+
end
|
274
|
+
|
275
|
+
def style
|
276
|
+
s = @cgi['style'].downcase
|
277
|
+
return s.empty? ? "html" : s
|
278
|
+
end
|
279
|
+
|
280
|
+
def format
|
281
|
+
f = @cgi['format'].downcase
|
282
|
+
return f.empty? ? "default" : f
|
283
|
+
end
|
284
|
+
|
285
|
+
end
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
BioFetchCGI.new(CGI.new)
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
=begin
|
294
|
+
|
295
|
+
This program was created during BioHackathon 2002, Tucson and updated
|
296
|
+
in Cape Town :)
|
297
|
+
|
298
|
+
Rewrited in 2004 to use KEGG API as the bioruby.org server left from Kyoto
|
299
|
+
University (where DBGET runs) and the old version could not run without
|
300
|
+
having internally accessible DBGET server.
|
301
|
+
|
302
|
+
=end
|
303
|
+
|
304
|
+
|
305
|
+
__END__
|
306
|
+
|
307
|
+
<HTML>
|
308
|
+
<HEAD>
|
309
|
+
<LINK href="http://bioruby.org/img/favicon.png" rel="icon" type="image/png">
|
310
|
+
<LINK href="http://bioruby.org/css/bioruby.css" rel="stylesheet" type="text/css">
|
311
|
+
<TITLE>BioFetch interface to GenomeNet/DBGET</TITLE>
|
312
|
+
</HEAD>
|
313
|
+
|
314
|
+
<BODY bgcolor="#ffffff">
|
315
|
+
|
316
|
+
<H1>
|
317
|
+
<IMG src="http://bioruby.org/img/ruby.png" align="middle">
|
318
|
+
BioFetch interface to
|
319
|
+
<A href="http://www.genome.jp/dbget/">GenomeNet/DBGET</A>
|
320
|
+
</H1>
|
321
|
+
|
322
|
+
<P>This page allows you to retrieve up to <!var:max_id_num> entries at a time from various up-to-date biological databases.</P>
|
323
|
+
|
324
|
+
<HR>
|
325
|
+
|
326
|
+
<FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded" action="biofetch.rb">
|
327
|
+
|
328
|
+
<SELECT name="db">
|
329
|
+
<OPTION value="genbank">GenBank</OPTION>
|
330
|
+
<OPTION value="refseq">RefSeq</OPTION>
|
331
|
+
<OPTION value="embl">EMBL</OPTION>
|
332
|
+
<OPTION value="swissprot">Swiss-Prot</OPTION>
|
333
|
+
<OPTION value="pir">PIR</OPTION>
|
334
|
+
<OPTION value="prf">PRF</OPTION>
|
335
|
+
<OPTION value="pdb">PDB</OPTION>
|
336
|
+
<OPTION value="pdbstr">PDBSTR</OPTION>
|
337
|
+
<OPTION value="epd">EPD</OPTION>
|
338
|
+
<OPTION value="transfac">TRANSFAC</OPTION>
|
339
|
+
<OPTION value="prosite">PROSITE</OPTION>
|
340
|
+
<OPTION value="pmd">PMD</OPTION>
|
341
|
+
<OPTION value="litdb">LITDB</OPTION>
|
342
|
+
<OPTION value="omim">OMIM</OPTION>
|
343
|
+
<OPTION value="ligand">KEGG/LIGAND</OPTION>
|
344
|
+
<OPTION value="pathway">KEGG/PATHWAY</OPTION>
|
345
|
+
<OPTION value="brite">KEGG/BRITE</OPTION>
|
346
|
+
<OPTION value="genes">KEGG/GENES</OPTION>
|
347
|
+
<OPTION value="genome">KEGG/GENOME</OPTION>
|
348
|
+
<OPTION value="linkdb">LinkDB</OPTION>
|
349
|
+
<OPTION value="aaindex">AAindex</OPTION>
|
350
|
+
</SELECT>
|
351
|
+
|
352
|
+
<INPUT name="id" size="40" type="text" maxlength="1000">
|
353
|
+
|
354
|
+
<SELECT name="format">
|
355
|
+
<OPTION value="default">Default</OPTION>
|
356
|
+
<OPTION value="fasta">Fasta</OPTION>
|
357
|
+
</SELECT>
|
358
|
+
|
359
|
+
<SELECT name="style">
|
360
|
+
<OPTION value="raw">Raw</OPTION>
|
361
|
+
<OPTION value="html">HTML</OPTION>
|
362
|
+
</SELECT>
|
363
|
+
|
364
|
+
<INPUT type="submit">
|
365
|
+
|
366
|
+
</FORM>
|
367
|
+
|
368
|
+
<HR>
|
369
|
+
|
370
|
+
<H2>Direct access</H2>
|
371
|
+
|
372
|
+
<P>http://bioruby.org/cgi-bin/biofetch.rb?format=(default|fasta|...);style=(html|raw);db=(genbank|embl|...);id=ID[,ID,ID,...]</P>
|
373
|
+
<P>(NOTE: the option separator ';' can be '&')</P>
|
374
|
+
|
375
|
+
<DL>
|
376
|
+
<DT> <U>format</U> (optional)
|
377
|
+
<DD> default|fasta|...
|
378
|
+
|
379
|
+
<DT> <U>style</U> (required)
|
380
|
+
<DD> html|raw
|
381
|
+
|
382
|
+
<DT> <U>db</U> (required)
|
383
|
+
<DD> genbank|refseq|embl|swissprot|pir|prf|pdb|pdbstr|epd|transfac|prosite|pmd|litdb|omim|ligand|pathway|brite|genes|genome|linkdb|aaindex|...
|
384
|
+
|
385
|
+
<DT> <U>id</U> (required)
|
386
|
+
<DD> comma separated list of IDs
|
387
|
+
</DL>
|
388
|
+
|
389
|
+
<P>See the <A href="http://obda.open-bio.org/">BioFetch specification</A> for more details.</P>
|
390
|
+
|
391
|
+
<H2>Server informations</H2>
|
392
|
+
|
393
|
+
<DL>
|
394
|
+
<DT> <A href="?info=dbs">What databases are available?</A>
|
395
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?info=dbs
|
396
|
+
|
397
|
+
<DT> <A href="?info=formats;db=embl">What formats does the database X have?</A>
|
398
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?info=formats;db=embl
|
399
|
+
|
400
|
+
<DT> <A href="?info=maxids">How many entries can be retrieved simultaneously?</A>
|
401
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?info=maxids
|
402
|
+
</DL>
|
403
|
+
|
404
|
+
<H2>Examples</H2>
|
405
|
+
|
406
|
+
<DL>
|
407
|
+
<DT> <A href="?format=default;style=raw;db=genbank;id=AJ617376">gb:AJ617376</A> (default/raw)
|
408
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=genbank;id=AJ617376
|
409
|
+
|
410
|
+
<DT> <A href="?format=fasta;style=raw;db=genbank;id=AJ617376">gb:AJ617376</A> (fasta/raw)
|
411
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=fasta;style=raw;db=genbank;id=AJ617376
|
412
|
+
|
413
|
+
<DT> <A href="?format=default;style=html;db=genbank;id=AJ617376">gb:AJ617376</A> (default/html)
|
414
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=html;db=genbank;id=AJ617376
|
415
|
+
|
416
|
+
<DT> <A href="?format=default;style=raw;db=genbank;id=AJ617376,AJ617377">gb:AJ617376,AJ617377</A> (default/raw, multiple)
|
417
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=genbank;id=AJ617376,AJ617377
|
418
|
+
|
419
|
+
<DT> <A href="?format=default;style=raw;db=embl;id=BUM">embl:BUM</A> (default/raw)
|
420
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=embl;id=BUM
|
421
|
+
|
422
|
+
<DT> <A href="?format=default;style=raw;db=swissprot;id=CYC_BOVIN">sp:CYC_BOVIN</A> (default/raw)
|
423
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=swissprot;id=CYC_BOVIN
|
424
|
+
|
425
|
+
<DT> <A href="?format=fasta;style=raw;db=swissprot;id=CYC_BOVIN">sp:CYC_BOVIN</A> (fasta/raw)
|
426
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=fasta;style=raw;db=swissprot;id=CYC_BOVIN
|
427
|
+
|
428
|
+
<DT> <A href="?format=default;style=raw;db=genes;id=b0015">genes:b0015</A> (default/raw)
|
429
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=genes;id=b0015
|
430
|
+
|
431
|
+
<DT> <A href="?format=default;style=raw;db=prosite;id=PS00028">ps:PS00028</A> (default/raw)
|
432
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=prosite;id=PS00028
|
433
|
+
</DL>
|
434
|
+
|
435
|
+
<H2>Errors</H2>
|
436
|
+
|
437
|
+
<DL>
|
438
|
+
<DT> <A href="?format=default;style=raw;db=nonexistent;id=AJ617376">Error1</A> sample : DB not found
|
439
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=nonexistent;id=AJ617376"
|
440
|
+
|
441
|
+
<DT> <A href="?format=default;style=nonexistent;db=genbank;id=AJ617376">Error2</A> sample : unknown style
|
442
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=nonexistent;db=genbank;id=AJ617376"
|
443
|
+
|
444
|
+
<DT> <A href="?format=nonexistent;style=raw;db=genbank;id=AJ617376">Error3</A> sample : unknown format
|
445
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=nonexistent;style=raw;db=genbank;id=AJ617376"
|
446
|
+
|
447
|
+
<DT> <A href="?format=default;style=raw;db=genbank;id=nonexistent">Error4</A> sample : ID not found
|
448
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?format=default;style=raw;db=genbank;id=nonexistent"
|
449
|
+
|
450
|
+
<DT> <A href="?style=raw;db=genes;id=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51">Error5</A> sample : too many IDs
|
451
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?style=raw;db=genes;id=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51
|
452
|
+
|
453
|
+
<DT> <A href="?info=nonexistent">Error6</A> sample : unknown info
|
454
|
+
<DD> http://bioruby.org/cgi-bin/biofetch.rb?info=nonexistent"
|
455
|
+
</DL>
|
456
|
+
|
457
|
+
<H2>Other BioFetch implementations</H2>
|
458
|
+
|
459
|
+
<UL>
|
460
|
+
<LI> <A href="http://www.ebi.ac.uk/cgi-bin/dbfetch">dbfetch at EBI</A>
|
461
|
+
</UL>
|
462
|
+
|
463
|
+
<HR>
|
464
|
+
|
465
|
+
<DIV align=right>
|
466
|
+
<I>
|
467
|
+
staff@Bio<span class="ruby">Ruby</span>.org
|
468
|
+
</I>
|
469
|
+
<BR>
|
470
|
+
<BR>
|
471
|
+
<A href="http://bioruby.org/"><IMG border=0 src="/img/banner.gif"></A>
|
472
|
+
</DIV>
|
473
|
+
|
474
|
+
</BODY>
|
475
|
+
</HTML>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# color_scheme_na.rb - A Bio::ColorScheme demo script for Nucleic Acids
|
4
|
+
# sequences.
|
5
|
+
#
|
6
|
+
# Usage:
|
7
|
+
#
|
8
|
+
# % ruby color_scheme_na.rb > cs-seq-fna.html
|
9
|
+
#
|
10
|
+
# % cat seq.fna
|
11
|
+
# >DNA_sequence
|
12
|
+
# acgtgtgtcatgctagtcgatcgtactagtcgtagctagtca
|
13
|
+
# % ruby color_scheme_na.rb seq.fna > colored-seq-fna.html
|
14
|
+
#
|
15
|
+
#
|
16
|
+
# Copyright:: Copyright (C) 2005
|
17
|
+
# Mitsuteru C. Nakao <n@bioruby.org>
|
18
|
+
# License:: The Ruby License
|
19
|
+
#
|
20
|
+
# $Id: color_scheme_na.rb,v 1.3 2007/04/05 23:35:42 trevor Exp $
|
21
|
+
#
|
22
|
+
|
23
|
+
require 'bio'
|
24
|
+
|
25
|
+
|
26
|
+
# returns folded sequence with <br>.
|
27
|
+
def br(i, width = 80)
|
28
|
+
return "<br\n>" if i % width == 0
|
29
|
+
""
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
# returns sequence html doc
|
34
|
+
def display(seq, cs)
|
35
|
+
html = '<p style="font-family: monospace">'
|
36
|
+
postfix = '</span>'
|
37
|
+
i = 0
|
38
|
+
seq.each_byte do |c|
|
39
|
+
color = cs[c.chr]
|
40
|
+
prefix = %Q(<span style="background:\##{color};">)
|
41
|
+
html += prefix + c.chr + postfix
|
42
|
+
html += br(i += 1)
|
43
|
+
end
|
44
|
+
html + '</p>'
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
# returns scheme wise html doc
|
49
|
+
def display_scheme(scheme, naseq, aaseq)
|
50
|
+
html = ''
|
51
|
+
cs = eval("Bio::ColorScheme::#{scheme}")
|
52
|
+
[naseq, aaseq].each do |seq|
|
53
|
+
html += display(seq, cs)
|
54
|
+
end
|
55
|
+
return ['<div>', "<h3>#{cs}</h3>", html, '</div>']
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
if fna = ARGV.shift
|
61
|
+
naseq = Bio::FastaFormat.new(File.open(fna, 'r').read).naseq
|
62
|
+
aaseq = naseq.translate
|
63
|
+
else
|
64
|
+
naseq = Bio::Sequence::NA.new('acgtu' * 20).randomize
|
65
|
+
aaseq = naseq.translate
|
66
|
+
end
|
67
|
+
|
68
|
+
title = 'Bio::ColorScheme for DNA sequences'
|
69
|
+
doc = ['<html>',
|
70
|
+
'<header>', '<title>', title, '</title>', '</header>',
|
71
|
+
'<body>', '<h1>', title, '</h1>']
|
72
|
+
|
73
|
+
doc << ['<div>', '<h2>', 'Simple colors', '</h2>']
|
74
|
+
['Nucleotide'].each do |scheme|
|
75
|
+
doc << display_scheme(scheme, naseq, "")
|
76
|
+
end
|
77
|
+
doc << ['</div>']
|
78
|
+
|
79
|
+
['Zappo', 'Taylor' ].each do |scheme|
|
80
|
+
doc << display_scheme(scheme, "", aaseq)
|
81
|
+
end
|
82
|
+
doc << ['</div>']
|
83
|
+
|
84
|
+
|
85
|
+
doc << ['<div>', '<h2>', 'Score colors', '</h2>']
|
86
|
+
['Buried', 'Helix', 'Hydropathy', 'Strand', 'Turn'].each do |score|
|
87
|
+
doc << display_scheme(score, "", aaseq)
|
88
|
+
end
|
89
|
+
doc << ['</div>']
|
90
|
+
|
91
|
+
puts doc + ['</body>','</html>']
|
data/sample/dbget
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# dbget - DBGET client
|
4
|
+
#
|
5
|
+
# Interface to GenomeNet DBGET system - http://www.genome.jp/dbget/
|
6
|
+
#
|
7
|
+
# Copyright (C) 2001 KATAYAMA Toshiaki <k@bioruby.org>
|
8
|
+
#
|
9
|
+
# This program is free software; you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU General Public License as published by
|
11
|
+
# the Free Software Foundation; either version 2 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# This program is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU General Public License
|
20
|
+
# along with this program; if not, write to the Free Software
|
21
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
22
|
+
#
|
23
|
+
# $Id: dbget,v 1.7 2004/08/24 00:09:24 k Exp $
|
24
|
+
#
|
25
|
+
|
26
|
+
require "bio/io/dbget"
|
27
|
+
|
28
|
+
# DBGET command
|
29
|
+
com = File.basename($0) # e.g. $PATH/bget db entry
|
30
|
+
com = ARGV.shift if com == "dbget" # e.g. $PATH/dbget bget db entry
|
31
|
+
|
32
|
+
# DBGET query strings
|
33
|
+
arg = ARGV.join(" ")
|
34
|
+
|
35
|
+
# DBGET result
|
36
|
+
print Bio::DBGET.dbget(com, arg)
|
37
|
+
|