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,342 @@
|
|
1
|
+
#
|
2
|
+
# test/unit/bio/appl/hmmer/test_report.rb - Unit test for Bio::HMMER::Report
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2006 Mitsuteru Nakao <n@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# $Id: test_report.rb,v 1.3 2007/04/05 23:35:43 trevor Exp $
|
8
|
+
#
|
9
|
+
|
10
|
+
require 'pathname'
|
11
|
+
libpath = Pathname.new(File.join(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib'))).cleanpath.to_s
|
12
|
+
$:.unshift(libpath) unless $:.include?(libpath)
|
13
|
+
|
14
|
+
require 'test/unit'
|
15
|
+
require 'bio/appl/hmmer/report'
|
16
|
+
|
17
|
+
|
18
|
+
module Bio
|
19
|
+
|
20
|
+
class TestHMMERReportData
|
21
|
+
bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s
|
22
|
+
TestDataHMMER = Pathname.new(File.join(bioruby_root, 'test', 'data', 'HMMER')).cleanpath.to_s
|
23
|
+
|
24
|
+
def self.hmmpfam
|
25
|
+
File.open(File.join(TestDataHMMER, 'hmmpfam.out')).read
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.output
|
29
|
+
self.hmmpfam
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.hmmsearch
|
33
|
+
File.open(File.join(TestDataHMMER, 'hmmsearch.out')).read
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
class TestHMMERReportClassMethods < Test::Unit::TestCase
|
39
|
+
def test_reports_ary
|
40
|
+
ary = Bio::HMMER.reports(Bio::TestHMMERReportData.output)
|
41
|
+
assert_equal(Array, ary.class)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_reports_ary
|
45
|
+
Bio::HMMER.reports(Bio::TestHMMERReportData.output).each do |report|
|
46
|
+
assert_equal(Bio::HMMER::Report, report.class)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
class TestHMMERReportConstants < Test::Unit::TestCase
|
53
|
+
def test_rs
|
54
|
+
assert_equal("\n//\n", Bio::HMMER::Report::RS)
|
55
|
+
assert_equal("\n//\n", Bio::HMMER::Report::DELIMITER)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
class TestHMMERReportHmmpfam < Test::Unit::TestCase
|
61
|
+
def setup
|
62
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.hmmpfam)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_program
|
66
|
+
assert_equal(Hash, @obj.program.class)
|
67
|
+
assert_equal("hmmpfam - search one or more sequences against HMM database", @obj.program['name'])
|
68
|
+
assert_equal("HMMER 2.3.2 (Oct 2003)", @obj.program['version'])
|
69
|
+
assert_equal("Copyright (C) 1992-2003 HHMI/Washington University School of Medicine", @obj.program['copyright'])
|
70
|
+
assert_equal("Freely distributed under the GNU General Public License (GPL)", @obj.program['license'])
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_parameter
|
74
|
+
assert_equal(Hash, @obj.parameter.class)
|
75
|
+
assert_equal("/Users/nakao/Sites/iprscan/tmp/20050517/iprscan-20050517-16244071/chunk_1/iprscan-20050517-16244071.nocrc", @obj.parameter["Sequence file"])
|
76
|
+
assert_equal("/Users/nakao/Sites/iprscan/data/Pfam", @obj.parameter['HMM file'])
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_query_info
|
80
|
+
assert_equal(Hash, @obj.query_info.class)
|
81
|
+
assert_equal("104K_THEPA", @obj.query_info["Query sequence"])
|
82
|
+
assert_equal("[none]", @obj.query_info["Accession"])
|
83
|
+
assert_equal("[none]", @obj.query_info["Description"])
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_hits
|
87
|
+
assert_equal(Bio::HMMER::Report::Hit, @obj.hits.first.class)
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_hsps
|
91
|
+
assert_equal(Bio::HMMER::Report::Hsp, @obj.hsps.first.class)
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_histogram
|
95
|
+
assert_equal(nil, @obj.histogram)
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_statistical_detail
|
99
|
+
assert_equal(nil, @obj.statistical_detail)
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_total_seq_searched
|
103
|
+
assert_equal(nil, @obj.total_seq_searched)
|
104
|
+
end
|
105
|
+
|
106
|
+
def test_whole_seq_top_hits
|
107
|
+
assert_equal(nil, @obj.whole_seq_top_hits)
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_domain_top_hits
|
111
|
+
assert_equal(nil, @obj.domain_top_hits)
|
112
|
+
end
|
113
|
+
|
114
|
+
def test_each
|
115
|
+
@obj.each do |hit|
|
116
|
+
assert_equal(Bio::HMMER::Report::Hit, hit.class)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_each_hit
|
121
|
+
@obj.each_hit do |hit|
|
122
|
+
assert_equal(Bio::HMMER::Report::Hit, hit.class)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
|
128
|
+
class TestHMMERReportHit < Test::Unit::TestCase
|
129
|
+
def setup
|
130
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.output).hits.first
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_hit
|
134
|
+
assert_equal(Bio::HMMER::Report::Hit, @obj.class)
|
135
|
+
end
|
136
|
+
|
137
|
+
def test_hsps
|
138
|
+
assert_equal(Bio::HMMER::Report::Hsp, @obj.hsps.first.class)
|
139
|
+
end
|
140
|
+
|
141
|
+
def test_accession
|
142
|
+
assert_equal("PF04385.4", @obj.accession)
|
143
|
+
end
|
144
|
+
def test_target_id
|
145
|
+
assert_equal("PF04385.4", @obj.target_id)
|
146
|
+
end
|
147
|
+
def test_hit_id
|
148
|
+
assert_equal("PF04385.4", @obj.hit_id)
|
149
|
+
end
|
150
|
+
def test_entry_id
|
151
|
+
assert_equal("PF04385.4", @obj.entry_id)
|
152
|
+
end
|
153
|
+
|
154
|
+
def test_description
|
155
|
+
assert_equal("Domain of unknown function, DUF529", @obj.description)
|
156
|
+
end
|
157
|
+
def test_definition
|
158
|
+
assert_equal("Domain of unknown function, DUF529", @obj.definition)
|
159
|
+
end
|
160
|
+
|
161
|
+
def test_score
|
162
|
+
assert_equal(259.3, @obj.score)
|
163
|
+
end
|
164
|
+
def test_bit_score
|
165
|
+
assert_equal(259.3, @obj.bit_score)
|
166
|
+
end
|
167
|
+
|
168
|
+
def test_evalue
|
169
|
+
assert_equal(6.6e-75, @obj.evalue)
|
170
|
+
end
|
171
|
+
|
172
|
+
def test_num
|
173
|
+
assert_equal(4, @obj.num)
|
174
|
+
end
|
175
|
+
|
176
|
+
def test_each
|
177
|
+
@obj.each do |hsp|
|
178
|
+
assert_equal(Bio::HMMER::Report::Hsp, hsp.class)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
def test_each_hsp
|
183
|
+
@obj.each_hsp do |hsp|
|
184
|
+
assert_equal(Bio::HMMER::Report::Hsp, hsp.class)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def test_target_def
|
189
|
+
assert_equal("<4> Domain of unknown function, DUF529", @obj.target_def)
|
190
|
+
end
|
191
|
+
|
192
|
+
def test_append_hsp
|
193
|
+
hsp = @obj.hsps.first
|
194
|
+
assert_equal(5, @obj.append_hsp(hsp).size)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
class TestHMMERReportHsp < Test::Unit::TestCase
|
199
|
+
|
200
|
+
def setup
|
201
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.output).hits.first.hsps.first
|
202
|
+
end
|
203
|
+
|
204
|
+
def test_hsp
|
205
|
+
assert_equal(Bio::HMMER::Report::Hsp, @obj.class)
|
206
|
+
end
|
207
|
+
|
208
|
+
def test_accession
|
209
|
+
assert_equal("PF04385.4", @obj.accession)
|
210
|
+
end
|
211
|
+
|
212
|
+
def test_domain
|
213
|
+
assert_equal("1/4", @obj.domain)
|
214
|
+
end
|
215
|
+
|
216
|
+
def test_seq_f
|
217
|
+
assert_equal(36, @obj.seq_f)
|
218
|
+
end
|
219
|
+
|
220
|
+
def test_seq_t
|
221
|
+
assert_equal(111, @obj.seq_t)
|
222
|
+
end
|
223
|
+
|
224
|
+
def test_seq_ft
|
225
|
+
assert_equal("..", @obj.seq_ft)
|
226
|
+
end
|
227
|
+
|
228
|
+
def test_hmm_f
|
229
|
+
assert_equal(1, @obj.hmm_f)
|
230
|
+
end
|
231
|
+
|
232
|
+
def test_hmm_t
|
233
|
+
assert_equal(80, @obj.hmm_t)
|
234
|
+
end
|
235
|
+
|
236
|
+
def test_score
|
237
|
+
assert_equal(65.0, @obj.score)
|
238
|
+
end
|
239
|
+
def test_bit_score
|
240
|
+
assert_equal(65.0, @obj.bit_score)
|
241
|
+
end
|
242
|
+
|
243
|
+
def test_evalue
|
244
|
+
assert_equal(2.0e-16, @obj.evalue)
|
245
|
+
end
|
246
|
+
|
247
|
+
def test_midline
|
248
|
+
assert_equal("t+D+n++++ f +v+++g+++ + ++ ++v+++++++Gn+v+We++ + +l++ ++++++++++++++++ +++", @obj.midline)
|
249
|
+
end
|
250
|
+
|
251
|
+
def test_hmmseq
|
252
|
+
assert_equal("tLDlndtgstlkqfdykvalngdivvtytpkpGvkftkitdGnevvWeseddpefglivtlsfyldsnkfLvlllintak", @obj.hmmseq)
|
253
|
+
end
|
254
|
+
|
255
|
+
def test_flatseq
|
256
|
+
assert_equal("TFDINSNQTG-PAFLTAVEMAGVKYLQVQHGSNVNIHRLVEGNVVIWENA---STPLYTGAIVTNNDGPYMAYVEVLGDP", @obj.flatseq)
|
257
|
+
end
|
258
|
+
|
259
|
+
def test_query_frame
|
260
|
+
assert_equal(1, @obj.query_frame)
|
261
|
+
end
|
262
|
+
|
263
|
+
def test_target_frame
|
264
|
+
assert_equal(1, @obj.target_frame)
|
265
|
+
end
|
266
|
+
|
267
|
+
def test_csline
|
268
|
+
assert_equal(nil, @obj.csline)
|
269
|
+
end
|
270
|
+
|
271
|
+
def test_rfline
|
272
|
+
assert_equal(nil, @obj.rfline)
|
273
|
+
end
|
274
|
+
|
275
|
+
def test_set_alignment
|
276
|
+
end
|
277
|
+
|
278
|
+
def test_query_seq
|
279
|
+
assert_equal("TFDINSNQTG-PAFLTAVEMAGVKYLQVQHGSNVNIHRLVEGNVVIWENA---STPLYTGAIVTNNDGPYMAYVEVLGDP", @obj.query_seq)
|
280
|
+
end
|
281
|
+
|
282
|
+
def test_target_seq
|
283
|
+
assert_equal("tLDlndtgstlkqfdykvalngdivvtytpkpGvkftkitdGnevvWeseddpefglivtlsfyldsnkfLvlllintak", @obj.target_seq)
|
284
|
+
end
|
285
|
+
|
286
|
+
def test_target_from
|
287
|
+
assert_equal(1, @obj.target_from)
|
288
|
+
end
|
289
|
+
|
290
|
+
def test_targat_to
|
291
|
+
assert_equal(80, @obj.target_to)
|
292
|
+
end
|
293
|
+
|
294
|
+
def test_query_from
|
295
|
+
assert_equal(36, @obj.query_from)
|
296
|
+
end
|
297
|
+
|
298
|
+
def test_query_to
|
299
|
+
assert_equal(111, @obj.query_to)
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
class TestHMMERReportHmmsearch < Test::Unit::TestCase
|
304
|
+
def setup
|
305
|
+
@obj = Bio::HMMER::Report.new(Bio::TestHMMERReportData.hmmsearch)
|
306
|
+
end
|
307
|
+
|
308
|
+
def test_histogram
|
309
|
+
hist = "score obs exp (one = represents 1 sequences)\n----- --- ---\n 377 1 0|="
|
310
|
+
assert_equal(hist, @obj.histogram)
|
311
|
+
end
|
312
|
+
|
313
|
+
def test_statistical_detail
|
314
|
+
hash = {"P(chi-square)" => 0.0, "chi-sq statistic" => 0.0, "lambda" => 0.7676, "mu" => -10.6639}
|
315
|
+
assert_equal(hash, @obj.statistical_detail)
|
316
|
+
hash.keys.each do |key|
|
317
|
+
assert_equal(hash[key], @obj.statistical_detail[key])
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
def test_total_seq_searched
|
322
|
+
assert_equal(1, @obj.total_seq_searched)
|
323
|
+
end
|
324
|
+
|
325
|
+
def test_whole_seq_top_hit
|
326
|
+
hash = {"Total memory" => "16K", "Satisfying E cutoff" => 1, "Total hits" => 1}
|
327
|
+
assert_equal(hash, @obj.whole_seq_top_hits)
|
328
|
+
hash.keys.each do |key|
|
329
|
+
assert_equal(hash[key], @obj.whole_seq_top_hits[key])
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
def test_domain_top_hits
|
334
|
+
hash = {"Total memory" => "17K", "Satisfying E cutoff" => 1, "Total hits" => 1}
|
335
|
+
assert_equal(hash, @obj.domain_top_hits)
|
336
|
+
hash.keys.each do |key|
|
337
|
+
assert_equal(hash[key], @obj.domain_top_hits[key])
|
338
|
+
end
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
end # module Bio
|
@@ -0,0 +1,338 @@
|
|
1
|
+
#
|
2
|
+
# test/unit/bio/appl/iprscan/test_report.rb - Unit test for Bio::InterProScan::Report
|
3
|
+
#
|
4
|
+
# Copyright (C) 2006 Mitsuteru Nakao <n@bioruby.org>
|
5
|
+
#
|
6
|
+
# $Id: test_report.rb,v 1.7 2007/07/18 11:11:57 nakao Exp $
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib')).cleanpath.to_s
|
11
|
+
$:.unshift(libpath) unless $:.include?(libpath)
|
12
|
+
|
13
|
+
require 'test/unit'
|
14
|
+
require 'bio/appl/iprscan/report'
|
15
|
+
|
16
|
+
|
17
|
+
module Bio
|
18
|
+
class TestIprscanData
|
19
|
+
bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), [".."] * 5)).cleanpath.to_s
|
20
|
+
TestDataIprscan = Pathname.new(File.join(bioruby_root, "test", "data", "iprscan")).cleanpath.to_s
|
21
|
+
def self.raw_format
|
22
|
+
File.open(File.join(TestDataIprscan, "merged.raw"))
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.txt_format
|
26
|
+
File.open(File.join(TestDataIprscan, "merged.txt"))
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
class TestIprscanPTxtReport < Test::Unit::TestCase
|
33
|
+
|
34
|
+
def setup
|
35
|
+
test_entry=<<-END
|
36
|
+
slr0002\t860
|
37
|
+
InterPro\tIPR001264\tGlycosyl transferase, family 51
|
38
|
+
BlastProDom\tPD001895\tsp_Q55683_SYNY3_Q55683\t2e-37\t292-370
|
39
|
+
HMMPfam\tPF00912\tTransglycosyl\t8e-104\t204-372
|
40
|
+
InterPro\tIPR001460\tPenicillin-binding protein, transpeptidase domain
|
41
|
+
HMMPfam\tPF00905\tTranspeptidase\t5.7e-30\t451-742
|
42
|
+
InterPro\tNULL\tNULL
|
43
|
+
ProfileScan\tPS50310\tALA_RICH\t10.224\t805-856
|
44
|
+
//
|
45
|
+
END
|
46
|
+
@obj = Bio::Iprscan::Report.parse_ptxt_entry(test_entry)
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
def test_query_id
|
51
|
+
assert_equal('slr0002', @obj.query_id)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_query_length
|
55
|
+
assert_equal(860, @obj.query_length)
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_matches_size
|
59
|
+
assert_equal(4, @obj.matches.size)
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_match_ipr_id
|
63
|
+
assert_equal('IPR001264', @obj.matches.first.ipr_id)
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_match_ipr_description
|
67
|
+
assert_equal('Glycosyl transferase, family 51', @obj.matches.first.ipr_description)
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_match_method
|
71
|
+
assert_equal('BlastProDom', @obj.matches.first.method_name)
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_match_accession
|
75
|
+
assert_equal('PD001895', @obj.matches.first.accession)
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_match_description
|
79
|
+
assert_equal('sp_Q55683_SYNY3_Q55683', @obj.matches.first.description)
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_match_evalue
|
83
|
+
assert_equal('2e-37', @obj.matches.first.evalue)
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_match_match_start
|
87
|
+
assert_equal(292, @obj.matches.first.match_start)
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_match_match_end
|
91
|
+
assert_equal(370, @obj.matches.first.match_end)
|
92
|
+
end
|
93
|
+
|
94
|
+
end # TestIprscanPTxtReport
|
95
|
+
|
96
|
+
|
97
|
+
class TestIprscanTxtEntry < Test::Unit::TestCase
|
98
|
+
def setup
|
99
|
+
test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0]
|
100
|
+
@obj = Bio::Iprscan::Report.parse_txt_entry(test_txt)
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_iprscan_report_class
|
104
|
+
assert_equal(Bio::Iprscan::Report, @obj.class)
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_query_id
|
108
|
+
assert_equal('Q9RHD9', @obj.query_id)
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_query_length
|
112
|
+
assert_equal(267, @obj.query_length)
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_matches_size
|
116
|
+
assert_equal(16, @obj.matches.size)
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_match_ipr_id
|
120
|
+
assert_equal('IPR000110', @obj.matches.first.ipr_id)
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_match_ipr_description
|
124
|
+
assert_equal('Ribosomal protein S1', @obj.matches.first.ipr_description)
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_match_method
|
128
|
+
assert_equal('FPrintScan', @obj.matches.first.method_name)
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_match_accession
|
132
|
+
assert_equal('PR00681', @obj.matches.first.accession)
|
133
|
+
end
|
134
|
+
|
135
|
+
def test_match_description
|
136
|
+
assert_equal('RIBOSOMALS1', @obj.matches.first.description)
|
137
|
+
end
|
138
|
+
|
139
|
+
def test_match_evalue
|
140
|
+
assert_equal('1.5e-17', @obj.matches.first.evalue)
|
141
|
+
end
|
142
|
+
|
143
|
+
def test_match_status
|
144
|
+
assert_equal('T', @obj.matches.first.status)
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_match_date
|
148
|
+
assert_equal(nil, @obj.matches.first.date)
|
149
|
+
end
|
150
|
+
|
151
|
+
def test_match_match_start
|
152
|
+
assert_equal(6, @obj.matches.first.match_start)
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_match_match_end
|
156
|
+
assert_equal(27, @obj.matches.first.match_end)
|
157
|
+
end
|
158
|
+
|
159
|
+
def test_match_go_terms
|
160
|
+
ary = [["Molecular Function", "RNA binding", "GO:0003723"],
|
161
|
+
["Molecular Function", "structural constituent of ribosome", "GO:0003735"],
|
162
|
+
["Cellular Component", "ribosome", "GO:0005840"],
|
163
|
+
["Biological Process", "protein biosynthesis", "GO:0006412"]]
|
164
|
+
assert_equal(ary, @obj.matches.first.go_terms)
|
165
|
+
end
|
166
|
+
end # TestIprscanTxtEntry
|
167
|
+
|
168
|
+
|
169
|
+
class TestIprscanTxtEntryList < Test::Unit::TestCase
|
170
|
+
def setup
|
171
|
+
test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0]
|
172
|
+
@obj = Bio::Iprscan::Report.parse_txt_entry(test_txt)
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_to_hash
|
176
|
+
hsh = {"IPR008994" => [12, 13, 14].map {|x| @obj.matches[x] },
|
177
|
+
"IPR000110" => [0, 1, 2].map {|x| @obj.matches[x] },
|
178
|
+
"IPR003029" => [3, 4, 5, 6, 7, 8, 9, 10, 11].map {|x| @obj.matches[x] },
|
179
|
+
"NULL" => [15].map {|x| @obj.matches[x] }}
|
180
|
+
assert_equal(hsh.keys.sort, @obj.to_hash.keys.sort)
|
181
|
+
assert_equal(hsh, @obj.to_hash)
|
182
|
+
end
|
183
|
+
|
184
|
+
def test_to_hash_match?
|
185
|
+
@obj.to_hash.each do |ipr_id, matches|
|
186
|
+
matches.each do |match|
|
187
|
+
assert_equal(ipr_id, match.ipr_id)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end # TestIprscanTxtEntryList
|
192
|
+
|
193
|
+
|
194
|
+
class TestIprscanTxtReport < Test::Unit::TestCase
|
195
|
+
def setup
|
196
|
+
@test_txt = Bio::TestIprscanData.txt_format
|
197
|
+
end
|
198
|
+
|
199
|
+
def test_parse_txt
|
200
|
+
Bio::Iprscan::Report.parse_txt(@test_txt) do |report|
|
201
|
+
assert_equal(Bio::Iprscan::Report, report.class)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
|
206
|
+
end # TestIprscanTxtReport
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
class TestIprscanRawReport < Test::Unit::TestCase
|
211
|
+
def setup
|
212
|
+
test_raw = Bio::TestIprscanData.raw_format
|
213
|
+
entry = ''
|
214
|
+
@obj = []
|
215
|
+
while line = test_raw.gets
|
216
|
+
if entry.split("\t").first == line.split("\t").first
|
217
|
+
entry << line
|
218
|
+
elsif entry != '' and entry.split("\t").first != line.split("\t").first
|
219
|
+
@obj << Bio::Iprscan::Report.parse_raw_entry(entry)
|
220
|
+
entry = ''
|
221
|
+
else
|
222
|
+
entry << line
|
223
|
+
end
|
224
|
+
end
|
225
|
+
@obj << Bio::Iprscan::Report.parse_raw_entry(entry)
|
226
|
+
end
|
227
|
+
|
228
|
+
def test_self_reports_in_raw
|
229
|
+
io = File.open(File.join(Bio::TestIprscanData::TestDataIprscan,
|
230
|
+
"merged.raw"))
|
231
|
+
result = []
|
232
|
+
Bio::Iprscan::Report.parse_raw(io) {|x| result << x }
|
233
|
+
assert_equal(@obj.size, result.size)
|
234
|
+
assert_equal(@obj.first.query_id, result.first.query_id)
|
235
|
+
assert_equal(@obj.first.query_id, result.first.query_id)
|
236
|
+
assert_equal(@obj[2].query_id, result[2].query_id)
|
237
|
+
assert_equal(@obj.last.query_id, result.last.query_id)
|
238
|
+
end
|
239
|
+
|
240
|
+
def test_obj
|
241
|
+
assert_equal(3, @obj.size)
|
242
|
+
end
|
243
|
+
|
244
|
+
def test_query_id
|
245
|
+
assert_equal('Q9RHD9', @obj.first.query_id)
|
246
|
+
end
|
247
|
+
|
248
|
+
def test_entry_id
|
249
|
+
assert_equal('Q9RHD9', @obj.first.entry_id)
|
250
|
+
end
|
251
|
+
|
252
|
+
def test_query_length
|
253
|
+
assert_equal(267, @obj.first.query_length)
|
254
|
+
end
|
255
|
+
|
256
|
+
def test_match_query_id
|
257
|
+
assert_equal('Q9RHD9', @obj.first.matches.first.query_id)
|
258
|
+
end
|
259
|
+
|
260
|
+
def test_match_crc64
|
261
|
+
assert_equal('D44DAE8C544CB7C1', @obj.first.matches.first.crc64)
|
262
|
+
end
|
263
|
+
|
264
|
+
def test_match_query_length
|
265
|
+
assert_equal(267, @obj.first.matches.first.query_length)
|
266
|
+
end
|
267
|
+
|
268
|
+
def test_match_method
|
269
|
+
assert_equal('HMMPfam', @obj.first.matches.first.method_name)
|
270
|
+
end
|
271
|
+
|
272
|
+
def test_match_accession
|
273
|
+
assert_equal('PF00575', @obj.first.matches.first.accession)
|
274
|
+
end
|
275
|
+
|
276
|
+
def test_match_description
|
277
|
+
assert_equal('S1', @obj.first.matches.first.description)
|
278
|
+
end
|
279
|
+
|
280
|
+
def test_match_match_start
|
281
|
+
assert_equal(1, @obj.first.matches.first.match_start)
|
282
|
+
end
|
283
|
+
|
284
|
+
def test_match_match_end
|
285
|
+
assert_equal(55, @obj.first.matches.first.match_end)
|
286
|
+
end
|
287
|
+
|
288
|
+
def test_match_evalue
|
289
|
+
assert_equal('3.3E-6', @obj.first.matches.first.evalue)
|
290
|
+
end
|
291
|
+
|
292
|
+
def test_match_status
|
293
|
+
assert_equal('T', @obj.first.matches.first.status)
|
294
|
+
end
|
295
|
+
|
296
|
+
def test_match_date
|
297
|
+
assert_equal('11-Nov-2005', @obj.first.matches.first.date)
|
298
|
+
end
|
299
|
+
|
300
|
+
def test_match_ipr_id
|
301
|
+
assert_equal('IPR003029', @obj.first.matches.first.ipr_id)
|
302
|
+
end
|
303
|
+
|
304
|
+
def test_match_ipr_description
|
305
|
+
assert_equal('RNA binding S1', @obj.first.matches.first.ipr_description)
|
306
|
+
end
|
307
|
+
|
308
|
+
def test_match_go_terms
|
309
|
+
ary = ["Biological Process:phosphorylation (GO:0016310)",
|
310
|
+
"Molecular Function:transferase activity, transferring phosphorus-containing groups (GO:0016772)"]
|
311
|
+
assert_equal(ary,
|
312
|
+
@obj.last.matches.last.go_terms)
|
313
|
+
end
|
314
|
+
|
315
|
+
end
|
316
|
+
|
317
|
+
class TestIprscanReport < Test::Unit::TestCase
|
318
|
+
def setup
|
319
|
+
@test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0]
|
320
|
+
@obj = Bio::Iprscan::Report.parse_txt_entry(@test_txt)
|
321
|
+
@test_raw = Bio::TestIprscanData.raw_format.read.split("RS16_ECOLI")[0]
|
322
|
+
end
|
323
|
+
|
324
|
+
def test_to_raw
|
325
|
+
# assert_equal(@test_raw.split("\n").sort,
|
326
|
+
# @obj.format_raw.split("\n").sort)
|
327
|
+
end
|
328
|
+
|
329
|
+
def test_output_raw
|
330
|
+
# assert_equal(@test_raw.split("\n").sort,
|
331
|
+
# @obj.output(:raw).split("\n").sort)
|
332
|
+
# assert_equal(@test_raw.split("\n").sort,
|
333
|
+
# @obj.output('raw').split("\n").sort)
|
334
|
+
end
|
335
|
+
|
336
|
+
end # TestIprscanReport
|
337
|
+
|
338
|
+
end
|