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,285 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_blast_report.rb - demonstration of Bio::Blast::Report, Bio::Blast::Default::Report, and Bio::Blast::WU::Report
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2003 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# Copyright:: Copyright (C) 2003-2006,2008-2009 Naohisa Goto <ng@bioruby.org>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# == Description
|
10
|
+
#
|
11
|
+
# Demonstration of Bio::Blast::Report (NCBI BLAST XML format parser),
|
12
|
+
# Bio::Blast::Default::Report (NCBI BLAST default (-m 0) format parser),
|
13
|
+
# and Bio::Blast::WU::Report (WU-BLAST default format parser).
|
14
|
+
#
|
15
|
+
# == Usage
|
16
|
+
#
|
17
|
+
# Specify files containing BLAST results.
|
18
|
+
#
|
19
|
+
# $ ruby demo_blast_report.rb files...
|
20
|
+
#
|
21
|
+
# Example usage using test data:
|
22
|
+
#
|
23
|
+
# $ ruby -Ilib sample/demo_blast_report.rb test/data/blast/b0002.faa.m7
|
24
|
+
# $ ruby -Ilib sample/demo_blast_report.rb test/data/blast/b0002.faa.m0
|
25
|
+
#
|
26
|
+
# == Development information
|
27
|
+
#
|
28
|
+
# The code was moved from lib/bio/appl/blast/report.rb,
|
29
|
+
# lib/bio/appl/blast/format0.rb, and lib/bio/appl/blast/wublast.rb,
|
30
|
+
# and modified.
|
31
|
+
#
|
32
|
+
|
33
|
+
require 'bio'
|
34
|
+
|
35
|
+
# dummpy class to return specific object
|
36
|
+
class Dummy
|
37
|
+
def initialize(obj)
|
38
|
+
@obj = obj
|
39
|
+
end
|
40
|
+
def size
|
41
|
+
@obj
|
42
|
+
end
|
43
|
+
def inspect
|
44
|
+
@obj.inspect
|
45
|
+
end
|
46
|
+
end #class Dummy
|
47
|
+
|
48
|
+
# wrapper class to ignore error
|
49
|
+
class Wrapper
|
50
|
+
def initialize(obj)
|
51
|
+
@obj = obj
|
52
|
+
end
|
53
|
+
def class
|
54
|
+
@obj.class
|
55
|
+
end
|
56
|
+
def respond_to?(*arg)
|
57
|
+
@obj.respond_to?(*arg)
|
58
|
+
end
|
59
|
+
def method_missing(meth, *arg, &block)
|
60
|
+
begin
|
61
|
+
@obj.__send__(meth, *arg, &block)
|
62
|
+
rescue NoMethodError => evar
|
63
|
+
Dummy.new(evar)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end #class Wrapper
|
67
|
+
|
68
|
+
def wrap(obj)
|
69
|
+
Wrapper.new(obj)
|
70
|
+
end
|
71
|
+
|
72
|
+
# -m0: not defined in Bio::Blast::Default::Report ???
|
73
|
+
# +m0: newly added in Bio::Blast::Default::Report ???
|
74
|
+
# -WU: not defined in Bio::Blast::WU::Report ???
|
75
|
+
# +WU: newly added in Bio::Blast::WU::Report ???
|
76
|
+
|
77
|
+
Bio::FlatFile.open(ARGF) do |ff|
|
78
|
+
puts "Detected file format: #{ff.dbclass}"
|
79
|
+
unless ff.dbclass then
|
80
|
+
ff.dbclass = Bio::Blast::Report
|
81
|
+
puts "Input data may be tab-delimited format (-m 8)."
|
82
|
+
end
|
83
|
+
ff.each do |rep|
|
84
|
+
rep = wrap(rep)
|
85
|
+
|
86
|
+
#print "# === Bio::Blast::Default::Report\n"
|
87
|
+
print "# === #{rep.class}\n"
|
88
|
+
puts
|
89
|
+
print " rep.program #=> "; p rep.program
|
90
|
+
print " rep.version #=> "; p rep.version
|
91
|
+
print " rep.reference #=> "; p rep.reference
|
92
|
+
print " rep.notice [WU] #=> "; p rep.notice #+WU
|
93
|
+
print " rep.db #=> "; p rep.db
|
94
|
+
print " rep.query_id #=> "; p rep.query_id #-m0,-WU
|
95
|
+
print " rep.query_def #=> "; p rep.query_def
|
96
|
+
print " rep.query_len #=> "; p rep.query_len
|
97
|
+
#puts
|
98
|
+
print " rep.version_number #=> "; p rep.version_number #+m0,+WU
|
99
|
+
print " rep.version_date #=> "; p rep.version_date #+m0,+WU
|
100
|
+
puts
|
101
|
+
|
102
|
+
print "# === Parameters\n"
|
103
|
+
#puts
|
104
|
+
print " rep.parameters #=> "; p rep.parameters #-m0
|
105
|
+
puts
|
106
|
+
print " rep.matrix #=> "; p rep.matrix #-WU
|
107
|
+
print " rep.expect #=> "; p rep.expect
|
108
|
+
print " rep.inclusion #=> "; p rep.inclusion #-m0,-WU
|
109
|
+
print " rep.sc_match #=> "; p rep.sc_match #-WU
|
110
|
+
print " rep.sc_mismatch #=> "; p rep.sc_mismatch #-WU
|
111
|
+
print " rep.gap_open #=> "; p rep.gap_open #-WU
|
112
|
+
print " rep.gap_extend #=> "; p rep.gap_extend #-WU
|
113
|
+
print " rep.filter #=> "; p rep.filter #-m0,-WU
|
114
|
+
print " rep.pattern #=> "; p rep.pattern #-WU
|
115
|
+
print " rep.entrez_query #=> "; p rep.entrez_query #-m0
|
116
|
+
#puts
|
117
|
+
print " rep.pattern_positions #=> "; p rep.pattern_positions #+m0
|
118
|
+
puts
|
119
|
+
|
120
|
+
print "# === Statistics (last iteration's)\n"
|
121
|
+
#puts
|
122
|
+
print " rep.statistics #=> "; p rep.statistics #-m0,-WU
|
123
|
+
puts
|
124
|
+
print " rep.db_num #=> "; p rep.db_num
|
125
|
+
print " rep.db_len #=> "; p rep.db_len
|
126
|
+
print " rep.hsp_len #=> "; p rep.hsp_len #-m0,-WU
|
127
|
+
print " rep.eff_space #=> "; p rep.eff_space #-WU
|
128
|
+
print " rep.kappa #=> "; p rep.kappa #-WU
|
129
|
+
print " rep.lambda #=> "; p rep.lambda #-WU
|
130
|
+
print " rep.entropy #=> "; p rep.entropy #-WU
|
131
|
+
puts
|
132
|
+
print " rep.num_hits #=> "; p rep.num_hits #+m0
|
133
|
+
print " rep.gapped_kappa #=> "; p rep.gapped_kappa #+m0
|
134
|
+
print " rep.gapped_lambda #=> "; p rep.gapped_lambda #+m0
|
135
|
+
print " rep.gapped_entropy #=> "; p rep.gapped_entropy #+m0
|
136
|
+
print " rep.posted_date #=> "; p rep.posted_date #+m0
|
137
|
+
puts
|
138
|
+
|
139
|
+
print "# === Message (last iteration's)\n"
|
140
|
+
puts
|
141
|
+
print " rep.message #=> "; p rep.message #-WU
|
142
|
+
#puts
|
143
|
+
print " rep.converged? #=> "; p rep.converged? #+m0
|
144
|
+
puts
|
145
|
+
|
146
|
+
print "# === Warning messages\n"
|
147
|
+
print " rep.warnings [WU] #=> "; p rep.warnings #+WU
|
148
|
+
|
149
|
+
print "# === Iterations\n"
|
150
|
+
puts
|
151
|
+
print " rep.itrerations.each do |itr|\n"
|
152
|
+
puts
|
153
|
+
|
154
|
+
rep.iterations.each do |itr|
|
155
|
+
itr = wrap(itr)
|
156
|
+
|
157
|
+
#print "# --- Bio::Blast::Default::Report::Iteration\n"
|
158
|
+
print "# --- #{itr.class}\n"
|
159
|
+
puts
|
160
|
+
|
161
|
+
print " itr.num #=> "; p itr.num
|
162
|
+
print " itr.statistics #=> "; p itr.statistics #-m0,-WU
|
163
|
+
print " itr.warnings [WU] #=> "; p itr.warnings #+WU
|
164
|
+
print " itr.message #=> "; p itr.message
|
165
|
+
print " itr.hits.size #=> "; p itr.hits.size
|
166
|
+
#puts
|
167
|
+
print " itr.hits_newly_found.size #=> "; p((itr.hits_newly_found.size rescue nil)); #+m0
|
168
|
+
print " itr.hits_found_again.size #=> "; p((itr.hits_found_again.size rescue nil)); #+m0
|
169
|
+
if itr.respond_to?(:hits_for_pattern) and itr.hits_for_pattern then #+m0
|
170
|
+
itr.hits_for_pattern.each_with_index do |hp, hpi|
|
171
|
+
print " itr.hits_for_pattern[#{hpi}].size #=> "; p hp.size;
|
172
|
+
end
|
173
|
+
end
|
174
|
+
print " itr.converged? #=> "; p itr.converged? #+m0,+WU
|
175
|
+
puts
|
176
|
+
|
177
|
+
print " itr.hits.each do |hit|\n"
|
178
|
+
puts
|
179
|
+
|
180
|
+
itr.hits.each_with_index do |hit, i|
|
181
|
+
hit = wrap(hit)
|
182
|
+
|
183
|
+
#print "# --- Bio::Blast::Default::Report::Hit"
|
184
|
+
print "# --- #{hit.class}"
|
185
|
+
print " ([#{i}])\n"
|
186
|
+
puts
|
187
|
+
|
188
|
+
print " hit.num #=> "; p hit.num #-m0,-WU
|
189
|
+
print " hit.hit_id #=> "; p hit.hit_id #-m0,-WU
|
190
|
+
print " hit.len #=> "; p hit.len
|
191
|
+
print " hit.definition #=> "; p hit.definition
|
192
|
+
print " hit.accession #=> "; p hit.accession #-m0,-WU
|
193
|
+
#puts
|
194
|
+
print " hit.found_again? #=> "; p hit.found_again? #+m0,+WU
|
195
|
+
print " hit.score [WU] #=> "; p hit.score #+WU
|
196
|
+
print " hit.pvalue [WU] #=> "; p hit.pvalue #+WU
|
197
|
+
print " hit.n_number [WU] #=> "; p hit.n_number #+WU
|
198
|
+
|
199
|
+
print " --- compatible/shortcut ---\n"
|
200
|
+
print " hit.query_id #=> "; p hit.query_id #-m0,-WU
|
201
|
+
print " hit.query_def #=> "; p hit.query_def #-m0,-WU
|
202
|
+
print " hit.query_len #=> "; p hit.query_len #-m0,-WU
|
203
|
+
print " hit.target_id #=> "; p hit.target_id #-m0,-WU
|
204
|
+
print " hit.target_def #=> "; p hit.target_def
|
205
|
+
print " hit.target_len #=> "; p hit.target_len
|
206
|
+
|
207
|
+
print " --- first HSP's values (shortcut) ---\n"
|
208
|
+
print " hit.evalue #=> "; p hit.evalue
|
209
|
+
print " hit.bit_score #=> "; p hit.bit_score
|
210
|
+
print " hit.identity #=> "; p hit.identity
|
211
|
+
print " hit.overlap #=> "; p hit.overlap #-m0,-WU
|
212
|
+
|
213
|
+
print " hit.query_seq #=> "; p hit.query_seq
|
214
|
+
print " hit.midline #=> "; p hit.midline
|
215
|
+
print " hit.target_seq #=> "; p hit.target_seq
|
216
|
+
|
217
|
+
print " hit.query_start #=> "; p hit.query_start
|
218
|
+
print " hit.query_end #=> "; p hit.query_end
|
219
|
+
print " hit.target_start #=> "; p hit.target_start
|
220
|
+
print " hit.target_end #=> "; p hit.target_end
|
221
|
+
print " hit.lap_at #=> "; p hit.lap_at
|
222
|
+
print " --- first HSP's vaules (shortcut) ---\n"
|
223
|
+
print " --- compatible/shortcut ---\n"
|
224
|
+
|
225
|
+
puts
|
226
|
+
print " hit.hsps.size #=> "; p hit.hsps.size
|
227
|
+
if hit.hsps.size == 0 then
|
228
|
+
puts " (HSP not found: please see blastall's -b and -v options)"
|
229
|
+
puts
|
230
|
+
else
|
231
|
+
|
232
|
+
puts
|
233
|
+
print " hit.hsps.each do |hsp|\n"
|
234
|
+
puts
|
235
|
+
|
236
|
+
hit.hsps.each_with_index do |hsp, j|
|
237
|
+
hsp = wrap(hsp)
|
238
|
+
|
239
|
+
#print "# --- Bio::Blast::Default::Report::Hsp"
|
240
|
+
print "# --- #{hsp.class}"
|
241
|
+
print " ([#{j}])\n"
|
242
|
+
puts
|
243
|
+
print " hsp.num #=> "; p hsp.num #-m0,-WU
|
244
|
+
print " hsp.bit_score #=> "; p hsp.bit_score
|
245
|
+
print " hsp.score #=> "; p hsp.score
|
246
|
+
print " hsp.evalue #=> "; p hsp.evalue
|
247
|
+
print " hsp.identity #=> "; p hsp.identity
|
248
|
+
print " hsp.gaps #=> "; p hsp.gaps
|
249
|
+
print " hsp.positive #=> "; p hsp.positive
|
250
|
+
print " hsp.align_len #=> "; p hsp.align_len
|
251
|
+
print " hsp.density #=> "; p hsp.density #-m0,-WU
|
252
|
+
print " hsp.pvalue [WU]#=> "; p hsp.pvalue #+WU
|
253
|
+
print " hsp.p_sum_n [WU]#=> "; p hsp.p_sum_n #+WU
|
254
|
+
|
255
|
+
print " hsp.query_frame #=> "; p hsp.query_frame
|
256
|
+
print " hsp.query_from #=> "; p hsp.query_from
|
257
|
+
print " hsp.query_to #=> "; p hsp.query_to
|
258
|
+
|
259
|
+
print " hsp.hit_frame #=> "; p hsp.hit_frame
|
260
|
+
print " hsp.hit_from #=> "; p hsp.hit_from
|
261
|
+
print " hsp.hit_to #=> "; p hsp.hit_to
|
262
|
+
|
263
|
+
print " hsp.pattern_from#=> "; p hsp.pattern_from #-m0,-WU
|
264
|
+
print " hsp.pattern_to #=> "; p hsp.pattern_to #-m0,-WU
|
265
|
+
|
266
|
+
print " hsp.qseq #=> "; p hsp.qseq
|
267
|
+
print " hsp.midline #=> "; p hsp.midline
|
268
|
+
print " hsp.hseq #=> "; p hsp.hseq
|
269
|
+
puts
|
270
|
+
print " hsp.percent_identity #=> "; p hsp.percent_identity
|
271
|
+
print " hsp.mismatch_count #=> "; p hsp.mismatch_count #-m0,-WU
|
272
|
+
#
|
273
|
+
print " hsp.query_strand #=> "; p hsp.query_strand #+m0,+WU
|
274
|
+
print " hsp.hit_strand #=> "; p hsp.hit_strand #+m0,+WU
|
275
|
+
print " hsp.percent_positive #=> "; p hsp.percent_positive #+m0,+WU
|
276
|
+
print " hsp.percent_gaps #=> "; p hsp.percent_gaps #+m0,+WU
|
277
|
+
puts
|
278
|
+
|
279
|
+
end #each
|
280
|
+
end #if hit.hsps.size == 0
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end #ff.each
|
284
|
+
end #Bio::FlatFile.open
|
285
|
+
|
@@ -0,0 +1,119 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_codontable.rb - demonstration of Bio::CodonTable
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2001, 2004
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# == Description
|
10
|
+
#
|
11
|
+
# Demonstration of Bio::CodonTable.
|
12
|
+
#
|
13
|
+
# == Usage
|
14
|
+
#
|
15
|
+
# Simply run this script.
|
16
|
+
#
|
17
|
+
# $ ruby demo_codontable.rb
|
18
|
+
#
|
19
|
+
# == Development information
|
20
|
+
#
|
21
|
+
# The code was moved from lib/bio/data/codontable.rb.
|
22
|
+
#
|
23
|
+
|
24
|
+
require 'bio'
|
25
|
+
|
26
|
+
|
27
|
+
#if __FILE__ == $0
|
28
|
+
|
29
|
+
begin
|
30
|
+
require 'pp'
|
31
|
+
alias p pp
|
32
|
+
rescue LoadError
|
33
|
+
end
|
34
|
+
|
35
|
+
puts "### Bio::CodonTable[1]"
|
36
|
+
p ct1 = Bio::CodonTable[1]
|
37
|
+
|
38
|
+
puts ">>> Bio::CodonTable#table"
|
39
|
+
p ct1.table
|
40
|
+
|
41
|
+
puts ">>> Bio::CodonTable#each"
|
42
|
+
ct1.each do |codon, aa|
|
43
|
+
puts "#{codon} -- #{aa}"
|
44
|
+
end
|
45
|
+
|
46
|
+
puts ">>> Bio::CodonTable#definition"
|
47
|
+
p ct1.definition
|
48
|
+
|
49
|
+
puts ">>> Bio::CodonTable#['atg']"
|
50
|
+
p ct1['atg']
|
51
|
+
|
52
|
+
puts ">>> Bio::CodonTable#revtrans('A')"
|
53
|
+
p ct1.revtrans('A')
|
54
|
+
|
55
|
+
puts ">>> Bio::CodonTable#start_codon?('atg')"
|
56
|
+
p ct1.start_codon?('atg')
|
57
|
+
|
58
|
+
puts ">>> Bio::CodonTable#start_codon?('aaa')"
|
59
|
+
p ct1.start_codon?('aaa')
|
60
|
+
|
61
|
+
puts ">>> Bio::CodonTable#stop_codon?('tag')"
|
62
|
+
p ct1.stop_codon?('tag')
|
63
|
+
|
64
|
+
puts ">>> Bio::CodonTable#stop_codon?('aaa')"
|
65
|
+
p ct1.stop_codon?('aaa')
|
66
|
+
|
67
|
+
puts ">>> ct1_copy = Bio::CodonTable.copy(1)"
|
68
|
+
p ct1_copy = Bio::CodonTable.copy(1)
|
69
|
+
puts ">>> ct1_copy['tga'] = 'U'"
|
70
|
+
p ct1_copy['tga'] = 'U'
|
71
|
+
puts " orig : #{ct1['tga']}"
|
72
|
+
puts " copy : #{ct1_copy['tga']}"
|
73
|
+
|
74
|
+
|
75
|
+
puts "### ct = Bio::CodonTable.new(hash, definition)"
|
76
|
+
hash = {
|
77
|
+
'ttt' => 'F', 'tct' => 'S', 'tat' => 'Y', 'tgt' => 'C',
|
78
|
+
'ttc' => 'F', 'tcc' => 'S', 'tac' => 'Y', 'tgc' => 'C',
|
79
|
+
'tta' => 'L', 'tca' => 'S', 'taa' => '*', 'tga' => 'U',
|
80
|
+
'ttg' => 'L', 'tcg' => 'S', 'tag' => '*', 'tgg' => 'W',
|
81
|
+
|
82
|
+
'ctt' => 'L', 'cct' => 'P', 'cat' => 'H', 'cgt' => 'R',
|
83
|
+
'ctc' => 'L', 'ccc' => 'P', 'cac' => 'H', 'cgc' => 'R',
|
84
|
+
'cta' => 'L', 'cca' => 'P', 'caa' => 'Q', 'cga' => 'R',
|
85
|
+
'ctg' => 'L', 'ccg' => 'P', 'cag' => 'Q', 'cgg' => 'R',
|
86
|
+
|
87
|
+
'att' => 'I', 'act' => 'T', 'aat' => 'N', 'agt' => 'S',
|
88
|
+
'atc' => 'I', 'acc' => 'T', 'aac' => 'N', 'agc' => 'S',
|
89
|
+
'ata' => 'I', 'aca' => 'T', 'aaa' => 'K', 'aga' => 'R',
|
90
|
+
'atg' => 'M', 'acg' => 'T', 'aag' => 'K', 'agg' => 'R',
|
91
|
+
|
92
|
+
'gtt' => 'V', 'gct' => 'A', 'gat' => 'D', 'ggt' => 'G',
|
93
|
+
'gtc' => 'V', 'gcc' => 'A', 'gac' => 'D', 'ggc' => 'G',
|
94
|
+
'gta' => 'V', 'gca' => 'A', 'gaa' => 'E', 'gga' => 'G',
|
95
|
+
'gtg' => 'V', 'gcg' => 'A', 'gag' => 'E', 'ggg' => 'G',
|
96
|
+
}
|
97
|
+
my_ct = Bio::CodonTable.new(hash, "my codon table")
|
98
|
+
|
99
|
+
puts ">>> ct.definition"
|
100
|
+
puts my_ct.definition
|
101
|
+
|
102
|
+
puts ">>> ct.definition=(str)"
|
103
|
+
my_ct.definition = "selenoproteins (Eukaryote)"
|
104
|
+
puts my_ct.definition
|
105
|
+
|
106
|
+
puts ">>> ct['tga']"
|
107
|
+
puts my_ct['tga']
|
108
|
+
|
109
|
+
puts ">>> ct.revtrans('U')"
|
110
|
+
puts my_ct.revtrans('U')
|
111
|
+
|
112
|
+
puts ">>> ct.stop_codon?('tga')"
|
113
|
+
puts my_ct.stop_codon?('tga')
|
114
|
+
|
115
|
+
puts ">>> ct.stop_codon?('tag')"
|
116
|
+
puts my_ct.stop_codon?('tag')
|
117
|
+
|
118
|
+
#end
|
119
|
+
|
data/sample/demo_das.rb
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_go.rb - demonstration of Bio::DAS, BioDAS access module
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2003, 2004, 2007
|
5
|
+
# Shuichi Kawashima <shuichi@hgc.jp>,
|
6
|
+
# Toshiaki Katayama <k@bioruby.org>
|
7
|
+
# License:: The Ruby License
|
8
|
+
#
|
9
|
+
#
|
10
|
+
# == Description
|
11
|
+
#
|
12
|
+
# Demonstration of Bio::GO, BioDAS access module.
|
13
|
+
#
|
14
|
+
# == Requirements
|
15
|
+
#
|
16
|
+
# Internet connection is needed.
|
17
|
+
#
|
18
|
+
# == Usage
|
19
|
+
#
|
20
|
+
# Simply run this script.
|
21
|
+
#
|
22
|
+
# $ ruby demo_das.rb
|
23
|
+
#
|
24
|
+
# == Notes
|
25
|
+
#
|
26
|
+
# Demo using the WormBase DAS server is temporarily disabled because
|
27
|
+
# it does not work well possibly because of the server trouble.
|
28
|
+
#
|
29
|
+
# == Development information
|
30
|
+
#
|
31
|
+
# The code was moved from lib/bio/io/das.rb and modified as below:
|
32
|
+
#
|
33
|
+
# * Demo codes using UCSC DAS server is added.
|
34
|
+
#
|
35
|
+
|
36
|
+
require 'bio'
|
37
|
+
|
38
|
+
# begin
|
39
|
+
# require 'pp'
|
40
|
+
# alias p pp
|
41
|
+
# rescue LoadError
|
42
|
+
# end
|
43
|
+
|
44
|
+
if false #disabled
|
45
|
+
puts "### WormBase"
|
46
|
+
wormbase = Bio::DAS.new('http://www.wormbase.org/db/')
|
47
|
+
|
48
|
+
puts ">>> test get_dsn"
|
49
|
+
p wormbase.get_dsn
|
50
|
+
|
51
|
+
puts ">>> create segment obj Bio::DAS::SEGMENT.region('I', 1, 1000)"
|
52
|
+
seg = Bio::DAS::SEGMENT.region('I', 1, 1000)
|
53
|
+
p seg
|
54
|
+
|
55
|
+
puts ">>> test get_dna"
|
56
|
+
p wormbase.get_dna('elegans', seg)
|
57
|
+
|
58
|
+
puts "### test get_features"
|
59
|
+
p wormbase.get_features('elegans', seg)
|
60
|
+
end #if false #disabled
|
61
|
+
|
62
|
+
if true #enabled
|
63
|
+
puts "### UCSC"
|
64
|
+
ucsc = Bio::DAS.new('http://genome.ucsc.edu/cgi-bin/')
|
65
|
+
|
66
|
+
puts ">>> test get_dsn"
|
67
|
+
p ucsc.get_dsn
|
68
|
+
|
69
|
+
puts ">>> test get_entry_points('hg19')"
|
70
|
+
p ucsc.get_entry_points('hg19')
|
71
|
+
|
72
|
+
puts ">>> test get_types('hg19')"
|
73
|
+
p ucsc.get_types('hg19')
|
74
|
+
|
75
|
+
len = rand(50) * 10 + 100
|
76
|
+
pos = rand(243199373 - len)
|
77
|
+
puts ">>> create segment obj Bio::DAS::SEGMENT.region('2', #{pos}, #{pos + len - 1})"
|
78
|
+
seg2 = Bio::DAS::SEGMENT.region('2', pos, pos + len - 1)
|
79
|
+
p seg2
|
80
|
+
|
81
|
+
puts ">>> test get_dna"
|
82
|
+
p ucsc.get_dna('hg19', seg2)
|
83
|
+
|
84
|
+
puts "### test get_features"
|
85
|
+
p ucsc.get_features('hg19', seg2)
|
86
|
+
end #if true #enabled
|
87
|
+
|
88
|
+
if true #enabled
|
89
|
+
puts "### KEGG DAS"
|
90
|
+
kegg_das = Bio::DAS.new("http://das.hgc.jp/cgi-bin/")
|
91
|
+
|
92
|
+
dsn_list = kegg_das.get_dsn
|
93
|
+
org_list = dsn_list.collect {|x| x.source}
|
94
|
+
|
95
|
+
puts ">>> dsn : entry_points"
|
96
|
+
org_list.each do |org|
|
97
|
+
print "#{org} : "
|
98
|
+
list = kegg_das.get_entry_points(org)
|
99
|
+
list.segments.each do |seg|
|
100
|
+
print " #{seg.entry_id}"
|
101
|
+
end
|
102
|
+
puts
|
103
|
+
end
|
104
|
+
end #if true #enabled
|
105
|
+
|