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,176 @@
|
|
1
|
+
#
|
2
|
+
# = bio/db/pdb/residue.rb - residue class for PDB
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2004, 2006
|
5
|
+
# Alex Gutteridge <alexg@ebi.ac.uk>
|
6
|
+
# Naohisa Goto <ng@bioruby.org>
|
7
|
+
# License:: The Ruby License
|
8
|
+
#
|
9
|
+
# $Id: residue.rb,v 1.14 2007/12/18 13:48:42 ngoto Exp $
|
10
|
+
#
|
11
|
+
# = Bio::PDB::Residue
|
12
|
+
#
|
13
|
+
# = Bio::PDB::Heterogen
|
14
|
+
#
|
15
|
+
|
16
|
+
require 'bio/db/pdb'
|
17
|
+
|
18
|
+
module Bio
|
19
|
+
|
20
|
+
class PDB
|
21
|
+
|
22
|
+
# Bio::PDB::Residue is a class to store a residue.
|
23
|
+
# The object would contain some atoms (Bio::PDB::Record::ATOM objects).
|
24
|
+
#
|
25
|
+
class Residue
|
26
|
+
|
27
|
+
include Utils
|
28
|
+
include AtomFinder
|
29
|
+
|
30
|
+
include Enumerable
|
31
|
+
include Comparable
|
32
|
+
|
33
|
+
# Creates residue id from an ATOM (or HETATM) object.
|
34
|
+
def self.get_residue_id_from_atom(atom)
|
35
|
+
"#{atom.resSeq}#{atom.iCode.strip}".strip
|
36
|
+
end
|
37
|
+
|
38
|
+
# Creates a new Residue object.
|
39
|
+
def initialize(resName = nil, resSeq = nil, iCode = nil,
|
40
|
+
chain = nil)
|
41
|
+
|
42
|
+
@resName = resName
|
43
|
+
@resSeq = resSeq
|
44
|
+
@iCode = iCode
|
45
|
+
|
46
|
+
@chain = chain
|
47
|
+
@atoms = []
|
48
|
+
|
49
|
+
update_residue_id
|
50
|
+
end
|
51
|
+
|
52
|
+
# atoms in this residue. (Array)
|
53
|
+
attr_reader :atoms
|
54
|
+
|
55
|
+
# the chain to which this residue belongs
|
56
|
+
attr_accessor :chain
|
57
|
+
|
58
|
+
# resName (residue name)
|
59
|
+
attr_accessor :resName
|
60
|
+
|
61
|
+
# residue id (String or nil).
|
62
|
+
# The id is a composite of resSeq and iCode.
|
63
|
+
attr_reader :residue_id
|
64
|
+
|
65
|
+
# Now, Residue#id is an alias of residue_id.
|
66
|
+
alias id residue_id
|
67
|
+
|
68
|
+
#Keyed access to atoms based on atom name e.g. ["CA"]
|
69
|
+
def [](key)
|
70
|
+
atom = @atoms.find{ |atom| key == atom.name }
|
71
|
+
end
|
72
|
+
|
73
|
+
# Updates residue id. This is a private method.
|
74
|
+
# Need to call this method to make sure id is correctly updated.
|
75
|
+
def update_residue_id
|
76
|
+
if !@resSeq and !@iCode
|
77
|
+
@residue_id = nil
|
78
|
+
else
|
79
|
+
@residue_id = "#{@resSeq}#{@iCode.to_s.strip}".strip
|
80
|
+
end
|
81
|
+
end
|
82
|
+
private :update_residue_id
|
83
|
+
|
84
|
+
# resSeq
|
85
|
+
attr_reader :resSeq
|
86
|
+
|
87
|
+
# resSeq=()
|
88
|
+
def resSeq=(resSeq)
|
89
|
+
@resSeq = resSeq.to_i
|
90
|
+
update_residue_id
|
91
|
+
@resSeq
|
92
|
+
end
|
93
|
+
|
94
|
+
# iCode
|
95
|
+
attr_reader :iCode
|
96
|
+
|
97
|
+
# iCode=()
|
98
|
+
def iCode=(iCode)
|
99
|
+
@iCode = iCode
|
100
|
+
update_residue_id
|
101
|
+
@iCode
|
102
|
+
end
|
103
|
+
|
104
|
+
# Adds an atom to this residue
|
105
|
+
def addAtom(atom)
|
106
|
+
raise "Expecting ATOM or HETATM" unless atom.is_a? Bio::PDB::Record::ATOM
|
107
|
+
@atoms.push(atom)
|
108
|
+
self
|
109
|
+
end
|
110
|
+
|
111
|
+
# Iterator over the atoms
|
112
|
+
def each
|
113
|
+
@atoms.each{ |atom| yield atom }
|
114
|
+
end
|
115
|
+
# Alias to override AtomFinder#each_atom
|
116
|
+
alias each_atom each
|
117
|
+
|
118
|
+
# Sorts based on resSeq and iCode if need be
|
119
|
+
def <=>(other)
|
120
|
+
if @resSeq != other.resSeq
|
121
|
+
return @resSeq <=> other.resSeq
|
122
|
+
else
|
123
|
+
return @iCode <=> other.iCode
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Stringifies each atom
|
128
|
+
def to_s
|
129
|
+
@atoms.join('')
|
130
|
+
end
|
131
|
+
|
132
|
+
# returns a string containing human-readable representation
|
133
|
+
# of this object.
|
134
|
+
def inspect
|
135
|
+
"#<#{self.class.to_s} resName=#{resName.inspect} id=#{residue_id.inspect} chain.id=#{(chain ? chain.id : nil).inspect} resSeq=#{resSeq.inspect} iCode=#{iCode.inspect} atoms.size=#{atoms.size}>"
|
136
|
+
end
|
137
|
+
|
138
|
+
# Always returns false.
|
139
|
+
#
|
140
|
+
# If the residue is HETATM, returns true.
|
141
|
+
# Otherwise, returns false.
|
142
|
+
def hetatm
|
143
|
+
false
|
144
|
+
end
|
145
|
+
end #class Residue
|
146
|
+
|
147
|
+
# Bio::PDB::Heterogen is a class to store a heterogen.
|
148
|
+
# It inherits Bio::PDB::Residue and most of the methods are the same.
|
149
|
+
#
|
150
|
+
# The object would contain some HETATMs
|
151
|
+
# (Bio::PDB::Record::HETATM objects).
|
152
|
+
class Heterogen < Residue
|
153
|
+
|
154
|
+
include HetatmFinder
|
155
|
+
|
156
|
+
# Always returns true.
|
157
|
+
#
|
158
|
+
# If the residue is HETATM, returns true.
|
159
|
+
# Otherwise, returns false.
|
160
|
+
def hetatm
|
161
|
+
true
|
162
|
+
end
|
163
|
+
|
164
|
+
# Alias to override HetatmFinder#each_hetatm
|
165
|
+
alias each_hetatm each
|
166
|
+
|
167
|
+
# Alias needed for HeterogenFinder.
|
168
|
+
alias hetatms atoms
|
169
|
+
|
170
|
+
# Alias to avoid confusion
|
171
|
+
alias heterogen_id residue_id
|
172
|
+
end #class Heterogen
|
173
|
+
|
174
|
+
end #class PDB
|
175
|
+
|
176
|
+
end #module Bio
|
@@ -0,0 +1,399 @@
|
|
1
|
+
#
|
2
|
+
# = bio/db/pdb/utils.rb - Utility modules for PDB
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2004, 2006
|
5
|
+
# Alex Gutteridge <alexg@ebi.ac.uk>
|
6
|
+
# Naohisa Goto <ng@bioruby.org>
|
7
|
+
# License:: The Ruby License
|
8
|
+
#
|
9
|
+
# $Id: utils.rb,v 1.7 2007/04/05 23:35:41 trevor Exp $
|
10
|
+
#
|
11
|
+
# = Bio::PDB::Utils
|
12
|
+
#
|
13
|
+
# Bio::PDB::Utils
|
14
|
+
#
|
15
|
+
# = Bio::PDB::ModelFinder
|
16
|
+
#
|
17
|
+
# Bio::PDB::ModelFinder
|
18
|
+
#
|
19
|
+
# = Bio::PDB::ChainFinder
|
20
|
+
#
|
21
|
+
# Bio::PDB::ChainFinder
|
22
|
+
#
|
23
|
+
# = Bio::PDB::ResidueFinder
|
24
|
+
#
|
25
|
+
# Bio::PDB::ResidueFinder
|
26
|
+
#
|
27
|
+
# = Bio::PDB::AtomFinder
|
28
|
+
#
|
29
|
+
# Bio::PDB::AtomFinder
|
30
|
+
#
|
31
|
+
# = Bio::PDB::HeterogenFinder
|
32
|
+
#
|
33
|
+
# Bio::PDB::HeterogenFinder
|
34
|
+
#
|
35
|
+
# = Bio::PDB::HetatmFinder
|
36
|
+
#
|
37
|
+
# Bio::PDB::HetatmFinder
|
38
|
+
#
|
39
|
+
|
40
|
+
require 'matrix'
|
41
|
+
require 'bio/db/pdb'
|
42
|
+
|
43
|
+
module Bio; class PDB
|
44
|
+
|
45
|
+
# Utility methods for PDB data.
|
46
|
+
# The methods in this mixin should be applicalbe to all PDB objects.
|
47
|
+
#
|
48
|
+
# Bio::PDB::Utils is included by Bio::PDB, Bio::PDB::Model,
|
49
|
+
# Bio::PDB::Chain, Bio::PDB::Residue, and Bio::PDB::Heterogen classes.
|
50
|
+
module Utils
|
51
|
+
|
52
|
+
# Returns the coordinates of the geometric centre (average co-ord)
|
53
|
+
# of any AtomFinder (or .atoms) implementing object
|
54
|
+
#
|
55
|
+
# If you want to get the geometric centre of hetatms,
|
56
|
+
# call geometricCentre(:each_hetatm).
|
57
|
+
def geometricCentre(method = :each_atom)
|
58
|
+
x = y = z = count = 0
|
59
|
+
|
60
|
+
self.__send__(method) do |atom|
|
61
|
+
x += atom.x
|
62
|
+
y += atom.y
|
63
|
+
z += atom.z
|
64
|
+
count += 1
|
65
|
+
end
|
66
|
+
|
67
|
+
x = (x / count)
|
68
|
+
y = (y / count)
|
69
|
+
z = (z / count)
|
70
|
+
|
71
|
+
Coordinate[x,y,z]
|
72
|
+
end
|
73
|
+
|
74
|
+
#Returns the coords of the centre of gravity for any
|
75
|
+
#AtomFinder implementing object
|
76
|
+
#Blleurgh! - working out what element it is from the atom name is
|
77
|
+
#tricky - this'll work in most cases but not metals etc...
|
78
|
+
#a proper element field is included in some PDB files but not all.
|
79
|
+
ElementMass = {
|
80
|
+
'H' => 1,
|
81
|
+
'C' => 12,
|
82
|
+
'N' => 14,
|
83
|
+
'O' => 16,
|
84
|
+
'S' => 32,
|
85
|
+
'P' => 31
|
86
|
+
}
|
87
|
+
|
88
|
+
# calculates centre of gravitiy
|
89
|
+
def centreOfGravity()
|
90
|
+
x = y = z = total = 0
|
91
|
+
|
92
|
+
self.each_atom{ |atom|
|
93
|
+
element = atom.element[0,1]
|
94
|
+
mass = ElementMass[element]
|
95
|
+
total += mass
|
96
|
+
x += atom.x * mass
|
97
|
+
y += atom.y * mass
|
98
|
+
z += atom.z * mass
|
99
|
+
}
|
100
|
+
|
101
|
+
x = x / total
|
102
|
+
y = y / total
|
103
|
+
z = z / total
|
104
|
+
|
105
|
+
Coordinate[x,y,z]
|
106
|
+
end
|
107
|
+
|
108
|
+
#--
|
109
|
+
#Perhaps distance and dihedral would be better off as class methods?
|
110
|
+
#(rather) than instance methods
|
111
|
+
#++
|
112
|
+
|
113
|
+
# Calculates distance between _coord1_ and _coord2_.
|
114
|
+
def distance(coord1, coord2)
|
115
|
+
coord1 = convert_to_xyz(coord1)
|
116
|
+
coord2 = convert_to_xyz(coord2)
|
117
|
+
(coord1 - coord2).r
|
118
|
+
end
|
119
|
+
module_function :distance
|
120
|
+
|
121
|
+
# Calculates dihedral angle.
|
122
|
+
def dihedral_angle(coord1, coord2, coord3, coord4)
|
123
|
+
(a1,b1,c1,d) = calculatePlane(coord1,coord2,coord3)
|
124
|
+
(a2,b2,c2) = calculatePlane(coord2,coord3,coord4)
|
125
|
+
|
126
|
+
torsion = acos((a1*a2 + b1*b2 + c1*c2)/(Math.sqrt(a1**2 + b1**2 + c1**2) * Math.sqrt(a2**2 + b2**2 + c2**2)))
|
127
|
+
|
128
|
+
if ((a1*coord4.x + b1*coord4.y + c1*coord4.z + d) < 0)
|
129
|
+
-torsion
|
130
|
+
else
|
131
|
+
torsion
|
132
|
+
end
|
133
|
+
end
|
134
|
+
module_function :dihedral_angle
|
135
|
+
|
136
|
+
# Implicit conversion into Vector or Bio::PDB::Coordinate
|
137
|
+
def convert_to_xyz(obj)
|
138
|
+
unless obj.is_a?(Vector)
|
139
|
+
begin
|
140
|
+
obj = obj.xyz
|
141
|
+
rescue NameError
|
142
|
+
obj = Vector.elements(obj.to_a)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
obj
|
146
|
+
end
|
147
|
+
module_function :convert_to_xyz
|
148
|
+
|
149
|
+
# (Deprecated) alias of convert_to_xyz(obj)
|
150
|
+
def self.to_xyz(obj)
|
151
|
+
convert_to_xyz(obj)
|
152
|
+
end
|
153
|
+
|
154
|
+
#--
|
155
|
+
#Methods required for the dihedral angle calculations
|
156
|
+
#perhaps these should go in some separate Math module
|
157
|
+
#++
|
158
|
+
|
159
|
+
# radian to degree
|
160
|
+
def rad2deg(r)
|
161
|
+
(r/Math::PI)*180
|
162
|
+
end
|
163
|
+
module_function :rad2deg
|
164
|
+
|
165
|
+
# acos
|
166
|
+
def acos(x)
|
167
|
+
Math.atan2(Math.sqrt(1 - x**2),x)
|
168
|
+
end
|
169
|
+
module_function :acos
|
170
|
+
|
171
|
+
# calculates plane
|
172
|
+
def calculatePlane(coord1, coord2, coord3)
|
173
|
+
a = coord1.y * (coord2.z - coord3.z) +
|
174
|
+
coord2.y * (coord3.z - coord1.z) +
|
175
|
+
coord3.y * (coord1.z - coord2.z)
|
176
|
+
b = coord1.z * (coord2.x - coord3.x) +
|
177
|
+
coord2.z * (coord3.x - coord1.x) +
|
178
|
+
coord3.z * (coord1.x - coord2.x)
|
179
|
+
c = coord1.x * (coord2.y - coord3.y) +
|
180
|
+
coord2.x * (coord3.y - coord1.y) +
|
181
|
+
coord3.x * (coord1.y - coord2.y)
|
182
|
+
d = -1 *
|
183
|
+
(
|
184
|
+
(coord1.x * (coord2.y * coord3.z - coord3.y * coord2.z)) +
|
185
|
+
(coord2.x * (coord3.y * coord1.z - coord1.y * coord3.z)) +
|
186
|
+
(coord3.x * (coord1.y * coord2.z - coord2.y * coord1.z))
|
187
|
+
)
|
188
|
+
|
189
|
+
return [a,b,c,d]
|
190
|
+
end
|
191
|
+
module_function :calculatePlane
|
192
|
+
|
193
|
+
# Every class in the heirarchy implements finder, this takes
|
194
|
+
# a class which determines which type of object to find, the associated
|
195
|
+
# block is then run in classic .find style.
|
196
|
+
#
|
197
|
+
# The method might be deprecated.
|
198
|
+
# You'd better using find_XXX directly.
|
199
|
+
def finder(findtype, &block) #:yields: obj
|
200
|
+
if findtype == Bio::PDB::Atom
|
201
|
+
return self.find_atom(&block)
|
202
|
+
elsif findtype == Bio::PDB::Residue
|
203
|
+
return self.find_residue(&block)
|
204
|
+
elsif findtype == Bio::PDB::Chain
|
205
|
+
return self.find_chain(&block)
|
206
|
+
elsif findtype == Bio::PDB::Model
|
207
|
+
return self.find_model(&block)
|
208
|
+
else
|
209
|
+
raise TypeError, "You can't find a #{findtype}"
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end #module Utils
|
213
|
+
|
214
|
+
#--
|
215
|
+
#The *Finder modules implement a find_* method which returns
|
216
|
+
#an array of anything for which the block evals true
|
217
|
+
#(suppose Enumerable#find_all method).
|
218
|
+
#The each_* style methods act as classic iterators.
|
219
|
+
#++
|
220
|
+
|
221
|
+
# methods to access models
|
222
|
+
#
|
223
|
+
# XXX#each_model must be defined.
|
224
|
+
#
|
225
|
+
# Bio::PDB::ModelFinder is included by Bio::PDB::PDB.
|
226
|
+
#
|
227
|
+
module ModelFinder
|
228
|
+
# returns an array containing all chains for which given block
|
229
|
+
# is not +false+ (similar to Enumerable#find_all).
|
230
|
+
def find_model
|
231
|
+
array = []
|
232
|
+
self.each_model do |model|
|
233
|
+
array.push(model) if yield(model)
|
234
|
+
end
|
235
|
+
return array
|
236
|
+
end
|
237
|
+
end #module ModelFinder
|
238
|
+
|
239
|
+
#--
|
240
|
+
#The heirarchical nature of the objects allow us to re-use the
|
241
|
+
#methods from the previous level - e.g. A PDB object can use the .models
|
242
|
+
#method defined in ModuleFinder to iterate through the models to find the
|
243
|
+
#chains
|
244
|
+
#++
|
245
|
+
|
246
|
+
# methods to access chains
|
247
|
+
#
|
248
|
+
# XXX#each_model must be defined.
|
249
|
+
#
|
250
|
+
# Bio::PDB::ChainFinder is included by Bio::PDB::PDB and Bio::PDB::Model.
|
251
|
+
#
|
252
|
+
module ChainFinder
|
253
|
+
|
254
|
+
# returns an array containing all chains for which given block
|
255
|
+
# is not +false+ (similar to Enumerable#find_all).
|
256
|
+
def find_chain
|
257
|
+
array = []
|
258
|
+
self.each_chain do |chain|
|
259
|
+
array.push(chain) if yield(chain)
|
260
|
+
end
|
261
|
+
return array
|
262
|
+
end
|
263
|
+
|
264
|
+
# iterates over each chain
|
265
|
+
def each_chain(&x) #:yields: chain
|
266
|
+
self.each_model { |model| model.each(&x) }
|
267
|
+
end
|
268
|
+
|
269
|
+
# returns all chains
|
270
|
+
def chains
|
271
|
+
array = []
|
272
|
+
self.each_model { |model| array.concat(model.chains) }
|
273
|
+
return array
|
274
|
+
end
|
275
|
+
end #module ChainFinder
|
276
|
+
|
277
|
+
# methods to access residues
|
278
|
+
#
|
279
|
+
# XXX#each_chain must be defined.
|
280
|
+
#
|
281
|
+
# Bio::PDB::ResidueFinder is included by Bio::PDB::PDB, Bio::PDB::Model,
|
282
|
+
# and Bio::PDB::Chain.
|
283
|
+
#
|
284
|
+
module ResidueFinder
|
285
|
+
|
286
|
+
# returns an array containing all residues for which given block
|
287
|
+
# is not +false+ (similar to Enumerable#find_all).
|
288
|
+
def find_residue
|
289
|
+
array = []
|
290
|
+
self.each_residue do |residue|
|
291
|
+
array.push(residue) if yield(residue)
|
292
|
+
end
|
293
|
+
return array
|
294
|
+
end
|
295
|
+
|
296
|
+
# iterates over each residue
|
297
|
+
def each_residue(&x) #:yields: residue
|
298
|
+
self.each_chain { |chain| chain.each(&x) }
|
299
|
+
end
|
300
|
+
|
301
|
+
# returns all residues
|
302
|
+
def residues
|
303
|
+
array = []
|
304
|
+
self.each_chain { |chain| array.concat(chain.residues) }
|
305
|
+
return array
|
306
|
+
end
|
307
|
+
end #module ResidueFinder
|
308
|
+
|
309
|
+
# methods to access atoms
|
310
|
+
#
|
311
|
+
# XXX#each_residue must be defined.
|
312
|
+
module AtomFinder
|
313
|
+
# returns an array containing all atoms for which given block
|
314
|
+
# is not +false+ (similar to Enumerable#find_all).
|
315
|
+
def find_atom
|
316
|
+
array = []
|
317
|
+
self.each_atom do |atom|
|
318
|
+
array.push(atom) if yield(atom)
|
319
|
+
end
|
320
|
+
return array
|
321
|
+
end
|
322
|
+
|
323
|
+
# iterates over each atom
|
324
|
+
def each_atom(&x) #:yields: atom
|
325
|
+
self.each_residue { |residue| residue.each(&x) }
|
326
|
+
end
|
327
|
+
|
328
|
+
# returns all atoms
|
329
|
+
def atoms
|
330
|
+
array = []
|
331
|
+
self.each_residue { |residue| array.concat(residue.atoms) }
|
332
|
+
return array
|
333
|
+
end
|
334
|
+
end #module AtomFinder
|
335
|
+
|
336
|
+
# methods to access HETATMs
|
337
|
+
#
|
338
|
+
# XXX#each_heterogen must be defined.
|
339
|
+
#
|
340
|
+
# Bio::PDB::HetatmFinder is included by Bio::PDB::PDB, Bio::PDB::Model,
|
341
|
+
# Bio::PDB::Chain, and Bio::PDB::Heterogen.
|
342
|
+
#
|
343
|
+
module HetatmFinder
|
344
|
+
# returns an array containing all HETATMs for which given block
|
345
|
+
# is not +false+ (similar to Enumerable#find_all).
|
346
|
+
def find_hetatm
|
347
|
+
array = []
|
348
|
+
self.each_hetatm do |hetatm|
|
349
|
+
array.push(hetatm) if yield(hetatm)
|
350
|
+
end
|
351
|
+
return array
|
352
|
+
end
|
353
|
+
|
354
|
+
# iterates over each HETATM
|
355
|
+
def each_hetatm(&x) #:yields: hetatm
|
356
|
+
self.each_heterogen { |heterogen| heterogen.each(&x) }
|
357
|
+
end
|
358
|
+
|
359
|
+
# returns all HETATMs
|
360
|
+
def hetatms
|
361
|
+
array = []
|
362
|
+
self.each_heterogen { |heterogen| array.concat(heterogen.hetatms) }
|
363
|
+
return array
|
364
|
+
end
|
365
|
+
end #module HetatmFinder
|
366
|
+
|
367
|
+
# methods to access heterogens (compounds or ligands)
|
368
|
+
#
|
369
|
+
# XXX#each_chain must be defined.
|
370
|
+
#
|
371
|
+
# Bio::PDB::HeterogenFinder is included by Bio::PDB::PDB, Bio::PDB::Model,
|
372
|
+
# and Bio::PDB::Chain.
|
373
|
+
#
|
374
|
+
module HeterogenFinder
|
375
|
+
# returns an array containing all heterogens for which given block
|
376
|
+
# is not +false+ (similar to Enumerable#find_all).
|
377
|
+
def find_heterogen
|
378
|
+
array = []
|
379
|
+
self.each_heterogen do |heterogen|
|
380
|
+
array.push(heterogen) if yield(heterogen)
|
381
|
+
end
|
382
|
+
return array
|
383
|
+
end
|
384
|
+
|
385
|
+
# iterates over each heterogens
|
386
|
+
def each_heterogen(&x) #:yields: heterogen
|
387
|
+
self.each_chain { |chain| chain.each_heterogen(&x) }
|
388
|
+
end
|
389
|
+
|
390
|
+
# returns all heterogens
|
391
|
+
def heterogens
|
392
|
+
array = []
|
393
|
+
self.each_chain { |chain| array.concat(chain.heterogens) }
|
394
|
+
return array
|
395
|
+
end
|
396
|
+
end #module HeterogenFinder
|
397
|
+
|
398
|
+
end; end #module Bio; class PDB
|
399
|
+
|