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,23 @@
|
|
1
|
+
#
|
2
|
+
# = bio/sequence/format_raw.rb - Raw sequence formatter
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2008 Naohisa Goto <ng@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# $Id: format_raw.rb,v 1.1.2.1 2008/03/04 11:28:46 ngoto Exp $
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'bio/sequence/format'
|
11
|
+
|
12
|
+
module Bio::Sequence::Format::Formatter
|
13
|
+
|
14
|
+
# Raw sequence output formatter class
|
15
|
+
class Raw < Bio::Sequence::Format::FormatterBase
|
16
|
+
|
17
|
+
# output raw sequence data
|
18
|
+
def output
|
19
|
+
"#{@sequence.seq}"
|
20
|
+
end
|
21
|
+
end #class Raw
|
22
|
+
|
23
|
+
end #module Bio::Sequence::Format::Formatter
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#
|
2
|
+
# = bio/sequence/generic.rb - generic sequence class to store an intact string
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2006
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
# $Id: generic.rb,v 1.5 2007/04/05 23:35:41 trevor Exp $
|
9
|
+
#
|
10
|
+
|
11
|
+
require 'bio/sequence/common'
|
12
|
+
|
13
|
+
module Bio
|
14
|
+
class Sequence
|
15
|
+
|
16
|
+
class Generic < String #:nodoc:
|
17
|
+
|
18
|
+
include Bio::Sequence::Common
|
19
|
+
|
20
|
+
end # Generic
|
21
|
+
|
22
|
+
end # Sequence
|
23
|
+
end # Bio
|
24
|
+
|
@@ -0,0 +1,491 @@
|
|
1
|
+
#
|
2
|
+
# = bio/sequence/na.rb - nucleic acid sequence class
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2006
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>,
|
6
|
+
# Ryan Raaum <ryan@raaum.org>
|
7
|
+
# License:: The Ruby License
|
8
|
+
#
|
9
|
+
# $Id: na.rb,v 1.7 2007/04/23 16:43:51 trevor Exp $
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'bio/sequence/common'
|
13
|
+
|
14
|
+
module Bio
|
15
|
+
|
16
|
+
autoload :NucleicAcid, 'bio/data/na'
|
17
|
+
autoload :CodonTable, 'bio/data/codontable'
|
18
|
+
|
19
|
+
class Sequence
|
20
|
+
|
21
|
+
|
22
|
+
# = DESCRIPTION
|
23
|
+
# Bio::Sequence::NA represents a bare Nucleic Acid sequence in bioruby.
|
24
|
+
#
|
25
|
+
# = USAGE
|
26
|
+
# # Create a Nucleic Acid sequence.
|
27
|
+
# dna = Bio::Sequence.auto('atgcatgcATGCATGCAAAA')
|
28
|
+
# rna = Bio::Sequence.auto('augcaugcaugcaugcaaaa')
|
29
|
+
#
|
30
|
+
# # What are the names of all the bases?
|
31
|
+
# puts dna.names
|
32
|
+
# puts rna.names
|
33
|
+
#
|
34
|
+
# # What is the GC percentage?
|
35
|
+
# puts dna.gc_percent
|
36
|
+
# puts rna.gc_percent
|
37
|
+
#
|
38
|
+
# # What is the molecular weight?
|
39
|
+
# puts dna.molecular_weight
|
40
|
+
# puts rna.molecular_weight
|
41
|
+
#
|
42
|
+
# # What is the reverse complement?
|
43
|
+
# puts dna.reverse_complement
|
44
|
+
# puts dna.complement
|
45
|
+
#
|
46
|
+
# # Is this sequence DNA or RNA?
|
47
|
+
# puts dna.rna?
|
48
|
+
#
|
49
|
+
# # Translate my sequence (see method docs for many options)
|
50
|
+
# puts dna.translate
|
51
|
+
# puts rna.translate
|
52
|
+
class NA < String
|
53
|
+
|
54
|
+
include Bio::Sequence::Common
|
55
|
+
|
56
|
+
# Generate an nucleic acid sequence object from a string.
|
57
|
+
#
|
58
|
+
# s = Bio::Sequence::NA.new("aagcttggaccgttgaagt")
|
59
|
+
#
|
60
|
+
# or maybe (if you have an nucleic acid sequence in a file)
|
61
|
+
#
|
62
|
+
# s = Bio::Sequence:NA.new(File.open('dna.txt').read)
|
63
|
+
#
|
64
|
+
# Nucleic Acid sequences are *always* all lowercase in bioruby
|
65
|
+
#
|
66
|
+
# s = Bio::Sequence::NA.new("AAGcTtGG")
|
67
|
+
# puts s #=> "aagcttgg"
|
68
|
+
#
|
69
|
+
# Whitespace is stripped from the sequence
|
70
|
+
#
|
71
|
+
# seq = Bio::Sequence::NA.new("atg\nggg\ttt\r gc")
|
72
|
+
# puts s #=> "atggggttgc"
|
73
|
+
# ---
|
74
|
+
# *Arguments*:
|
75
|
+
# * (required) _str_: String
|
76
|
+
# *Returns*:: Bio::Sequence::NA object
|
77
|
+
def initialize(str)
|
78
|
+
super
|
79
|
+
self.downcase!
|
80
|
+
self.tr!(" \t\n\r",'')
|
81
|
+
end
|
82
|
+
|
83
|
+
# Alias of Bio::Sequence::Common splice method, documented there.
|
84
|
+
def splicing(position) #:nodoc:
|
85
|
+
mRNA = super
|
86
|
+
if mRNA.rna?
|
87
|
+
mRNA.tr!('t', 'u')
|
88
|
+
else
|
89
|
+
mRNA.tr!('u', 't')
|
90
|
+
end
|
91
|
+
mRNA
|
92
|
+
end
|
93
|
+
|
94
|
+
# Returns a new complementary sequence object (without reversing).
|
95
|
+
# The original sequence object is not modified.
|
96
|
+
#
|
97
|
+
# s = Bio::Sequence::NA.new('atgc')
|
98
|
+
# puts s.forward_complement #=> 'tacg'
|
99
|
+
# puts s #=> 'atgc'
|
100
|
+
# ---
|
101
|
+
# *Returns*:: new Bio::Sequence::NA object
|
102
|
+
def forward_complement
|
103
|
+
s = self.class.new(self)
|
104
|
+
s.forward_complement!
|
105
|
+
s
|
106
|
+
end
|
107
|
+
|
108
|
+
# Converts the current sequence into its complement (without reversing).
|
109
|
+
# The original sequence object is modified.
|
110
|
+
#
|
111
|
+
# seq = Bio::Sequence::NA.new('atgc')
|
112
|
+
# puts s.forward_complement! #=> 'tacg'
|
113
|
+
# puts s #=> 'tacg'
|
114
|
+
# ---
|
115
|
+
# *Returns*:: current Bio::Sequence::NA object (modified)
|
116
|
+
def forward_complement!
|
117
|
+
if self.rna?
|
118
|
+
self.tr!('augcrymkdhvbswn', 'uacgyrkmhdbvswn')
|
119
|
+
else
|
120
|
+
self.tr!('atgcrymkdhvbswn', 'tacgyrkmhdbvswn')
|
121
|
+
end
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
# Returns a new sequence object with the reverse complement
|
126
|
+
# sequence to the original. The original sequence is not modified.
|
127
|
+
#
|
128
|
+
# s = Bio::Sequence::NA.new('atgc')
|
129
|
+
# puts s.reverse_complement #=> 'gcat'
|
130
|
+
# puts s #=> 'atgc'
|
131
|
+
# ---
|
132
|
+
# *Returns*:: new Bio::Sequence::NA object
|
133
|
+
def reverse_complement
|
134
|
+
s = self.class.new(self)
|
135
|
+
s.reverse_complement!
|
136
|
+
s
|
137
|
+
end
|
138
|
+
|
139
|
+
# Converts the original sequence into its reverse complement.
|
140
|
+
# The original sequence is modified.
|
141
|
+
#
|
142
|
+
# s = Bio::Sequence::NA.new('atgc')
|
143
|
+
# puts s.reverse_complement #=> 'gcat'
|
144
|
+
# puts s #=> 'gcat'
|
145
|
+
# ---
|
146
|
+
# *Returns*:: current Bio::Sequence::NA object (modified)
|
147
|
+
def reverse_complement!
|
148
|
+
self.reverse!
|
149
|
+
self.forward_complement!
|
150
|
+
end
|
151
|
+
|
152
|
+
# Alias for Bio::Sequence::NA#reverse_complement
|
153
|
+
alias complement reverse_complement
|
154
|
+
|
155
|
+
# Alias for Bio::Sequence::NA#reverse_complement!
|
156
|
+
alias complement! reverse_complement!
|
157
|
+
|
158
|
+
|
159
|
+
# Translate into an amino acid sequence.
|
160
|
+
#
|
161
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
162
|
+
# puts s.translate #=> "MA*"
|
163
|
+
#
|
164
|
+
# By default, translate starts in reading frame position 1, but you
|
165
|
+
# can start in either 2 or 3 as well,
|
166
|
+
#
|
167
|
+
# puts s.translate(2) #=> "WR"
|
168
|
+
# puts s.translate(3) #=> "GV"
|
169
|
+
#
|
170
|
+
# You may also translate the reverse complement in one step by using frame
|
171
|
+
# values of -1, -2, and -3 (or 4, 5, and 6)
|
172
|
+
#
|
173
|
+
# puts s.translate(-1) #=> "SRH"
|
174
|
+
# puts s.translate(4) #=> "SRH"
|
175
|
+
# puts s.reverse_complement.translate(1) #=> "SRH"
|
176
|
+
#
|
177
|
+
# The default codon table in the translate function is the Standard
|
178
|
+
# Eukaryotic codon table. The translate function takes either a
|
179
|
+
# number or a Bio::CodonTable object for its table argument.
|
180
|
+
# The available tables are
|
181
|
+
# (NCBI[http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t]):
|
182
|
+
#
|
183
|
+
# 1. "Standard (Eukaryote)"
|
184
|
+
# 2. "Vertebrate Mitochondrial"
|
185
|
+
# 3. "Yeast Mitochondorial"
|
186
|
+
# 4. "Mold, Protozoan, Coelenterate Mitochondrial and Mycoplasma/Spiroplasma"
|
187
|
+
# 5. "Invertebrate Mitochondrial"
|
188
|
+
# 6. "Ciliate Macronuclear and Dasycladacean"
|
189
|
+
# 9. "Echinoderm Mitochondrial"
|
190
|
+
# 10. "Euplotid Nuclear"
|
191
|
+
# 11. "Bacteria"
|
192
|
+
# 12. "Alternative Yeast Nuclear"
|
193
|
+
# 13. "Ascidian Mitochondrial"
|
194
|
+
# 14. "Flatworm Mitochondrial"
|
195
|
+
# 15. "Blepharisma Macronuclear"
|
196
|
+
# 16. "Chlorophycean Mitochondrial"
|
197
|
+
# 21. "Trematode Mitochondrial"
|
198
|
+
# 22. "Scenedesmus obliquus mitochondrial"
|
199
|
+
# 23. "Thraustochytrium Mitochondrial"
|
200
|
+
#
|
201
|
+
# If you are using anything other than the default table, you must specify
|
202
|
+
# frame in the translate method call,
|
203
|
+
#
|
204
|
+
# puts s.translate #=> "MA*" (using defaults)
|
205
|
+
# puts s.translate(1,1) #=> "MA*" (same as above, but explicit)
|
206
|
+
# puts s.translate(1,2) #=> "MAW" (different codon table)
|
207
|
+
#
|
208
|
+
# and using a Bio::CodonTable instance in the translate method call,
|
209
|
+
#
|
210
|
+
# mt_table = Bio::CodonTable[2]
|
211
|
+
# puts s.translate(1, mt_table) #=> "MAW"
|
212
|
+
#
|
213
|
+
# By default, any invalid or unknown codons (as could happen if the
|
214
|
+
# sequence contains ambiguities) will be represented by 'X' in the
|
215
|
+
# translated sequence.
|
216
|
+
# You may change this to any character of your choice.
|
217
|
+
#
|
218
|
+
# s = Bio::Sequence::NA.new('atgcNNtga')
|
219
|
+
# puts s.translate #=> "MX*"
|
220
|
+
# puts s.translate(1,1,'9') #=> "M9*"
|
221
|
+
#
|
222
|
+
# The translate method considers gaps to be unknown characters and treats
|
223
|
+
# them as such (i.e. does not collapse sequences prior to translation), so
|
224
|
+
#
|
225
|
+
# s = Bio::Sequence::NA.new('atgc--tga')
|
226
|
+
# puts s.translate #=> "MX*"
|
227
|
+
# ---
|
228
|
+
# *Arguments*:
|
229
|
+
# * (optional) _frame_: one of 1,2,3,4,5,6,-1,-2,-3 (default 1)
|
230
|
+
# * (optional) _table_: Fixnum in range 1,23 or Bio::CodonTable object
|
231
|
+
# (default 1)
|
232
|
+
# * (optional) _unknown_: Character (default 'X')
|
233
|
+
# *Returns*:: Bio::Sequence::AA object
|
234
|
+
def translate(frame = 1, table = 1, unknown = 'X')
|
235
|
+
if table.is_a?(Bio::CodonTable)
|
236
|
+
ct = table
|
237
|
+
else
|
238
|
+
ct = Bio::CodonTable[table]
|
239
|
+
end
|
240
|
+
naseq = self.dna
|
241
|
+
case frame
|
242
|
+
when 1, 2, 3
|
243
|
+
from = frame - 1
|
244
|
+
when 4, 5, 6
|
245
|
+
from = frame - 4
|
246
|
+
naseq.complement!
|
247
|
+
when -1, -2, -3
|
248
|
+
from = -1 - frame
|
249
|
+
naseq.complement!
|
250
|
+
else
|
251
|
+
from = 0
|
252
|
+
end
|
253
|
+
nalen = naseq.length - from
|
254
|
+
nalen -= nalen % 3
|
255
|
+
aaseq = naseq[from, nalen].gsub(/.{3}/) {|codon| ct[codon] or unknown}
|
256
|
+
return Bio::Sequence::AA.new(aaseq)
|
257
|
+
end
|
258
|
+
|
259
|
+
# Returns counts of each codon in the sequence in a hash.
|
260
|
+
#
|
261
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
262
|
+
# puts s.codon_usage #=> {"gcg"=>1, "tga"=>1, "atg"=>1}
|
263
|
+
#
|
264
|
+
# This method does not validate codons! Any three letter group is a 'codon'. So,
|
265
|
+
#
|
266
|
+
# s = Bio::Sequence::NA.new('atggNNtga')
|
267
|
+
# puts s.codon_usage #=> {"tga"=>1, "gnn"=>1, "atg"=>1}
|
268
|
+
#
|
269
|
+
# seq = Bio::Sequence::NA.new('atgg--tga')
|
270
|
+
# puts s.codon_usage #=> {"tga"=>1, "g--"=>1, "atg"=>1}
|
271
|
+
#
|
272
|
+
# Also, there is no option to work in any frame other than the first.
|
273
|
+
# ---
|
274
|
+
# *Returns*:: Hash object
|
275
|
+
def codon_usage
|
276
|
+
hash = Hash.new(0)
|
277
|
+
self.window_search(3, 3) do |codon|
|
278
|
+
hash[codon] += 1
|
279
|
+
end
|
280
|
+
return hash
|
281
|
+
end
|
282
|
+
|
283
|
+
# Calculate the ratio of GC / ATGC bases as a percentage rounded to
|
284
|
+
# the nearest whole number. U is regarded as T.
|
285
|
+
#
|
286
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
287
|
+
# puts s.gc_percent #=> 55
|
288
|
+
# ---
|
289
|
+
# *Returns*:: Fixnum
|
290
|
+
def gc_percent
|
291
|
+
count = self.composition
|
292
|
+
at = count['a'] + count['t'] + count['u']
|
293
|
+
gc = count['g'] + count['c']
|
294
|
+
return 0 if at + gc == 0
|
295
|
+
gc = 100 * gc / (at + gc)
|
296
|
+
return gc
|
297
|
+
end
|
298
|
+
|
299
|
+
# Calculate the ratio of GC / ATGC bases. U is regarded as T.
|
300
|
+
#
|
301
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
302
|
+
# puts s.gc_content #=> 0.555555555555556
|
303
|
+
# ---
|
304
|
+
# *Returns*:: Float
|
305
|
+
def gc_content
|
306
|
+
count = self.composition
|
307
|
+
at = count['a'] + count['t'] + count['u']
|
308
|
+
gc = count['g'] + count['c']
|
309
|
+
return 0.0 if at + gc == 0
|
310
|
+
return gc.quo(at + gc)
|
311
|
+
end
|
312
|
+
|
313
|
+
# Calculate the ratio of AT / ATGC bases. U is regarded as T.
|
314
|
+
#
|
315
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
316
|
+
# puts s.at_content #=> 0.444444444444444
|
317
|
+
# ---
|
318
|
+
# *Returns*:: Float
|
319
|
+
def at_content
|
320
|
+
count = self.composition
|
321
|
+
at = count['a'] + count['t'] + count['u']
|
322
|
+
gc = count['g'] + count['c']
|
323
|
+
return 0.0 if at + gc == 0
|
324
|
+
return at.quo(at + gc)
|
325
|
+
end
|
326
|
+
|
327
|
+
# Calculate the ratio of (G - C) / (G + C) bases.
|
328
|
+
#
|
329
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
330
|
+
# puts s.gc_skew #=> 0.6
|
331
|
+
# ---
|
332
|
+
# *Returns*:: Float
|
333
|
+
def gc_skew
|
334
|
+
count = self.composition
|
335
|
+
g = count['g']
|
336
|
+
c = count['c']
|
337
|
+
return 0.0 if g + c == 0
|
338
|
+
return (g - c).quo(g + c)
|
339
|
+
end
|
340
|
+
|
341
|
+
# Calculate the ratio of (A - T) / (A + T) bases. U is regarded as T.
|
342
|
+
#
|
343
|
+
# s = Bio::Sequence::NA.new('atgttgttgttc')
|
344
|
+
# puts s.at_skew #=> -0.75
|
345
|
+
# ---
|
346
|
+
# *Returns*:: Float
|
347
|
+
def at_skew
|
348
|
+
count = self.composition
|
349
|
+
a = count['a']
|
350
|
+
t = count['t'] + count['u']
|
351
|
+
return 0.0 if a + t == 0
|
352
|
+
return (a - t).quo(a + t)
|
353
|
+
end
|
354
|
+
|
355
|
+
# Returns an alphabetically sorted array of any non-standard bases
|
356
|
+
# (other than 'atgcu').
|
357
|
+
#
|
358
|
+
# s = Bio::Sequence::NA.new('atgStgQccR')
|
359
|
+
# puts s.illegal_bases #=> ["q", "r", "s"]
|
360
|
+
# ---
|
361
|
+
# *Returns*:: Array object
|
362
|
+
def illegal_bases
|
363
|
+
self.scan(/[^atgcu]/).sort.uniq
|
364
|
+
end
|
365
|
+
|
366
|
+
# Estimate molecular weight (using the values from BioPerl's
|
367
|
+
# SeqStats.pm[http://doc.bioperl.org/releases/bioperl-1.0.1/Bio/Tools/SeqStats.html] module).
|
368
|
+
#
|
369
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
370
|
+
# puts s.molecular_weight #=> 2841.00708
|
371
|
+
#
|
372
|
+
# RNA and DNA do not have the same molecular weights,
|
373
|
+
#
|
374
|
+
# s = Bio::Sequence::NA.new('auggcguga')
|
375
|
+
# puts s.molecular_weight #=> 2956.94708
|
376
|
+
# ---
|
377
|
+
# *Returns*:: Float object
|
378
|
+
def molecular_weight
|
379
|
+
if self.rna?
|
380
|
+
Bio::NucleicAcid.weight(self, true)
|
381
|
+
else
|
382
|
+
Bio::NucleicAcid.weight(self)
|
383
|
+
end
|
384
|
+
end
|
385
|
+
|
386
|
+
# Create a ruby regular expression instance
|
387
|
+
# (Regexp)[http://corelib.rubyonrails.org/classes/Regexp.html]
|
388
|
+
#
|
389
|
+
# s = Bio::Sequence::NA.new('atggcgtga')
|
390
|
+
# puts s.to_re #=> /atggcgtga/
|
391
|
+
# ---
|
392
|
+
# *Returns*:: Regexp object
|
393
|
+
def to_re
|
394
|
+
if self.rna?
|
395
|
+
Bio::NucleicAcid.to_re(self.dna, true)
|
396
|
+
else
|
397
|
+
Bio::NucleicAcid.to_re(self)
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
401
|
+
# Generate the list of the names of each nucleotide along with the
|
402
|
+
# sequence (full name). Names used in bioruby are found in the
|
403
|
+
# Bio::AminoAcid::NAMES hash.
|
404
|
+
#
|
405
|
+
# s = Bio::Sequence::NA.new('atg')
|
406
|
+
# puts s.names #=> ["Adenine", "Thymine", "Guanine"]
|
407
|
+
# ---
|
408
|
+
# *Returns*:: Array object
|
409
|
+
def names
|
410
|
+
array = []
|
411
|
+
self.each_byte do |x|
|
412
|
+
array.push(Bio::NucleicAcid.names[x.chr.upcase])
|
413
|
+
end
|
414
|
+
return array
|
415
|
+
end
|
416
|
+
|
417
|
+
# Returns a new sequence object with any 'u' bases changed to 't'.
|
418
|
+
# The original sequence is not modified.
|
419
|
+
#
|
420
|
+
# s = Bio::Sequence::NA.new('augc')
|
421
|
+
# puts s.dna #=> 'atgc'
|
422
|
+
# puts s #=> 'augc'
|
423
|
+
# ---
|
424
|
+
# *Returns*:: new Bio::Sequence::NA object
|
425
|
+
def dna
|
426
|
+
self.tr('u', 't')
|
427
|
+
end
|
428
|
+
|
429
|
+
# Changes any 'u' bases in the original sequence to 't'.
|
430
|
+
# The original sequence is modified.
|
431
|
+
#
|
432
|
+
# s = Bio::Sequence::NA.new('augc')
|
433
|
+
# puts s.dna! #=> 'atgc'
|
434
|
+
# puts s #=> 'atgc'
|
435
|
+
# ---
|
436
|
+
# *Returns*:: current Bio::Sequence::NA object (modified)
|
437
|
+
def dna!
|
438
|
+
self.tr!('u', 't')
|
439
|
+
end
|
440
|
+
|
441
|
+
# Returns a new sequence object with any 't' bases changed to 'u'.
|
442
|
+
# The original sequence is not modified.
|
443
|
+
#
|
444
|
+
# s = Bio::Sequence::NA.new('atgc')
|
445
|
+
# puts s.dna #=> 'augc'
|
446
|
+
# puts s #=> 'atgc'
|
447
|
+
# ---
|
448
|
+
# *Returns*:: new Bio::Sequence::NA object
|
449
|
+
def rna
|
450
|
+
self.tr('t', 'u')
|
451
|
+
end
|
452
|
+
|
453
|
+
# Changes any 't' bases in the original sequence to 'u'.
|
454
|
+
# The original sequence is modified.
|
455
|
+
#
|
456
|
+
# s = Bio::Sequence::NA.new('atgc')
|
457
|
+
# puts s.dna! #=> 'augc'
|
458
|
+
# puts s #=> 'augc'
|
459
|
+
# ---
|
460
|
+
# *Returns*:: current Bio::Sequence::NA object (modified)
|
461
|
+
def rna!
|
462
|
+
self.tr!('t', 'u')
|
463
|
+
end
|
464
|
+
|
465
|
+
def rna?
|
466
|
+
self.index('u')
|
467
|
+
end
|
468
|
+
protected :rna?
|
469
|
+
|
470
|
+
# Example:
|
471
|
+
#
|
472
|
+
# seq = Bio::Sequence::NA.new('gaattc')
|
473
|
+
# cuts = seq.cut_with_enzyme('EcoRI')
|
474
|
+
#
|
475
|
+
# _or_
|
476
|
+
#
|
477
|
+
# seq = Bio::Sequence::NA.new('gaattc')
|
478
|
+
# cuts = seq.cut_with_enzyme('g^aattc')
|
479
|
+
# ---
|
480
|
+
# See Bio::RestrictionEnzyme::Analysis.cut
|
481
|
+
def cut_with_enzyme(*args)
|
482
|
+
Bio::RestrictionEnzyme::Analysis.cut(self, *args)
|
483
|
+
end
|
484
|
+
alias cut_with_enzymes cut_with_enzyme
|
485
|
+
|
486
|
+
end # NA
|
487
|
+
|
488
|
+
end # Sequence
|
489
|
+
|
490
|
+
end # Bio
|
491
|
+
|