bio 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +2105 -3728
- data/KNOWN_ISSUES.rdoc +35 -3
- data/README.rdoc +8 -2
- data/RELEASE_NOTES.rdoc +166 -0
- data/bin/bioruby +4 -1
- data/bioruby.gemspec +146 -1
- data/bioruby.gemspec.erb +3 -1
- data/doc/ChangeLog-before-1.3.1 +3961 -0
- data/doc/Tutorial.rd +154 -22
- data/doc/Tutorial.rd.html +125 -68
- data/lib/bio.rb +21 -6
- data/lib/bio/appl/bl2seq/report.rb +11 -202
- data/lib/bio/appl/blast/format0.rb +0 -193
- data/lib/bio/appl/blast/report.rb +2 -147
- data/lib/bio/appl/blast/wublast.rb +0 -208
- data/lib/bio/appl/fasta.rb +4 -19
- data/lib/bio/appl/fasta/format10.rb +0 -14
- data/lib/bio/appl/genscan/report.rb +0 -176
- data/lib/bio/appl/hmmer.rb +1 -15
- data/lib/bio/appl/hmmer/report.rb +0 -100
- data/lib/bio/appl/meme/mast.rb +156 -0
- data/lib/bio/appl/meme/mast/report.rb +91 -0
- data/lib/bio/appl/meme/motif.rb +48 -0
- data/lib/bio/appl/psort.rb +0 -111
- data/lib/bio/appl/psort/report.rb +1 -45
- data/lib/bio/appl/pts1.rb +2 -4
- data/lib/bio/appl/sosui/report.rb +5 -54
- data/lib/bio/appl/targetp/report.rb +1 -104
- data/lib/bio/appl/tmhmm/report.rb +0 -36
- data/lib/bio/command.rb +94 -10
- data/lib/bio/data/aa.rb +1 -77
- data/lib/bio/data/codontable.rb +1 -95
- data/lib/bio/data/na.rb +1 -26
- data/lib/bio/db/aaindex.rb +1 -38
- data/lib/bio/db/fasta.rb +1 -134
- data/lib/bio/db/fasta/format_qual.rb +204 -0
- data/lib/bio/db/fasta/qual.rb +102 -0
- data/lib/bio/db/fastq.rb +645 -0
- data/lib/bio/db/fastq/fastq_to_biosequence.rb +40 -0
- data/lib/bio/db/fastq/format_fastq.rb +175 -0
- data/lib/bio/db/genbank/genbank.rb +1 -86
- data/lib/bio/db/gff.rb +0 -17
- data/lib/bio/db/go.rb +4 -72
- data/lib/bio/db/kegg/common.rb +112 -0
- data/lib/bio/db/kegg/compound.rb +29 -20
- data/lib/bio/db/kegg/drug.rb +74 -34
- data/lib/bio/db/kegg/enzyme.rb +26 -5
- data/lib/bio/db/kegg/genes.rb +128 -15
- data/lib/bio/db/kegg/genome.rb +3 -41
- data/lib/bio/db/kegg/glycan.rb +19 -24
- data/lib/bio/db/kegg/orthology.rb +16 -56
- data/lib/bio/db/kegg/reaction.rb +81 -28
- data/lib/bio/db/kegg/taxonomy.rb +1 -52
- data/lib/bio/db/litdb.rb +1 -16
- data/lib/bio/db/phyloxml/phyloxml.xsd +582 -0
- data/lib/bio/db/phyloxml/phyloxml_elements.rb +1174 -0
- data/lib/bio/db/phyloxml/phyloxml_parser.rb +954 -0
- data/lib/bio/db/phyloxml/phyloxml_writer.rb +228 -0
- data/lib/bio/db/prosite.rb +2 -95
- data/lib/bio/db/rebase.rb +5 -6
- data/lib/bio/db/sanger_chromatogram/abif.rb +120 -0
- data/lib/bio/db/sanger_chromatogram/chromatogram.rb +133 -0
- data/lib/bio/db/sanger_chromatogram/chromatogram_to_biosequence.rb +32 -0
- data/lib/bio/db/sanger_chromatogram/scf.rb +210 -0
- data/lib/bio/io/das.rb +0 -44
- data/lib/bio/io/ddbjxml.rb +1 -181
- data/lib/bio/io/flatfile.rb +1 -7
- data/lib/bio/io/flatfile/autodetection.rb +6 -0
- data/lib/bio/io/keggapi.rb +0 -442
- data/lib/bio/io/ncbirest.rb +130 -132
- data/lib/bio/io/ncbisoap.rb +2 -1
- data/lib/bio/io/pubmed.rb +0 -88
- data/lib/bio/location.rb +0 -73
- data/lib/bio/pathway.rb +0 -171
- data/lib/bio/sequence.rb +18 -1
- data/lib/bio/sequence/adapter.rb +3 -0
- data/lib/bio/sequence/format.rb +16 -0
- data/lib/bio/sequence/quality_score.rb +205 -0
- data/lib/bio/tree.rb +70 -5
- data/lib/bio/util/restriction_enzyme/single_strand.rb +3 -2
- data/lib/bio/util/sirna.rb +1 -23
- data/lib/bio/version.rb +1 -1
- data/sample/demo_aaindex.rb +67 -0
- data/sample/demo_aminoacid.rb +101 -0
- data/sample/demo_bl2seq_report.rb +220 -0
- data/sample/demo_blast_report.rb +285 -0
- data/sample/demo_codontable.rb +119 -0
- data/sample/demo_das.rb +105 -0
- data/sample/demo_ddbjxml.rb +212 -0
- data/sample/demo_fasta_remote.rb +51 -0
- data/sample/demo_fastaformat.rb +105 -0
- data/sample/demo_genbank.rb +132 -0
- data/sample/demo_genscan_report.rb +202 -0
- data/sample/demo_gff1.rb +49 -0
- data/sample/demo_go.rb +98 -0
- data/sample/demo_hmmer_report.rb +149 -0
- data/sample/demo_kegg_compound.rb +57 -0
- data/sample/demo_kegg_drug.rb +65 -0
- data/sample/demo_kegg_genome.rb +74 -0
- data/sample/demo_kegg_glycan.rb +72 -0
- data/sample/demo_kegg_orthology.rb +62 -0
- data/sample/demo_kegg_reaction.rb +66 -0
- data/sample/demo_kegg_taxonomy.rb +92 -0
- data/sample/demo_keggapi.rb +502 -0
- data/sample/demo_litdb.rb +42 -0
- data/sample/demo_locations.rb +99 -0
- data/sample/demo_ncbi_rest.rb +130 -0
- data/sample/demo_nucleicacid.rb +49 -0
- data/sample/demo_pathway.rb +196 -0
- data/sample/demo_prosite.rb +120 -0
- data/sample/demo_psort.rb +138 -0
- data/sample/demo_psort_report.rb +70 -0
- data/sample/demo_pubmed.rb +118 -0
- data/sample/demo_sirna.rb +63 -0
- data/sample/demo_sosui_report.rb +89 -0
- data/sample/demo_targetp_report.rb +135 -0
- data/sample/demo_tmhmm_report.rb +68 -0
- data/sample/pmfetch.rb +13 -4
- data/sample/pmsearch.rb +15 -4
- data/sample/test_phyloxml_big.rb +205 -0
- data/test/bioruby_test_helper.rb +61 -0
- data/test/data/KEGG/1.1.1.1.enzyme +935 -0
- data/test/data/KEGG/C00025.compound +102 -0
- data/test/data/KEGG/D00063.drug +104 -0
- data/test/data/KEGG/G00024.glycan +47 -0
- data/test/data/KEGG/G01366.glycan +18 -0
- data/test/data/KEGG/K02338.orthology +902 -0
- data/test/data/KEGG/R00006.reaction +14 -0
- data/test/data/fastq/README.txt +109 -0
- data/test/data/fastq/error_diff_ids.fastq +20 -0
- data/test/data/fastq/error_double_qual.fastq +22 -0
- data/test/data/fastq/error_double_seq.fastq +22 -0
- data/test/data/fastq/error_long_qual.fastq +20 -0
- data/test/data/fastq/error_no_qual.fastq +20 -0
- data/test/data/fastq/error_qual_del.fastq +20 -0
- data/test/data/fastq/error_qual_escape.fastq +20 -0
- data/test/data/fastq/error_qual_null.fastq +0 -0
- data/test/data/fastq/error_qual_space.fastq +21 -0
- data/test/data/fastq/error_qual_tab.fastq +21 -0
- data/test/data/fastq/error_qual_unit_sep.fastq +20 -0
- data/test/data/fastq/error_qual_vtab.fastq +20 -0
- data/test/data/fastq/error_short_qual.fastq +20 -0
- data/test/data/fastq/error_spaces.fastq +20 -0
- data/test/data/fastq/error_tabs.fastq +21 -0
- data/test/data/fastq/error_trunc_at_plus.fastq +19 -0
- data/test/data/fastq/error_trunc_at_qual.fastq +19 -0
- data/test/data/fastq/error_trunc_at_seq.fastq +18 -0
- data/test/data/fastq/error_trunc_in_plus.fastq +19 -0
- data/test/data/fastq/error_trunc_in_qual.fastq +20 -0
- data/test/data/fastq/error_trunc_in_seq.fastq +18 -0
- data/test/data/fastq/error_trunc_in_title.fastq +17 -0
- data/test/data/fastq/illumina_full_range_as_illumina.fastq +8 -0
- data/test/data/fastq/illumina_full_range_as_sanger.fastq +8 -0
- data/test/data/fastq/illumina_full_range_as_solexa.fastq +8 -0
- data/test/data/fastq/illumina_full_range_original_illumina.fastq +8 -0
- data/test/data/fastq/longreads_as_illumina.fastq +40 -0
- data/test/data/fastq/longreads_as_sanger.fastq +40 -0
- data/test/data/fastq/longreads_as_solexa.fastq +40 -0
- data/test/data/fastq/longreads_original_sanger.fastq +120 -0
- data/test/data/fastq/misc_dna_as_illumina.fastq +16 -0
- data/test/data/fastq/misc_dna_as_sanger.fastq +16 -0
- data/test/data/fastq/misc_dna_as_solexa.fastq +16 -0
- data/test/data/fastq/misc_dna_original_sanger.fastq +16 -0
- data/test/data/fastq/misc_rna_as_illumina.fastq +16 -0
- data/test/data/fastq/misc_rna_as_sanger.fastq +16 -0
- data/test/data/fastq/misc_rna_as_solexa.fastq +16 -0
- data/test/data/fastq/misc_rna_original_sanger.fastq +16 -0
- data/test/data/fastq/sanger_full_range_as_illumina.fastq +8 -0
- data/test/data/fastq/sanger_full_range_as_sanger.fastq +8 -0
- data/test/data/fastq/sanger_full_range_as_solexa.fastq +8 -0
- data/test/data/fastq/sanger_full_range_original_sanger.fastq +8 -0
- data/test/data/fastq/solexa_full_range_as_illumina.fastq +8 -0
- data/test/data/fastq/solexa_full_range_as_sanger.fastq +8 -0
- data/test/data/fastq/solexa_full_range_as_solexa.fastq +8 -0
- data/test/data/fastq/solexa_full_range_original_solexa.fastq +8 -0
- data/test/data/fastq/wrapping_as_illumina.fastq +12 -0
- data/test/data/fastq/wrapping_as_sanger.fastq +12 -0
- data/test/data/fastq/wrapping_as_solexa.fastq +12 -0
- data/test/data/fastq/wrapping_original_sanger.fastq +24 -0
- data/test/data/meme/db +0 -0
- data/test/data/meme/mast +0 -0
- data/test/data/meme/mast.out +13 -0
- data/test/data/meme/meme.out +3 -0
- data/test/data/phyloxml/apaf.xml +666 -0
- data/test/data/phyloxml/bcl_2.xml +2097 -0
- data/test/data/phyloxml/made_up.xml +144 -0
- data/test/data/phyloxml/ncbi_taxonomy_mollusca_short.xml +65 -0
- data/test/data/phyloxml/phyloxml_examples.xml +415 -0
- data/test/data/sanger_chromatogram/test_chromatogram_abif.ab1 +0 -0
- data/test/data/sanger_chromatogram/test_chromatogram_scf_v2.scf +0 -0
- data/test/data/sanger_chromatogram/test_chromatogram_scf_v3.scf +0 -0
- data/test/functional/bio/appl/test_pts1.rb +7 -5
- data/test/functional/bio/io/test_ensembl.rb +4 -3
- data/test/functional/bio/io/test_pubmed.rb +9 -3
- data/test/functional/bio/io/test_soapwsdl.rb +5 -4
- data/test/functional/bio/io/test_togows.rb +5 -4
- data/test/functional/bio/sequence/test_output_embl.rb +6 -4
- data/test/functional/bio/test_command.rb +54 -5
- data/test/runner.rb +5 -3
- data/test/unit/bio/appl/bl2seq/test_report.rb +5 -4
- data/test/unit/bio/appl/blast/test_ncbioptions.rb +4 -2
- data/test/unit/bio/appl/blast/test_report.rb +5 -4
- data/test/unit/bio/appl/blast/test_rpsblast.rb +5 -4
- data/test/unit/bio/appl/gcg/test_msf.rb +5 -5
- data/test/unit/bio/appl/genscan/test_report.rb +8 -9
- data/test/unit/bio/appl/hmmer/test_report.rb +5 -4
- data/test/unit/bio/appl/iprscan/test_report.rb +6 -5
- data/test/unit/bio/appl/mafft/test_report.rb +6 -5
- data/test/unit/bio/appl/meme/mast/test_report.rb +46 -0
- data/test/unit/bio/appl/meme/test_mast.rb +103 -0
- data/test/unit/bio/appl/meme/test_motif.rb +38 -0
- data/test/unit/bio/appl/paml/codeml/test_rates.rb +5 -4
- data/test/unit/bio/appl/paml/codeml/test_report.rb +5 -4
- data/test/unit/bio/appl/paml/test_codeml.rb +5 -4
- data/test/unit/bio/appl/sim4/test_report.rb +5 -4
- data/test/unit/bio/appl/sosui/test_report.rb +6 -5
- data/test/unit/bio/appl/targetp/test_report.rb +5 -3
- data/test/unit/bio/appl/test_blast.rb +5 -4
- data/test/unit/bio/appl/test_fasta.rb +4 -2
- data/test/unit/bio/appl/test_pts1.rb +4 -2
- data/test/unit/bio/appl/tmhmm/test_report.rb +6 -5
- data/test/unit/bio/data/test_aa.rb +5 -3
- data/test/unit/bio/data/test_codontable.rb +5 -4
- data/test/unit/bio/data/test_na.rb +5 -3
- data/test/unit/bio/db/biosql/tc_biosql.rb +5 -1
- data/test/unit/bio/db/embl/test_common.rb +4 -2
- data/test/unit/bio/db/embl/test_embl.rb +6 -6
- data/test/unit/bio/db/embl/test_embl_rel89.rb +6 -6
- data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +7 -8
- data/test/unit/bio/db/embl/test_sptr.rb +6 -8
- data/test/unit/bio/db/embl/test_uniprot.rb +6 -5
- data/test/unit/bio/db/fasta/test_format_qual.rb +346 -0
- data/test/unit/bio/db/kegg/test_compound.rb +146 -0
- data/test/unit/bio/db/kegg/test_drug.rb +194 -0
- data/test/unit/bio/db/kegg/test_enzyme.rb +241 -0
- data/test/unit/bio/db/kegg/test_genes.rb +32 -4
- data/test/unit/bio/db/kegg/test_glycan.rb +260 -0
- data/test/unit/bio/db/kegg/test_orthology.rb +50 -0
- data/test/unit/bio/db/kegg/test_reaction.rb +96 -0
- data/test/unit/bio/db/pdb/test_pdb.rb +4 -2
- data/test/unit/bio/db/sanger_chromatogram/test_abif.rb +76 -0
- data/test/unit/bio/db/sanger_chromatogram/test_scf.rb +98 -0
- data/test/unit/bio/db/test_aaindex.rb +6 -6
- data/test/unit/bio/db/test_fasta.rb +5 -46
- data/test/unit/bio/db/test_fastq.rb +829 -0
- data/test/unit/bio/db/test_gff.rb +4 -2
- data/test/unit/bio/db/test_lasergene.rb +7 -5
- data/test/unit/bio/db/test_medline.rb +4 -2
- data/test/unit/bio/db/test_newick.rb +6 -6
- data/test/unit/bio/db/test_nexus.rb +4 -2
- data/test/unit/bio/db/test_phyloxml.rb +769 -0
- data/test/unit/bio/db/test_phyloxml_writer.rb +328 -0
- data/test/unit/bio/db/test_prosite.rb +6 -5
- data/test/unit/bio/db/test_qual.rb +63 -0
- data/test/unit/bio/db/test_rebase.rb +5 -3
- data/test/unit/bio/db/test_soft.rb +7 -6
- data/test/unit/bio/io/flatfile/test_autodetection.rb +6 -7
- data/test/unit/bio/io/flatfile/test_buffer.rb +6 -5
- data/test/unit/bio/io/flatfile/test_splitter.rb +4 -4
- data/test/unit/bio/io/test_ddbjxml.rb +4 -3
- data/test/unit/bio/io/test_ensembl.rb +5 -3
- data/test/unit/bio/io/test_fastacmd.rb +4 -3
- data/test/unit/bio/io/test_flatfile.rb +6 -5
- data/test/unit/bio/io/test_soapwsdl.rb +4 -3
- data/test/unit/bio/io/test_togows.rb +4 -2
- data/test/unit/bio/sequence/test_aa.rb +5 -3
- data/test/unit/bio/sequence/test_common.rb +4 -2
- data/test/unit/bio/sequence/test_compat.rb +4 -2
- data/test/unit/bio/sequence/test_dblink.rb +5 -3
- data/test/unit/bio/sequence/test_na.rb +4 -2
- data/test/unit/bio/sequence/test_quality_score.rb +330 -0
- data/test/unit/bio/shell/plugin/test_seq.rb +5 -3
- data/test/unit/bio/test_alignment.rb +5 -3
- data/test/unit/bio/test_command.rb +4 -3
- data/test/unit/bio/test_db.rb +5 -3
- data/test/unit/bio/test_feature.rb +4 -2
- data/test/unit/bio/test_location.rb +4 -2
- data/test/unit/bio/test_map.rb +5 -3
- data/test/unit/bio/test_pathway.rb +4 -2
- data/test/unit/bio/test_reference.rb +4 -2
- data/test/unit/bio/test_sequence.rb +5 -3
- data/test/unit/bio/test_shell.rb +5 -3
- data/test/unit/bio/test_tree.rb +6 -6
- data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +4 -2
- data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +17 -13
- data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +17 -13
- data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +4 -2
- data/test/unit/bio/util/test_color_scheme.rb +5 -3
- data/test/unit/bio/util/test_contingency_table.rb +5 -3
- data/test/unit/bio/util/test_restriction_enzyme.rb +4 -2
- data/test/unit/bio/util/test_sirna.rb +6 -4
- metadata +147 -2
@@ -4,18 +4,46 @@
|
|
4
4
|
# Copyright:: Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org>
|
5
5
|
# License:: The Ruby License
|
6
6
|
#
|
7
|
-
# $Id
|
7
|
+
# $Id:$
|
8
8
|
#
|
9
9
|
|
10
|
+
# loading helper routine for testing bioruby
|
10
11
|
require 'pathname'
|
11
|
-
|
12
|
-
|
12
|
+
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
|
13
|
+
'bioruby_test_helper.rb')).cleanpath.to_s
|
13
14
|
|
15
|
+
# libraries needed for the tests
|
14
16
|
require 'test/unit'
|
15
17
|
require 'bio/db/kegg/genes'
|
16
18
|
|
17
19
|
module Bio
|
18
|
-
class
|
20
|
+
class TestKeggGenesStructure < Test::Unit::TestCase
|
21
|
+
def setup
|
22
|
+
entry =<<END
|
23
|
+
STRUCTURE PDB: 1A9X 1CS0 1C30 1T36 1M6V 1KEE 1C3O 1CE8 1BXR 1JDB
|
24
|
+
END
|
25
|
+
@obj = Bio::KEGG::GENES.new(entry)
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_data
|
29
|
+
str = "STRUCTURE PDB: 1A9X 1CS0 1C30 1T36 1M6V 1KEE 1C3O 1CE8 1BXR 1JDB"
|
30
|
+
assert_equal(str, @obj.instance_eval('get("STRUCTURE")'))
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_ids_in_array
|
34
|
+
assert_equal(Array, @obj.structure.class)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_ids
|
38
|
+
expected = %w( 1A9X 1CS0 1C30 1T36 1M6V 1KEE 1C3O 1CE8 1BXR 1JDB )
|
39
|
+
assert_equal(expected, @obj.structure)
|
40
|
+
assert_equal(expected, @obj.structures)
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
class TestKeggGenesDblinks < Test::Unit::TestCase
|
19
47
|
|
20
48
|
def setup
|
21
49
|
entry =<<END
|
@@ -0,0 +1,260 @@
|
|
1
|
+
#
|
2
|
+
# test/unit/bio/db/kegg/test_glycan.rb - Unit test for Bio::KEGG::GLYCAN
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2009 Naohisa Goto <ng@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
|
8
|
+
# loading helper routine for testing bioruby
|
9
|
+
require 'pathname'
|
10
|
+
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
|
11
|
+
'bioruby_test_helper.rb')).cleanpath.to_s
|
12
|
+
|
13
|
+
# libraries needed for the tests
|
14
|
+
require 'test/unit'
|
15
|
+
require 'bio/db/kegg/glycan.rb'
|
16
|
+
|
17
|
+
module Bio
|
18
|
+
|
19
|
+
class TestBioKeggGLYCAN < Test::Unit::TestCase
|
20
|
+
|
21
|
+
def setup
|
22
|
+
filename = File.join(BioRubyTestDataPath, 'KEGG/G00024.glycan')
|
23
|
+
@obj = Bio::KEGG::GLYCAN.new(File.read(filename))
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_dblinks_as_hash
|
27
|
+
expected = {
|
28
|
+
"JCGGDB"=>["JCGG-STR025711"],
|
29
|
+
"GlycomeDB"=>["475"],
|
30
|
+
"CCSD" =>
|
31
|
+
%w( 98 99 100 2225 2236 2237 2238 2239 2240 2241 2242 2243 3406
|
32
|
+
5035 5038 5887 14321 18613 25363 27572 28182 29046 29092 29175
|
33
|
+
29393 29521 29554 30734 30735 30848 30849 30850 30917 32646
|
34
|
+
33022 33851 33878 33952 34823 34829 34986 34995 35029 35050
|
35
|
+
35107 35108 35805 35833 35991 36236 36826 36863 37982 38587
|
36
|
+
38640 38672 42797 43915 44029 44775 45346 46438 46466 47186
|
37
|
+
48015 48891 49283 49293 50466 50469 50477 )
|
38
|
+
}
|
39
|
+
assert_equal(expected, @obj.dblinks_as_hash)
|
40
|
+
assert_equal(expected, @obj.dblinks)
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_pathways_as_hash
|
44
|
+
expected = {
|
45
|
+
"ko01100" => "Metabolic pathways",
|
46
|
+
"ko00512" => "O-Glycan biosynthesis"
|
47
|
+
}
|
48
|
+
assert_equal(expected, @obj.pathways_as_hash)
|
49
|
+
assert_equal(expected, @obj.pathways)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_orthologs_as_hash
|
53
|
+
expected = {
|
54
|
+
"K00780" => "beta-galactoside alpha-2,3-sialyltransferase (sialyltransferase 4A) [EC:2.4.99.4]",
|
55
|
+
"K00727" => "beta-1,3-galactosyl-O-glycosyl-glycoprotein beta-1,6-N-acetylglucosaminyltransferase [EC:2.4.1.102]",
|
56
|
+
"K03368" => "beta-galactoside alpha-2,3-sialyltransferase (sialyltransferase 4B) [EC:2.4.99.4]",
|
57
|
+
"K00731" => "glycoprotein-N-acetylgalactosamine 3-beta-galactosyltransferase [EC:2.4.1.122]"
|
58
|
+
}
|
59
|
+
assert_equal(expected, @obj.orthologs_as_hash)
|
60
|
+
assert_equal(expected, @obj.orthologs)
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_entry_id
|
64
|
+
assert_equal("G00024", @obj.entry_id)
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_name
|
68
|
+
assert_equal("T antigen", @obj.name)
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_composition
|
72
|
+
expected = {"Ser/Thr"=>1, "Gal"=>1, "GalNAc"=>1}
|
73
|
+
assert_equal(expected, @obj.composition)
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_mass
|
77
|
+
assert_equal(365.3, @obj.mass)
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_keggclass
|
81
|
+
expected = "Glycoprotein; O-Glycan Neoglycoconjugate"
|
82
|
+
assert_equal(expected, @obj.keggclass)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_compounds
|
86
|
+
assert_equal([], @obj.compounds)
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_reactions
|
90
|
+
expected = ["R05908", "R05912", "R05913", "R06140"]
|
91
|
+
assert_equal(expected, @obj.reactions)
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_pathways_as_strings
|
95
|
+
expected = [ "PATH: ko00512 O-Glycan biosynthesis",
|
96
|
+
"PATH: ko01100 Metabolic pathways" ]
|
97
|
+
assert_equal(expected, @obj.pathways_as_strings)
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_enzymes
|
101
|
+
expected = ["2.4.1.102", "2.4.1.122", "2.4.99.4", "3.2.1.97"]
|
102
|
+
assert_equal(expected, @obj.enzymes)
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_orthologs_as_strings
|
106
|
+
expected =
|
107
|
+
[ "KO: K00727 beta-1,3-galactosyl-O-glycosyl-glycoprotein beta-1,6-N-acetylglucosaminyltransferase [EC:2.4.1.102]",
|
108
|
+
"KO: K00731 glycoprotein-N-acetylgalactosamine 3-beta-galactosyltransferase [EC:2.4.1.122]",
|
109
|
+
"KO: K00780 beta-galactoside alpha-2,3-sialyltransferase (sialyltransferase 4A) [EC:2.4.99.4]",
|
110
|
+
"KO: K03368 beta-galactoside alpha-2,3-sialyltransferase (sialyltransferase 4B) [EC:2.4.99.4]"
|
111
|
+
]
|
112
|
+
assert_equal(expected, @obj.orthologs_as_strings)
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_comment
|
116
|
+
assert_equal("", @obj.comment)
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_remark
|
120
|
+
assert_equal("Same as: C04750 C04776", @obj.remark)
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_references
|
124
|
+
expected =
|
125
|
+
[ "1 [PMID:12950230] Backstrom M, Link T, Olson FJ, Karlsson H, Graham R, Picco G, Burchell J, Taylor-Papadimitriou J, Noll T, Hansson GC. Recombinant MUC1 mucin with a breast cancer-like O-glycosylation produced in large amounts in Chinese-hamster ovary cells. Biochem. J. 376 (2003) 677-86.",
|
126
|
+
"2 [PMID:14631106] Wu AM. Carbohydrate structural units in glycoproteins and polysaccharides as important ligands for Gal and GalNAc reactive lectins. J. Biomed. Sci. 10 (2003) 676-88." ]
|
127
|
+
assert_equal(expected, @obj.references)
|
128
|
+
end
|
129
|
+
|
130
|
+
def test_dblinks_as_strings
|
131
|
+
expected =
|
132
|
+
[ "CCSD: 98 99 100 2225 2236 2237 2238 2239 2240 2241 2242 2243 3406 5035 5038 5887 14321 18613 25363 27572 28182 29046 29092 29175 29393 29521 29554 30734 30735 30848 30849 30850 30917 32646 33022 33851 33878 33952 34823 34829 34986 34995 35029 35050 35107 35108 35805 35833 35991 36236 36826 36863 37982 38587 38640 38672 42797 43915 44029 44775 45346 46438 46466 47186 48015 48891 49283 49293 50466 50469 50477",
|
133
|
+
"GlycomeDB: 475",
|
134
|
+
"JCGGDB: JCGG-STR025711"
|
135
|
+
]
|
136
|
+
assert_equal(expected, @obj.dblinks_as_strings)
|
137
|
+
end
|
138
|
+
|
139
|
+
def test_kcf
|
140
|
+
expected = <<END_OF_EXPECTED_KCF
|
141
|
+
NODE 3
|
142
|
+
1 Ser/Thr 8 0
|
143
|
+
2 GalNAc -1 0
|
144
|
+
3 Gal -9 0
|
145
|
+
EDGE 2
|
146
|
+
1 2:a1 1
|
147
|
+
2 3:b1 2:3
|
148
|
+
END_OF_EXPECTED_KCF
|
149
|
+
assert_equal(expected, @obj.kcf)
|
150
|
+
end
|
151
|
+
end #class TestBioKeggGLYCAN
|
152
|
+
|
153
|
+
class TestBioKeggGLYCAN_G01366 < Test::Unit::TestCase
|
154
|
+
|
155
|
+
def setup
|
156
|
+
filename = File.join(BioRubyTestDataPath, 'KEGG/G01366.glycan')
|
157
|
+
@obj = Bio::KEGG::GLYCAN.new(File.read(filename))
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_dblinks_as_hash
|
161
|
+
expected = {
|
162
|
+
"JCGGDB"=>["JCGG-STR026574"],
|
163
|
+
"GlycomeDB"=>["5567"],
|
164
|
+
"CCSD"=>["2549", "2550", "16559", "25204"]
|
165
|
+
}
|
166
|
+
assert_equal(expected, @obj.dblinks_as_hash)
|
167
|
+
assert_equal(expected, @obj.dblinks)
|
168
|
+
end
|
169
|
+
|
170
|
+
def test_pathways_as_hash
|
171
|
+
assert_equal({}, @obj.pathways_as_hash)
|
172
|
+
assert_equal({}, @obj.pathways)
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_orthologs_as_hash
|
176
|
+
assert_equal({}, @obj.orthologs_as_hash)
|
177
|
+
assert_equal({}, @obj.orthologs)
|
178
|
+
end
|
179
|
+
|
180
|
+
def test_entry_id
|
181
|
+
assert_equal("G01366", @obj.entry_id)
|
182
|
+
end
|
183
|
+
|
184
|
+
def test_name
|
185
|
+
assert_equal("", @obj.name)
|
186
|
+
end
|
187
|
+
|
188
|
+
def test_composition
|
189
|
+
expected = {"GlcNAc"=>1, "4dlyxHex"=>1, "Man"=>2}
|
190
|
+
assert_equal(expected, @obj.composition)
|
191
|
+
end
|
192
|
+
|
193
|
+
def test_mass
|
194
|
+
assert_equal(691.6, @obj.mass)
|
195
|
+
end
|
196
|
+
|
197
|
+
def test_keggclass
|
198
|
+
expected = "Glycoprotein; N-Glycan"
|
199
|
+
assert_equal(expected, @obj.keggclass)
|
200
|
+
end
|
201
|
+
|
202
|
+
def test_compounds
|
203
|
+
assert_equal([], @obj.compounds)
|
204
|
+
end
|
205
|
+
|
206
|
+
def test_reactions
|
207
|
+
assert_equal([], @obj.reactions)
|
208
|
+
end
|
209
|
+
|
210
|
+
def test_pathways_as_strings
|
211
|
+
assert_equal([], @obj.pathways_as_strings)
|
212
|
+
end
|
213
|
+
|
214
|
+
def test_enzymes
|
215
|
+
assert_equal([], @obj.enzymes)
|
216
|
+
end
|
217
|
+
|
218
|
+
def test_orthologs_as_strings
|
219
|
+
assert_equal([], @obj.orthologs_as_strings)
|
220
|
+
end
|
221
|
+
|
222
|
+
def test_comment
|
223
|
+
expected = "synthetic (CCSD:2549)"
|
224
|
+
assert_equal(expected, @obj.comment)
|
225
|
+
end
|
226
|
+
|
227
|
+
def test_remark
|
228
|
+
assert_equal("", @obj.remark)
|
229
|
+
end
|
230
|
+
|
231
|
+
def test_references
|
232
|
+
assert_equal([], @obj.references)
|
233
|
+
end
|
234
|
+
|
235
|
+
def test_dblinks_as_strings
|
236
|
+
expected = [ "CCSD: 2549 2550 16559 25204",
|
237
|
+
"GlycomeDB: 5567",
|
238
|
+
"JCGGDB: JCGG-STR026574"
|
239
|
+
]
|
240
|
+
assert_equal(expected, @obj.dblinks_as_strings)
|
241
|
+
end
|
242
|
+
|
243
|
+
def test_kcf
|
244
|
+
expected = <<END_OF_EXPECTED_KCF
|
245
|
+
NODE 4
|
246
|
+
1 GlcNAc 11.4 0
|
247
|
+
2 4dlyxHex -0.6 0
|
248
|
+
3 Man -10.6 5
|
249
|
+
4 Man -10.6 -5
|
250
|
+
EDGE 3
|
251
|
+
1 2:b1 1:4
|
252
|
+
2 3:a1 2:6
|
253
|
+
3 4:a1 2:3
|
254
|
+
END_OF_EXPECTED_KCF
|
255
|
+
assert_equal(expected, @obj.kcf)
|
256
|
+
end
|
257
|
+
end #class TestBioKeggGLYCAN_G01366
|
258
|
+
|
259
|
+
end #module Bio
|
260
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#
|
2
|
+
# test/unit/bio/db/kegg/test_orthology.rb - Unit test for Bio::KEGG::ORTHOLOGY
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2009 Kozo Nishida <kozo-ni@is.naist.jp>
|
5
|
+
# License:: The Ruby License
|
6
|
+
|
7
|
+
# loading helper routine for testing bioruby
|
8
|
+
require 'pathname'
|
9
|
+
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
|
10
|
+
'bioruby_test_helper.rb')).cleanpath.to_s
|
11
|
+
|
12
|
+
# libraries needed for the tests
|
13
|
+
require 'test/unit'
|
14
|
+
require 'bio/db/kegg/orthology'
|
15
|
+
|
16
|
+
module Bio
|
17
|
+
class TestKeggOrthology < Test::Unit::TestCase
|
18
|
+
|
19
|
+
def setup
|
20
|
+
testdata_kegg = Pathname.new(File.join(BioRubyTestDataPath, 'KEGG')).cleanpath.to_s
|
21
|
+
entry = File.read(File.join(testdata_kegg, "K02338.orthology"))
|
22
|
+
@obj = Bio::KEGG::ORTHOLOGY.new(entry)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_entry_id
|
26
|
+
assert_equal('K02338', @obj.entry_id)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_name
|
30
|
+
assert_equal("DPO3B, dnaN", @obj.name)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_names
|
34
|
+
assert_equal(["DPO3B", "dnaN"], @obj.names)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_definition
|
38
|
+
assert_equal("DNA polymerase III subunit beta [EC:2.7.7.7]", @obj.definition)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_dblinks_as_hash
|
42
|
+
assert_equal({"COG"=>["COG0592"], "RN"=>["R00375", "R00376", "R00377", "R00378"], "GO"=>["0003887"]}, @obj.dblinks_as_hash)
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_genes_as_hash
|
46
|
+
assert_equal(["BSU00020"], @obj.genes_as_hash["bsu"])
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
#
|
2
|
+
# test/unit/bio/db/kegg/test_reaction.rb - Unit test for Bio::KEGG::REACTION
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2009 Kozo Nishida <kozo-ni@is.naist.jp>
|
5
|
+
# License:: The Ruby License
|
6
|
+
|
7
|
+
# loading helper routine for testing bioruby
|
8
|
+
require 'pathname'
|
9
|
+
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
|
10
|
+
'bioruby_test_helper.rb')).cleanpath.to_s
|
11
|
+
|
12
|
+
# libraries needed for the tests
|
13
|
+
require 'test/unit'
|
14
|
+
require 'bio/db/kegg/reaction'
|
15
|
+
|
16
|
+
module Bio
|
17
|
+
class TestKeggReaction < Test::Unit::TestCase
|
18
|
+
|
19
|
+
def setup
|
20
|
+
testdata_kegg = Pathname.new(File.join(BioRubyTestDataPath, 'KEGG')).cleanpath.to_s
|
21
|
+
entry = File.read(File.join(testdata_kegg, "R00006.reaction"))
|
22
|
+
@obj = Bio::KEGG::REACTION.new(entry)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_entry_id
|
26
|
+
assert_equal('R00006', @obj.entry_id)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_name
|
30
|
+
assert_equal('pyruvate:pyruvate acetaldehydetransferase (decarboxylating); 2-acetolactate pyruvate-lyase (carboxylating)', @obj.name)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_definition
|
34
|
+
assert_equal('2-Acetolactate + CO2 <=> 2 Pyruvate', @obj.definition)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_equation
|
38
|
+
assert_equal('C00900 + C00011 <=> 2 C00022', @obj.equation)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_rpairs_as_hash
|
42
|
+
expected = {
|
43
|
+
"RP00440" => [ "C00022_C00900", "main" ],
|
44
|
+
"RP05698" => [ "C00011_C00022", "leave" ],
|
45
|
+
"RP12733" => [ "C00022_C00900", "trans" ]
|
46
|
+
}
|
47
|
+
assert_equal(expected, @obj.rpairs_as_hash)
|
48
|
+
assert_equal(expected, @obj.rpairs)
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_rpairs_as_strings
|
52
|
+
expected = [ 'RP: RP00440 C00022_C00900 main',
|
53
|
+
'RP: RP05698 C00011_C00022 leave',
|
54
|
+
'RP: RP12733 C00022_C00900 trans'
|
55
|
+
]
|
56
|
+
assert_equal(expected, @obj.rpairs_as_strings)
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_rpairs_as_tokens
|
60
|
+
expected = %w( RP: RP00440 C00022_C00900 main
|
61
|
+
RP: RP05698 C00011_C00022 leave
|
62
|
+
RP: RP12733 C00022_C00900 trans
|
63
|
+
)
|
64
|
+
assert_equal(expected, @obj.rpairs_as_tokens)
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_pathways_as_strings
|
68
|
+
assert_equal([ "PATH: rn00770 Pantothenate and CoA biosynthesis" ],
|
69
|
+
@obj.pathways_as_strings)
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_pathways_as_hash
|
73
|
+
expected = { "rn00770" => "Pantothenate and CoA biosynthesis" }
|
74
|
+
assert_equal(expected, @obj.pathways_as_hash)
|
75
|
+
assert_equal(expected, @obj.pathways)
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_enzymes
|
79
|
+
assert_equal(["2.2.1.6"], @obj.enzymes)
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_orthologs_as_strings
|
83
|
+
assert_equal(["KO: K01652 acetolactate synthase I/II/III large subunit [EC:2.2.1.6]", "KO: K01653 acetolactate synthase I/III small subunit [EC:2.2.1.6]"], @obj.orthologs_as_strings)
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_orthologs_as_hash
|
87
|
+
expected = {
|
88
|
+
'K01652'=>"acetolactate synthase I/II/III large subunit [EC:2.2.1.6]",
|
89
|
+
'K01653'=>"acetolactate synthase I/III small subunit [EC:2.2.1.6]"
|
90
|
+
}
|
91
|
+
assert_equal(expected, @obj.orthologs_as_hash)
|
92
|
+
assert_equal(expected, @obj.orthologs)
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|