wwood-bioruby 1.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +205 -0
- data/README_DEV.rdoc +285 -0
- data/VERSION.yml +4 -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/lib/bio.rb +306 -0
- data/lib/bio/alignment.rb +2518 -0
- data/lib/bio/appl/bl2seq/report.rb +334 -0
- data/lib/bio/appl/blast.rb +505 -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 +635 -0
- data/lib/bio/appl/blast/xmlparser.rb +236 -0
- data/lib/bio/appl/blat/report.rb +530 -0
- data/lib/bio/appl/clustalw.rb +219 -0
- data/lib/bio/appl/clustalw/report.rb +152 -0
- data/lib/bio/appl/emboss.rb +203 -0
- data/lib/bio/appl/fasta.rb +235 -0
- data/lib/bio/appl/fasta/format10.rb +325 -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.rb +126 -0
- data/lib/bio/appl/hmmer/report.rb +683 -0
- data/lib/bio/appl/iprscan/report.rb +374 -0
- data/lib/bio/appl/mafft.rb +259 -0
- data/lib/bio/appl/mafft/report.rb +226 -0
- data/lib/bio/appl/muscle.rb +52 -0
- data/lib/bio/appl/paml/baseml.rb +95 -0
- data/lib/bio/appl/paml/baseml/report.rb +32 -0
- data/lib/bio/appl/paml/codeml.rb +242 -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/common.rb +348 -0
- data/lib/bio/appl/paml/common_report.rb +38 -0
- data/lib/bio/appl/paml/yn00.rb +103 -0
- data/lib/bio/appl/paml/yn00/report.rb +32 -0
- data/lib/bio/appl/phylip/alignment.rb +133 -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 +548 -0
- data/lib/bio/appl/psort/report.rb +542 -0
- data/lib/bio/appl/pts1.rb +263 -0
- data/lib/bio/appl/sim4.rb +124 -0
- data/lib/bio/appl/sim4/report.rb +485 -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 +353 -0
- data/lib/bio/data/codontable.rb +722 -0
- data/lib/bio/data/na.rb +223 -0
- data/lib/bio/db.rb +329 -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.rb +410 -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/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.rb +29 -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/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/url.rb +42 -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.rb +482 -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/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.rb +456 -0
- data/lib/bio/sequence/aa.rb +152 -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/shell.rb +44 -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/tree.rb +852 -0
- data/lib/bio/util/color_scheme.rb +191 -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/contingency_table.rb +370 -0
- 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 +200 -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 +288 -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 +14 -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_psort.rb +57 -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/db/test_url.rb +36 -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 +505 -0
- data/test/unit/bio/io/test_soapwsdl.rb +32 -0
- data/test/unit/bio/sequence/test_aa.rb +115 -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 +543 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# = bio/db/genbank/ddbj.rb - DDBJ database class
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2000-2004 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# $Id: ddbj.rb,v 1.9 2007/04/05 23:35:40 trevor Exp $
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'bio/db/genbank/genbank'
|
11
|
+
|
12
|
+
module Bio
|
13
|
+
|
14
|
+
class DDBJ < GenBank
|
15
|
+
|
16
|
+
autoload :XML, 'bio/io/ddbjxml'
|
17
|
+
|
18
|
+
# Nothing to do (DDBJ database format is completely same as GenBank)
|
19
|
+
|
20
|
+
end # DDBJ
|
21
|
+
|
22
|
+
end # Bio
|
@@ -0,0 +1,187 @@
|
|
1
|
+
#
|
2
|
+
# = bio/db/genbank/format_genbank.rb - GenBank format generater
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2008 Naohisa Goto <ng@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# $Id: format_genbank.rb,v 1.1.2.5 2008/06/17 15:59:24 ngoto Exp $
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'bio/sequence/format'
|
11
|
+
|
12
|
+
module Bio::Sequence::Format::NucFormatter
|
13
|
+
|
14
|
+
# INTERNAL USE ONLY, YOU SHOULD NOT USE THIS CLASS.
|
15
|
+
# GenBank format output class for Bio::Sequence.
|
16
|
+
class Genbank < Bio::Sequence::Format::FormatterBase
|
17
|
+
|
18
|
+
# helper methods
|
19
|
+
include Bio::Sequence::Format::INSDFeatureHelper
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# string wrapper for GenBank format
|
24
|
+
def genbank_wrap(str)
|
25
|
+
wrap(str.to_s, 67).gsub(/\n/, "\n" + " " * 12)
|
26
|
+
end
|
27
|
+
|
28
|
+
# string wrap with adding a dot at the end of the string
|
29
|
+
def genbank_wrap_dot(str)
|
30
|
+
str = str.to_s
|
31
|
+
str = str + '.' unless /\.\z/ =~ str
|
32
|
+
genbank_wrap(str)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Given words (an Array of String) are wrapping with EMBL style.
|
36
|
+
# Each word is never splitted inside the word.
|
37
|
+
def genbank_wrap_words(array)
|
38
|
+
width = 67
|
39
|
+
result = []
|
40
|
+
str = nil
|
41
|
+
array.each do |x|
|
42
|
+
if str then
|
43
|
+
if str.length + 1 + x.length > width then
|
44
|
+
str = nil
|
45
|
+
else
|
46
|
+
str.concat ' '
|
47
|
+
str.concat x
|
48
|
+
end
|
49
|
+
end
|
50
|
+
unless str then
|
51
|
+
str = "#{x}"
|
52
|
+
result.push str
|
53
|
+
end
|
54
|
+
end
|
55
|
+
result.join("\n" + " " * 12)
|
56
|
+
end
|
57
|
+
|
58
|
+
# formats references
|
59
|
+
def reference_format_genbank(ref, num)
|
60
|
+
pos = ref.sequence_position.to_s.gsub(/\s/, '')
|
61
|
+
pos.gsub!(/(\d+)\-(\d+)/, "\\1 to \\2")
|
62
|
+
pos.gsub!(/\s*\,\s*/, '; ')
|
63
|
+
if pos.empty?
|
64
|
+
pos = ''
|
65
|
+
else
|
66
|
+
pos = " (bases #{pos})"
|
67
|
+
end
|
68
|
+
volissue = "#{ref.volume.to_s}"
|
69
|
+
volissue += " (#{ref.issue})" unless ref.issue.to_s.empty?
|
70
|
+
journal = "#{ref.journal.to_s}"
|
71
|
+
journal += " #{volissue}" unless volissue.empty?
|
72
|
+
journal += ", #{ref.pages}" unless ref.pages.to_s.empty?
|
73
|
+
journal += " (#{ref.year})" unless ref.year.to_s.empty?
|
74
|
+
|
75
|
+
alist = ref.authors.collect do |x|
|
76
|
+
y = x.to_s.strip.split(/\, *([^\,]+)\z/)
|
77
|
+
y[1].gsub!(/\. +/, '.') if y[1]
|
78
|
+
y.join(',')
|
79
|
+
end
|
80
|
+
lastauthor = alist.pop
|
81
|
+
last2author = alist.pop
|
82
|
+
alist.each { |x| x.concat ',' }
|
83
|
+
alist.push last2author if last2author
|
84
|
+
alist.push "and" unless alist.empty?
|
85
|
+
alist.push lastauthor.to_s
|
86
|
+
result = <<__END_OF_REFERENCE__
|
87
|
+
REFERENCE #{ genbank_wrap(sprintf('%-2d%s', num, pos))}
|
88
|
+
AUTHORS #{ genbank_wrap_words(alist) }
|
89
|
+
TITLE #{ genbank_wrap(ref.title.to_s) }
|
90
|
+
JOURNAL #{ genbank_wrap(journal) }
|
91
|
+
__END_OF_REFERENCE__
|
92
|
+
unless ref.pubmed.to_s.empty? then
|
93
|
+
result.concat " PUBMED #{ genbank_wrap(ref.pubmed) }\n"
|
94
|
+
end
|
95
|
+
if ref.comments and !(ref.comments.empty?) then
|
96
|
+
ref.comments.each do |c|
|
97
|
+
result.concat " REMARK #{ genbank_wrap(c) }\n"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
result
|
101
|
+
end
|
102
|
+
|
103
|
+
# formats comments lines as GenBank
|
104
|
+
def comments_format_genbank(cmnts)
|
105
|
+
return '' if !cmnts or cmnts.empty?
|
106
|
+
cmnts = [ cmnts ] unless cmnts.kind_of?(Array)
|
107
|
+
a = []
|
108
|
+
cmnts.each do |str|
|
109
|
+
a.push "COMMENT #{ genbank_wrap(str) }\n"
|
110
|
+
end
|
111
|
+
a.join('')
|
112
|
+
end
|
113
|
+
|
114
|
+
# formats sequence lines as GenBank
|
115
|
+
def seq_format_genbank(str)
|
116
|
+
i = 1
|
117
|
+
result = str.gsub(/.{1,60}/) do |s|
|
118
|
+
s = s.gsub(/.{1,10}/, ' \0')
|
119
|
+
y = sprintf("%9d%s\n", i, s)
|
120
|
+
i += 60
|
121
|
+
y
|
122
|
+
end
|
123
|
+
result
|
124
|
+
end
|
125
|
+
|
126
|
+
# formats date
|
127
|
+
def date_format_genbank
|
128
|
+
date_modified || date_created || null_date
|
129
|
+
end
|
130
|
+
|
131
|
+
# moleculue type
|
132
|
+
def mol_type_genbank
|
133
|
+
if /(DNA|(t|r|m|u|sn|sno)?RNA)/i =~ molecule_type.to_s then
|
134
|
+
$1.sub(/[DR]NA/) { |x| x.upcase }
|
135
|
+
else
|
136
|
+
'NA'
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# NCBI GI number
|
141
|
+
def ncbi_gi_number
|
142
|
+
ids = other_seqids
|
143
|
+
if ids and r = ids.find { |x| x.database == 'GI' } then
|
144
|
+
r.id
|
145
|
+
else
|
146
|
+
nil
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# strandedness
|
151
|
+
def strandedness_genbank
|
152
|
+
return nil unless strandedness
|
153
|
+
case strandedness
|
154
|
+
when 'single'; 'ss-';
|
155
|
+
when 'double'; 'ds-';
|
156
|
+
when 'mixed'; 'ms-';
|
157
|
+
else; nil
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Erb template of GenBank format for Bio::Sequence
|
162
|
+
erb_template <<'__END_OF_TEMPLATE__'
|
163
|
+
LOCUS <%= sprintf("%-16s", entry_id) %> <%= sprintf("%11d", length) %> bp <%= sprintf("%3s", strandedness_genbank) %><%= sprintf("%-6s", mol_type_genbank) %> <%= sprintf("%-8s", topology) %><%= sprintf("%4s", division) %> <%= date_format_genbank %>
|
164
|
+
DEFINITION <%= genbank_wrap_dot(definition.to_s) %>
|
165
|
+
ACCESSION <%= genbank_wrap(([ primary_accession ] + (secondary_accessions or [])).join(" ")) %>
|
166
|
+
VERSION <%= primary_accession %>.<%= sequence_version %><% if gi = ncbi_gi_number then %> GI:<%= gi %><% end %>
|
167
|
+
KEYWORDS <%= genbank_wrap_dot((keywords or []).join('; ')) %>
|
168
|
+
SOURCE <%= genbank_wrap(species) %>
|
169
|
+
ORGANISM <%= genbank_wrap(species) %>
|
170
|
+
<%= genbank_wrap_dot((classification or []).join('; ')) %>
|
171
|
+
<%
|
172
|
+
n = 0
|
173
|
+
(references or []).each do |ref|
|
174
|
+
n += 1
|
175
|
+
%><%= reference_format_genbank(ref, n) %><%
|
176
|
+
end
|
177
|
+
%><%= comments_format_genbank(comments)
|
178
|
+
%>FEATURES Location/Qualifiers
|
179
|
+
<%= format_features_genbank(features || [])
|
180
|
+
%>ORIGIN
|
181
|
+
<%= seq_format_genbank(seq)
|
182
|
+
%>//
|
183
|
+
__END_OF_TEMPLATE__
|
184
|
+
|
185
|
+
end #class Genbank
|
186
|
+
end #module Bio::Sequence::Format::NucFormatter
|
187
|
+
|
@@ -0,0 +1,250 @@
|
|
1
|
+
#
|
2
|
+
# = bio/db/genbank/genbank.rb - GenBank database class
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2000-2005 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# $Id: genbank.rb,v 0.40.2.4 2008/06/17 15:56:18 ngoto Exp $
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
require 'bio/db'
|
12
|
+
require 'bio/db/genbank/common'
|
13
|
+
require 'bio/sequence'
|
14
|
+
require 'bio/sequence/dblink'
|
15
|
+
|
16
|
+
module Bio
|
17
|
+
|
18
|
+
# == Description
|
19
|
+
#
|
20
|
+
# Parses a GenBank formatted database entry
|
21
|
+
#
|
22
|
+
# == Example
|
23
|
+
#
|
24
|
+
# # entry is a string containing only one entry contents
|
25
|
+
# gb = Bio::GenBank.new(entry)
|
26
|
+
#
|
27
|
+
class GenBank < NCBIDB
|
28
|
+
|
29
|
+
include Bio::NCBIDB::Common
|
30
|
+
|
31
|
+
# Parses the LOCUS line and returns contents of the LOCUS record
|
32
|
+
# as a Bio::GenBank::Locus object. Locus object is created automatically
|
33
|
+
# when Bio::GenBank#locus, entry_id etc. methods are called.
|
34
|
+
class Locus
|
35
|
+
def initialize(locus_line)
|
36
|
+
if locus_line.empty?
|
37
|
+
# do nothing (just for empty or incomplete entry string)
|
38
|
+
elsif locus_line.length > 75 # after Rel 126.0
|
39
|
+
@entry_id = locus_line[12..27].strip
|
40
|
+
@length = locus_line[29..39].to_i
|
41
|
+
@strand = locus_line[44..46].strip
|
42
|
+
@natype = locus_line[47..52].strip
|
43
|
+
@circular = locus_line[55..62].strip
|
44
|
+
@division = locus_line[63..66].strip
|
45
|
+
@date = locus_line[68..78].strip
|
46
|
+
else
|
47
|
+
@entry_id = locus_line[12..21].strip
|
48
|
+
@length = locus_line[22..29].to_i
|
49
|
+
@strand = locus_line[33..35].strip
|
50
|
+
@natype = locus_line[36..39].strip
|
51
|
+
@circular = locus_line[42..51].strip
|
52
|
+
@division = locus_line[52..54].strip
|
53
|
+
@date = locus_line[62..72].strip
|
54
|
+
end
|
55
|
+
end
|
56
|
+
attr_accessor :entry_id, :length, :strand, :natype, :circular,
|
57
|
+
:division, :date
|
58
|
+
end
|
59
|
+
|
60
|
+
# Accessor methods for the contents of the LOCUS record.
|
61
|
+
|
62
|
+
def locus
|
63
|
+
@data['LOCUS'] ||= Locus.new(get('LOCUS'))
|
64
|
+
end
|
65
|
+
|
66
|
+
def entry_id; locus.entry_id; end
|
67
|
+
def length; locus.length; end
|
68
|
+
def circular; locus.circular; end
|
69
|
+
def division; locus.division; end
|
70
|
+
def date; locus.date; end
|
71
|
+
|
72
|
+
def strand; locus.strand; end
|
73
|
+
def natype; locus.natype; end
|
74
|
+
|
75
|
+
|
76
|
+
# FEATURES -- Iterate only for the 'CDS' portion of the Bio::Features.
|
77
|
+
def each_cds
|
78
|
+
features.each do |feature|
|
79
|
+
if feature.feature == 'CDS'
|
80
|
+
yield(feature)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# FEATURES -- Iterate only for the 'gene' portion of the Bio::Features.
|
86
|
+
def each_gene
|
87
|
+
features.each do |feature|
|
88
|
+
if feature.feature == 'gene'
|
89
|
+
yield(feature)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
|
95
|
+
# BASE COUNT (this field is obsoleted after GenBank release 138.0) --
|
96
|
+
# Returns the BASE COUNT as a Hash. When the base is specified, returns
|
97
|
+
# count of the base as a Fixnum. The base can be one of 'a', 't', 'g',
|
98
|
+
# 'c', and 'o' (others).
|
99
|
+
def basecount(base = nil)
|
100
|
+
unless @data['BASE COUNT']
|
101
|
+
hash = Hash.new(0)
|
102
|
+
get('BASE COUNT').scan(/(\d+) (\w)/).each do |c, b|
|
103
|
+
hash[b] = c.to_i
|
104
|
+
end
|
105
|
+
@data['BASE COUNT'] = hash
|
106
|
+
end
|
107
|
+
|
108
|
+
if base
|
109
|
+
base.downcase!
|
110
|
+
@data['BASE COUNT'][base]
|
111
|
+
else
|
112
|
+
@data['BASE COUNT']
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# ORIGIN -- Returns DNA sequence in the ORIGIN record as a
|
117
|
+
# Bio::Sequence::NA object.
|
118
|
+
def seq
|
119
|
+
unless @data['SEQUENCE']
|
120
|
+
origin
|
121
|
+
end
|
122
|
+
Bio::Sequence::NA.new(@data['SEQUENCE'])
|
123
|
+
end
|
124
|
+
alias naseq seq
|
125
|
+
alias nalen length
|
126
|
+
|
127
|
+
# (obsolete???) length of the sequence
|
128
|
+
def seq_len
|
129
|
+
seq.length
|
130
|
+
end
|
131
|
+
|
132
|
+
# modified date. Returns Date object, String or nil.
|
133
|
+
def date_modified
|
134
|
+
begin
|
135
|
+
Date.parse(self.date)
|
136
|
+
rescue ArgumentError, TypeError, NoMethodError, NameError
|
137
|
+
self.date
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Taxonomy classfication. Returns an array of strings.
|
142
|
+
def classification
|
143
|
+
self.taxonomy.to_s.sub(/\.\z/, '').split(/\s*\;\s*/)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Strandedness. Returns one of 'single', 'double', 'mixed', or nil.
|
147
|
+
def strandedness
|
148
|
+
case self.strand.to_s.downcase
|
149
|
+
when 'ss-'; 'single'
|
150
|
+
when 'ds-'; 'double'
|
151
|
+
when 'ms-'; 'mixed'
|
152
|
+
else nil; end
|
153
|
+
end
|
154
|
+
|
155
|
+
# converts Bio::GenBank to Bio::Sequence
|
156
|
+
# ---
|
157
|
+
# *Arguments*:
|
158
|
+
# *Returns*:: Bio::Sequence object
|
159
|
+
def to_biosequence
|
160
|
+
Bio::Sequence.adapter(self, Bio::Sequence::Adapter::GenBank)
|
161
|
+
end
|
162
|
+
|
163
|
+
end # GenBank
|
164
|
+
end # Bio
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
if __FILE__ == $0
|
169
|
+
|
170
|
+
begin
|
171
|
+
require 'pp'
|
172
|
+
alias p pp
|
173
|
+
rescue LoadError
|
174
|
+
end
|
175
|
+
|
176
|
+
puts "### GenBank"
|
177
|
+
if ARGV.size > 0
|
178
|
+
gb = Bio::GenBank.new(ARGF.read)
|
179
|
+
else
|
180
|
+
require 'bio/io/fetch'
|
181
|
+
gb = Bio::GenBank.new(Bio::Fetch.query('gb', 'LPATOVGNS'))
|
182
|
+
end
|
183
|
+
|
184
|
+
puts "## LOCUS"
|
185
|
+
puts "# GenBank.locus"
|
186
|
+
p gb.locus
|
187
|
+
puts "# GenBank.entry_id"
|
188
|
+
p gb.entry_id
|
189
|
+
puts "# GenBank.nalen"
|
190
|
+
p gb.nalen
|
191
|
+
puts "# GenBank.strand"
|
192
|
+
p gb.strand
|
193
|
+
puts "# GenBank.natype"
|
194
|
+
p gb.natype
|
195
|
+
puts "# GenBank.circular"
|
196
|
+
p gb.circular
|
197
|
+
puts "# GenBank.division"
|
198
|
+
p gb.division
|
199
|
+
puts "# GenBank.date"
|
200
|
+
p gb.date
|
201
|
+
|
202
|
+
puts "## DEFINITION"
|
203
|
+
p gb.definition
|
204
|
+
|
205
|
+
puts "## ACCESSION"
|
206
|
+
p gb.accession
|
207
|
+
|
208
|
+
puts "## VERSION"
|
209
|
+
p gb.versions
|
210
|
+
p gb.version
|
211
|
+
p gb.gi
|
212
|
+
|
213
|
+
puts "## NID"
|
214
|
+
p gb.nid
|
215
|
+
|
216
|
+
puts "## KEYWORDS"
|
217
|
+
p gb.keywords
|
218
|
+
|
219
|
+
puts "## SEGMENT"
|
220
|
+
p gb.segment
|
221
|
+
|
222
|
+
puts "## SOURCE"
|
223
|
+
p gb.source
|
224
|
+
p gb.common_name
|
225
|
+
p gb.vernacular_name
|
226
|
+
p gb.organism
|
227
|
+
p gb.taxonomy
|
228
|
+
|
229
|
+
puts "## REFERENCE"
|
230
|
+
p gb.references
|
231
|
+
|
232
|
+
puts "## COMMENT"
|
233
|
+
p gb.comment
|
234
|
+
|
235
|
+
puts "## FEATURES"
|
236
|
+
p gb.features
|
237
|
+
|
238
|
+
puts "## BASE COUNT"
|
239
|
+
p gb.basecount
|
240
|
+
p gb.basecount('a')
|
241
|
+
p gb.basecount('A')
|
242
|
+
|
243
|
+
puts "## ORIGIN"
|
244
|
+
p gb.origin
|
245
|
+
p gb.naseq
|
246
|
+
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
|