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
@@ -0,0 +1,57 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_kegg_compound.rb - demonstration of Bio::KEGG::COMPOUND
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2001, 2002, 2004, 2007 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# Copyright:: Copyright (C) 2009 Kozo Nishida <kozo-ni@is.naist.jp>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# == Description
|
10
|
+
#
|
11
|
+
# Demonstration of Bio::KEGG::COMPOUND, a parser class for the KEGG COMPOUND
|
12
|
+
# chemical structure database.
|
13
|
+
#
|
14
|
+
# == Usage
|
15
|
+
#
|
16
|
+
# Specify files containing KEGG COMPOUND data.
|
17
|
+
#
|
18
|
+
# $ ruby demo_kegg_compound.rb files...
|
19
|
+
#
|
20
|
+
# Example usage using test data:
|
21
|
+
#
|
22
|
+
# $ ruby -Ilib sample/demo_kegg_compound.rb test/data/KEGG/C00025.compound
|
23
|
+
#
|
24
|
+
# == Development information
|
25
|
+
#
|
26
|
+
# The code was moved from lib/bio/db/kegg/compound.rb and modified.
|
27
|
+
#
|
28
|
+
|
29
|
+
require 'bio'
|
30
|
+
|
31
|
+
Bio::FlatFile.foreach(Bio::KEGG::COMPOUND, ARGF) do |cpd|
|
32
|
+
puts "### cpd = Bio::KEGG::COMPOUND.new(str)"
|
33
|
+
puts "# cpd.entry_id"
|
34
|
+
p cpd.entry_id
|
35
|
+
puts "# cpd.names"
|
36
|
+
p cpd.names
|
37
|
+
puts "# cpd.name"
|
38
|
+
p cpd.name
|
39
|
+
puts "# cpd.formula"
|
40
|
+
p cpd.formula
|
41
|
+
puts "# cpd.mass"
|
42
|
+
p cpd.mass
|
43
|
+
puts "# cpd.reactions"
|
44
|
+
p cpd.reactions
|
45
|
+
puts "# cpd.rpairs"
|
46
|
+
p cpd.rpairs
|
47
|
+
puts "# cpd.pathways"
|
48
|
+
p cpd.pathways
|
49
|
+
puts "# cpd.enzymes"
|
50
|
+
p cpd.enzymes
|
51
|
+
puts "# cpd.dblinks"
|
52
|
+
p cpd.dblinks
|
53
|
+
puts "# cpd.kcf"
|
54
|
+
p cpd.kcf
|
55
|
+
puts "=" * 78
|
56
|
+
end
|
57
|
+
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_kegg_drug.rb - demonstration of Bio::KEGG::DRUG
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
#
|
8
|
+
# == Description
|
9
|
+
#
|
10
|
+
# Demonstration of Bio::KEGG::DRUG, a parser class for the KEGG DRUG
|
11
|
+
# drug database entry.
|
12
|
+
#
|
13
|
+
# == Usage
|
14
|
+
#
|
15
|
+
# Specify files containing KEGG DRUG data.
|
16
|
+
#
|
17
|
+
# $ ruby demo_kegg_drug.rb files...
|
18
|
+
#
|
19
|
+
# == Example of running this script
|
20
|
+
#
|
21
|
+
# Download test data.
|
22
|
+
#
|
23
|
+
# $ ruby -Ilib bin/br_biofetch.rb dr D00001 > D00001.drug
|
24
|
+
# $ ruby -Ilib bin/br_biofetch.rb dr D00002 > D00002.drug
|
25
|
+
#
|
26
|
+
# Run this script.
|
27
|
+
#
|
28
|
+
# $ ruby -Ilib sample/demo_kegg_drug.rb D00001.drug D00002.drug
|
29
|
+
#
|
30
|
+
# == Development information
|
31
|
+
#
|
32
|
+
# The code was moved from lib/bio/db/kegg/drug.rb and modified.
|
33
|
+
#
|
34
|
+
|
35
|
+
require 'bio'
|
36
|
+
|
37
|
+
Bio::FlatFile.foreach(Bio::KEGG::DRUG, ARGF) do |dr|
|
38
|
+
#entry = ARGF.read # dr:D00001
|
39
|
+
#dr = Bio::KEGG::DRUG.new(entry)
|
40
|
+
|
41
|
+
puts "### dr = Bio::KEGG::DRUG.new(str)"
|
42
|
+
puts "# dr.entry_id"
|
43
|
+
p dr.entry_id
|
44
|
+
puts "# dr.names"
|
45
|
+
p dr.names
|
46
|
+
puts "# dr.name"
|
47
|
+
p dr.name
|
48
|
+
puts "# dr.formula"
|
49
|
+
p dr.formula
|
50
|
+
puts "# dr.mass"
|
51
|
+
p dr.mass
|
52
|
+
puts "# dr.activity"
|
53
|
+
p dr.activity
|
54
|
+
puts "# dr.remark"
|
55
|
+
p dr.remark
|
56
|
+
puts "# dr.comment"
|
57
|
+
p dr.comment
|
58
|
+
puts "# dr.dblinks"
|
59
|
+
p dr.dblinks
|
60
|
+
puts "# dr.kcf"
|
61
|
+
p dr.kcf
|
62
|
+
|
63
|
+
puts "=" * 78
|
64
|
+
end
|
65
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_kegg_genome.rb - demonstration of Bio::KEGG::GENOME
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2001, 2002, 2007 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
#
|
8
|
+
# == Description
|
9
|
+
#
|
10
|
+
# Demonstration of Bio::KEGG::GENOME, a parser class for the KEGG/GENOME
|
11
|
+
# genome database.
|
12
|
+
#
|
13
|
+
# == Usage
|
14
|
+
#
|
15
|
+
# Specify files containing KEGG GENOME data.
|
16
|
+
#
|
17
|
+
# $ ruby demo_kegg_genome.rb files...
|
18
|
+
#
|
19
|
+
# == Example of running this script
|
20
|
+
#
|
21
|
+
# Download test data.
|
22
|
+
#
|
23
|
+
# $ ruby -Ilib bin/br_biofetch.rb genome eco > eco.genome
|
24
|
+
# $ ruby -Ilib bin/br_biofetch.rb genome hsa > hsa.genome
|
25
|
+
#
|
26
|
+
# Run this script.
|
27
|
+
#
|
28
|
+
# $ ruby -Ilib sample/demo_kegg_genome.rb eco.genome hsa.genome
|
29
|
+
#
|
30
|
+
# == Development information
|
31
|
+
#
|
32
|
+
# The code was moved from lib/bio/db/kegg/genome.rb and modified.
|
33
|
+
#
|
34
|
+
|
35
|
+
require 'bio'
|
36
|
+
|
37
|
+
#if __FILE__ == $0
|
38
|
+
|
39
|
+
begin
|
40
|
+
require 'pp'
|
41
|
+
def p(arg); pp(arg); end
|
42
|
+
rescue LoadError
|
43
|
+
end
|
44
|
+
|
45
|
+
#require 'bio/io/flatfile'
|
46
|
+
|
47
|
+
ff = Bio::FlatFile.new(Bio::KEGG::GENOME, ARGF)
|
48
|
+
|
49
|
+
ff.each do |genome|
|
50
|
+
|
51
|
+
puts "### Tags"
|
52
|
+
p genome.tags
|
53
|
+
|
54
|
+
[
|
55
|
+
%w( ENTRY entry_id ),
|
56
|
+
%w( NAME name ),
|
57
|
+
%w( DEFINITION definition ),
|
58
|
+
%w( TAXONOMY taxonomy taxid lineage ),
|
59
|
+
%w( REFERENCE references ),
|
60
|
+
%w( CHROMOSOME chromosomes ),
|
61
|
+
%w( PLASMID plasmids ),
|
62
|
+
%w( STATISTICS statistics nalen num_gene num_rna ),
|
63
|
+
].each do |x|
|
64
|
+
puts "### " + x.shift
|
65
|
+
x.each do |m|
|
66
|
+
p genome.__send__(m)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
puts "=" * 78
|
71
|
+
end
|
72
|
+
|
73
|
+
#end
|
74
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_kegg_glycan.rb - demonstration of Bio::KEGG::GLYCAN
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2004 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
#
|
8
|
+
# == Description
|
9
|
+
#
|
10
|
+
# Demonstration of Bio::KEGG::GLYCAN, a parser class for the KEGG GLYCAN
|
11
|
+
# glycome informatics database.
|
12
|
+
#
|
13
|
+
# == Usage
|
14
|
+
#
|
15
|
+
# Specify files containing KEGG GLYCAN data.
|
16
|
+
#
|
17
|
+
# $ ruby demo_kegg_glycan.rb files...
|
18
|
+
#
|
19
|
+
# == Example of running this script
|
20
|
+
#
|
21
|
+
# Download test data.
|
22
|
+
#
|
23
|
+
# $ ruby -Ilib bin/br_biofetch.rb glycan G00001 > G00001.glycan
|
24
|
+
# $ ruby -Ilib bin/br_biofetch.rb glycan G00024 > G00024.glycan
|
25
|
+
#
|
26
|
+
# Run this script.
|
27
|
+
#
|
28
|
+
# $ ruby -Ilib sample/demo_kegg_glycan.rb G00001.glycan G00024.glycan
|
29
|
+
#
|
30
|
+
# == Development information
|
31
|
+
#
|
32
|
+
# The code was moved from lib/bio/db/kegg/glycan.rb and modified.
|
33
|
+
#
|
34
|
+
|
35
|
+
require 'bio'
|
36
|
+
|
37
|
+
Bio::FlatFile.foreach(Bio::KEGG::GLYCAN, ARGF) do |gl|
|
38
|
+
#entry = ARGF.read # gl:G00024
|
39
|
+
#gl = Bio::KEGG::GLYCAN.new(entry)
|
40
|
+
|
41
|
+
puts "### gl = Bio::KEGG::GLYCAN.new(str)"
|
42
|
+
puts "# gl.entry_id"
|
43
|
+
p gl.entry_id
|
44
|
+
puts "# gl.name"
|
45
|
+
p gl.name
|
46
|
+
puts "# gl.composition"
|
47
|
+
p gl.composition
|
48
|
+
puts "# gl.mass"
|
49
|
+
p gl.mass
|
50
|
+
puts "# gl.keggclass"
|
51
|
+
p gl.keggclass
|
52
|
+
#puts "# gl.bindings"
|
53
|
+
#p gl.bindings
|
54
|
+
puts "# gl.compounds"
|
55
|
+
p gl.compounds
|
56
|
+
puts "# gl.reactions"
|
57
|
+
p gl.reactions
|
58
|
+
puts "# gl.pathways"
|
59
|
+
p gl.pathways
|
60
|
+
puts "# gl.enzymes"
|
61
|
+
p gl.enzymes
|
62
|
+
puts "# gl.orthologs"
|
63
|
+
p gl.orthologs
|
64
|
+
puts "# gl.references"
|
65
|
+
p gl.references
|
66
|
+
puts "# gl.dblinks"
|
67
|
+
p gl.dblinks
|
68
|
+
puts "# gl.kcf"
|
69
|
+
p gl.kcf
|
70
|
+
|
71
|
+
puts "=" * 78
|
72
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_kegg_orthology.rb - demonstration of Bio::KEGG::ORTHOLOGY
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2003-2007 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# Copyright:: Copyright (C) 2003 Masumi Itoh <m@bioruby.org>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# == Description
|
10
|
+
#
|
11
|
+
# Demonstration of Bio::KEGG::ORTHOLOGY, the parser class for the KEGG
|
12
|
+
# ORTHOLOGY database entry.
|
13
|
+
#
|
14
|
+
# == Usage
|
15
|
+
#
|
16
|
+
# Specify files containing KEGG ORTHOLOGY data.
|
17
|
+
#
|
18
|
+
# $ ruby demo_kegg_orthology.rb files...
|
19
|
+
#
|
20
|
+
# == Example of running this script
|
21
|
+
#
|
22
|
+
# Download test data.
|
23
|
+
#
|
24
|
+
# $ ruby -Ilib bin/br_biofetch.rb ko K00001 > K00001.ko
|
25
|
+
# $ ruby -Ilib bin/br_biofetch.rb ko K00161 > K00161.ko
|
26
|
+
#
|
27
|
+
# Run this script.
|
28
|
+
#
|
29
|
+
# $ ruby -Ilib sample/demo_kegg_orthology.rb K00001.ko K00161.ko
|
30
|
+
#
|
31
|
+
# == Development information
|
32
|
+
#
|
33
|
+
# The code was moved from lib/bio/db/kegg/orthology.rb and modified.
|
34
|
+
#
|
35
|
+
|
36
|
+
require 'bio'
|
37
|
+
|
38
|
+
Bio::FlatFile.foreach(Bio::KEGG::ORTHOLOGY, ARGF) do |ko|
|
39
|
+
puts "### ko = Bio::KEGG::ORTHOLOGY.new(str)"
|
40
|
+
|
41
|
+
puts "# ko.ko_id"
|
42
|
+
p ko.entry_id
|
43
|
+
puts "# ko.name"
|
44
|
+
p ko.name
|
45
|
+
puts "# ko.names"
|
46
|
+
p ko.names
|
47
|
+
puts "# ko.definition"
|
48
|
+
p ko.definition
|
49
|
+
puts "# ko.keggclass"
|
50
|
+
p ko.keggclass
|
51
|
+
puts "# ko.keggclasses"
|
52
|
+
p ko.keggclasses
|
53
|
+
puts "# ko.pathways"
|
54
|
+
p ko.pathways
|
55
|
+
puts "# ko.dblinks"
|
56
|
+
p ko.dblinks
|
57
|
+
puts "# ko.genes"
|
58
|
+
p ko.genes
|
59
|
+
|
60
|
+
puts "=" * 78
|
61
|
+
end
|
62
|
+
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_kegg_reaction.rb - demonstration of Bio::KEGG::REACTION
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2004 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# Copyright:: Copyright (C) 2009 Kozo Nishida <kozo-ni@is.naist.jp>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# == Description
|
10
|
+
#
|
11
|
+
# Demonstration of Bio::KEGG::REACTION, the parser class for the KEGG
|
12
|
+
# REACTION biochemical reaction database.
|
13
|
+
#
|
14
|
+
# == Usage
|
15
|
+
#
|
16
|
+
# Specify files containing KEGG REACTION data.
|
17
|
+
#
|
18
|
+
# $ ruby demo_kegg_reaction.rb files...
|
19
|
+
#
|
20
|
+
# Example usage using test data:
|
21
|
+
#
|
22
|
+
# $ ruby -Ilib sample/demo_kegg_reaction.rb test/data/KEGG/R00006.reaction
|
23
|
+
#
|
24
|
+
# == Example of running this script
|
25
|
+
#
|
26
|
+
# Download test data.
|
27
|
+
#
|
28
|
+
# $ ruby -Ilib bin/br_biofetch.rb reaction R00259 > R00259.reaction
|
29
|
+
# $ ruby -Ilib bin/br_biofetch.rb reaction R02282 > R02282.reaction
|
30
|
+
#
|
31
|
+
# Run this script.
|
32
|
+
#
|
33
|
+
# $ ruby -Ilib sample/demo_kegg_reaction.rb R00259.reaction R02282.reaction
|
34
|
+
#
|
35
|
+
# == Development information
|
36
|
+
#
|
37
|
+
# The code was moved from lib/bio/db/kegg/reaction.rb and modified.
|
38
|
+
#
|
39
|
+
|
40
|
+
require 'bio'
|
41
|
+
|
42
|
+
Bio::FlatFile.foreach(Bio::KEGG::REACTION, ARGF) do |rn|
|
43
|
+
puts "### rn = Bio::KEGG::REACTION.new(str)"
|
44
|
+
|
45
|
+
puts "# rn.entry_id"
|
46
|
+
p rn.entry_id
|
47
|
+
puts "# rn.name"
|
48
|
+
p rn.name
|
49
|
+
puts "# rn.definition"
|
50
|
+
p rn.definition
|
51
|
+
puts "# rn.equation"
|
52
|
+
p rn.equation
|
53
|
+
puts "# rn.rpairs"
|
54
|
+
p rn.rpairs
|
55
|
+
puts "# rn.pathways"
|
56
|
+
p rn.pathways
|
57
|
+
puts "# rn.enzymes"
|
58
|
+
p rn.enzymes
|
59
|
+
puts "# rn.orthologs"
|
60
|
+
p rn.orthologs
|
61
|
+
puts "# rn.orthologs_as_hash"
|
62
|
+
p rn.orthologs_as_hash
|
63
|
+
|
64
|
+
puts "=" * 78
|
65
|
+
end
|
66
|
+
|
@@ -0,0 +1,92 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_kegg_taxonomy.rb - demonstration of Bio::KEGG::Taxonomy
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2007 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
#
|
8
|
+
# == Description
|
9
|
+
#
|
10
|
+
# IMPORTANT NOTE: currently, this sample does not work!
|
11
|
+
#
|
12
|
+
# Demonstration of Bio::KEGG::Taxonomy.
|
13
|
+
#
|
14
|
+
# == Usage
|
15
|
+
#
|
16
|
+
# Specify a file containing KEGG Taxonomy data.
|
17
|
+
#
|
18
|
+
# $ ruby demo_kegg_taxonomy.rb file
|
19
|
+
#
|
20
|
+
# Optionally, when a file containing organisms list (1 line per 1 organism)
|
21
|
+
# is specified after the file, only the specified organisms are shown.
|
22
|
+
#
|
23
|
+
# $ ruby demo_kegg_taxonomy.rb kegg_taxonomy_file org_list_file
|
24
|
+
#
|
25
|
+
# == Example of running this script
|
26
|
+
#
|
27
|
+
# Download test data.
|
28
|
+
#
|
29
|
+
# $ wget ftp://ftp.genome.jp/pub/kegg/genes/taxonomy
|
30
|
+
#
|
31
|
+
# The downloaded filename is "taxonomy".
|
32
|
+
#
|
33
|
+
# Run this script.
|
34
|
+
#
|
35
|
+
# $ ruby -Ilib sample/demo_kegg_taxonomy.rb taxonomy
|
36
|
+
#
|
37
|
+
# == Development information
|
38
|
+
#
|
39
|
+
# The code was moved from lib/bio/db/kegg/taxonomy.rb.
|
40
|
+
#
|
41
|
+
|
42
|
+
require 'bio'
|
43
|
+
|
44
|
+
#if __FILE__ == $0
|
45
|
+
|
46
|
+
# Usage:
|
47
|
+
# % wget ftp://ftp.genome.jp/pub/kegg/genes/taxonomy
|
48
|
+
# % ruby taxonomy.rb taxonomy | less -S
|
49
|
+
|
50
|
+
taxonomy = ARGV.shift
|
51
|
+
org_list = ARGV.shift || nil
|
52
|
+
|
53
|
+
if org_list
|
54
|
+
orgs = File.readlines(org_list).map{|x| x.strip}
|
55
|
+
else
|
56
|
+
orgs = nil
|
57
|
+
end
|
58
|
+
|
59
|
+
tree = Bio::KEGG::Taxonomy.new(taxonomy, orgs)
|
60
|
+
|
61
|
+
puts ">>> tree - original"
|
62
|
+
puts tree
|
63
|
+
|
64
|
+
puts ">>> tree - after compact"
|
65
|
+
tree.compact
|
66
|
+
puts tree
|
67
|
+
|
68
|
+
puts ">>> tree - after reduce"
|
69
|
+
tree.reduce
|
70
|
+
puts tree
|
71
|
+
|
72
|
+
puts ">>> path - sorted"
|
73
|
+
tree.path.sort.each do |path|
|
74
|
+
puts path.join("/")
|
75
|
+
end
|
76
|
+
|
77
|
+
puts ">>> group : orgs"
|
78
|
+
tree.dfs(tree.root) do |parent, children|
|
79
|
+
if orgs = tree.organisms(parent)
|
80
|
+
puts "#{parent.ljust(30)} (#{orgs.size})\t#{orgs.join(', ')}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
puts ">>> group : subgroups"
|
85
|
+
tree.dfs_with_level(tree.root) do |parent, children, level|
|
86
|
+
subgroups = children.keys.sort
|
87
|
+
indent = " " * level
|
88
|
+
label = "#{indent} #{level} #{parent}"
|
89
|
+
puts "#{label.ljust(35)}\t#{subgroups.join(', ')}"
|
90
|
+
end
|
91
|
+
|
92
|
+
#end
|