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,212 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_ddbjxml.rb - demonstration of Bio::DDBJ::XML, DDBJ SOAP access
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2003, 2004
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
#
|
9
|
+
#
|
10
|
+
# == Description
|
11
|
+
#
|
12
|
+
# Demonstration of Bio::DDBJ::XML, DDBJ SOAP server access class.
|
13
|
+
#
|
14
|
+
# == Requirements
|
15
|
+
#
|
16
|
+
# Internet connection is needed.
|
17
|
+
#
|
18
|
+
# == Usage
|
19
|
+
#
|
20
|
+
# Simply run this script.
|
21
|
+
#
|
22
|
+
# $ ruby demo_ddbjxml.rb
|
23
|
+
#
|
24
|
+
# == Notes
|
25
|
+
#
|
26
|
+
# It can not be run with Ruby 1.9 because SOAP4R (SOAP support for Ruby)
|
27
|
+
# currently does not support Ruby 1.9.
|
28
|
+
#
|
29
|
+
# == Development information
|
30
|
+
#
|
31
|
+
# The code was moved from lib/bio/io/ddbjxml.rb.
|
32
|
+
#
|
33
|
+
|
34
|
+
require 'bio'
|
35
|
+
|
36
|
+
#if __FILE__ == $0
|
37
|
+
|
38
|
+
begin
|
39
|
+
require 'pp'
|
40
|
+
alias p pp
|
41
|
+
rescue LoadError
|
42
|
+
end
|
43
|
+
|
44
|
+
puts ">>> Bio::DDBJ::XML::Blast"
|
45
|
+
serv = Bio::DDBJ::XML::Blast.new
|
46
|
+
# serv.log = STDERR
|
47
|
+
|
48
|
+
query = "MSSRIARALALVVTLLHLTRLALSTCPAACHCPLEAPKCAPGVGLVRDGCGCCKVCAKQL"
|
49
|
+
|
50
|
+
puts "### searchSimple('blastp', 'SWISS', query)"
|
51
|
+
puts serv.searchSimple('blastp', 'SWISS', query)
|
52
|
+
|
53
|
+
puts "### searchParam('tblastn', 'ddbjvrl', query, '-m 8')"
|
54
|
+
puts serv.searchParam('tblastn', 'ddbjvrl', query, '-m 8')
|
55
|
+
|
56
|
+
|
57
|
+
puts ">>> Bio::DDBJ::XML::ClustalW"
|
58
|
+
serv = Bio::DDBJ::XML::ClustalW.new
|
59
|
+
|
60
|
+
query = <<END
|
61
|
+
> RABSTOUT rabbit Guinness receptor
|
62
|
+
LKMHLMGHLKMGLKMGLKGMHLMHLKHMHLMTYTYTTYRRWPLWMWLPDFGHAS
|
63
|
+
ADSCVCAHGFAVCACFAHFDVCFGAVCFHAVCFAHVCFAAAVCFAVCAC
|
64
|
+
> MUSNOSE mouse nose drying factor
|
65
|
+
mhkmmhkgmkhmhgmhmhglhmkmhlkmgkhmgkmkytytytryrwtqtqwtwyt
|
66
|
+
fdgfdsgafdagfdgfsagdfavdfdvgavfsvfgvdfsvdgvagvfdv
|
67
|
+
> HSHEAVEN human Guinness receptor repeat
|
68
|
+
mhkmmhkgmkhmhgmhmhg lhmkmhlkmgkhmgkmk ytytytryrwtqtqwtwyt
|
69
|
+
fdgfdsgafdagfdgfsag dfavdfdvgavfsvfgv dfsvdgvagvfdv
|
70
|
+
mhkmmhkgmkhmhgmhmhg lhmkmhlkmgkhmgkmk ytytytryrwtqtqwtwyt
|
71
|
+
fdgfdsgafdagfdgfsag dfavdfdvgavfsvfgv dfsvdgvagvfdv
|
72
|
+
END
|
73
|
+
|
74
|
+
puts "### analyzeSimple(query)"
|
75
|
+
puts serv.analyzeSimple(query)
|
76
|
+
|
77
|
+
puts "### analyzeParam(query, '-align -matrix=blosum')"
|
78
|
+
puts serv.analyzeParam(query, '-align -matrix=blosum')
|
79
|
+
|
80
|
+
|
81
|
+
puts ">>> Bio::DDBJ::XML::DDBJ"
|
82
|
+
serv = Bio::DDBJ::XML::DDBJ.new
|
83
|
+
|
84
|
+
puts "### getFFEntry('AB000050')"
|
85
|
+
puts serv.getFFEntry('AB000050')
|
86
|
+
|
87
|
+
puts "### getXMLEntry('AB000050')"
|
88
|
+
puts serv.getXMLEntry('AB000050')
|
89
|
+
|
90
|
+
puts "### getFeatureInfo('AB000050', 'cds')"
|
91
|
+
puts serv.getFeatureInfo('AB000050', 'cds')
|
92
|
+
|
93
|
+
puts "### getAllFeatures('AB000050')"
|
94
|
+
puts serv.getAllFeatures('AB000050')
|
95
|
+
|
96
|
+
puts "### getRelatedFeatures('AL121903', '59000', '64000')"
|
97
|
+
puts serv.getRelatedFeatures('AL121903', '59000', '64000')
|
98
|
+
|
99
|
+
puts "### getRelatedFeaturesSeq('AL121903', '59000', '64000')"
|
100
|
+
puts serv.getRelatedFeaturesSeq('AL121903', '59000', '64000')
|
101
|
+
|
102
|
+
|
103
|
+
puts ">>> Bio::DDBJ::XML::Fasta"
|
104
|
+
serv = Bio::DDBJ::XML::Fasta.new
|
105
|
+
|
106
|
+
query = ">Test\nMSDGAVQPDG GQPAVRNERA TGSGNGSGGG GGGGSGGVGI"
|
107
|
+
|
108
|
+
puts "### searchSimple('fasta34', 'PDB', query)"
|
109
|
+
puts serv.searchSimple('fasta34', 'PDB', query)
|
110
|
+
|
111
|
+
query = ">Test\nAGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"
|
112
|
+
|
113
|
+
puts "### searchParam('fastx34_t', 'PDB', query, '-n')"
|
114
|
+
puts serv.searchParam('fastx34_t', 'PDB', query, '-n')
|
115
|
+
|
116
|
+
|
117
|
+
puts ">>> Bio::DDBJ::XML::GetEntry"
|
118
|
+
serv = Bio::DDBJ::XML::GetEntry.new
|
119
|
+
|
120
|
+
puts "### getDDBJEntry('AB000050')"
|
121
|
+
puts serv.getDDBJEntry('AB000050')
|
122
|
+
|
123
|
+
puts "### getPDBEntry('1AAR')"
|
124
|
+
puts serv. getPDBEntry('1AAR')
|
125
|
+
|
126
|
+
|
127
|
+
puts ">>> Bio::DDBJ::XML::Gib"
|
128
|
+
serv = Bio::DDBJ::XML::Gib.new
|
129
|
+
|
130
|
+
puts "### getOrganismList"
|
131
|
+
puts serv.getOrganismList
|
132
|
+
|
133
|
+
puts "### getChIDList"
|
134
|
+
puts serv.getChIDList
|
135
|
+
|
136
|
+
puts "### getOrganismNameFromChid('Sent_CT18:')"
|
137
|
+
puts serv.getOrganismNameFromChid('Sent_CT18:')
|
138
|
+
|
139
|
+
puts "### getChIDFromOrganismName('Aquifex aeolicus VF5')"
|
140
|
+
puts serv.getChIDFromOrganismName('Aquifex aeolicus VF5')
|
141
|
+
|
142
|
+
puts "### getAccession('Ecol_K12_MG1655:')"
|
143
|
+
puts serv.getAccession('Ecol_K12_MG1655:')
|
144
|
+
|
145
|
+
puts "### getPieceNumber('Mgen_G37:')"
|
146
|
+
puts serv.getPieceNumber('Mgen_G37:')
|
147
|
+
|
148
|
+
puts "### getDivision('Mgen_G37:')"
|
149
|
+
puts serv.getDivision('Mgen_G37:')
|
150
|
+
|
151
|
+
puts "### getType('Mgen_G37:')"
|
152
|
+
puts serv.getType('Mgen_G37:')
|
153
|
+
|
154
|
+
puts "### getCDS('Aaeo_VF5:ece1')"
|
155
|
+
puts serv.getCDS('Aaeo_VF5:ece1')
|
156
|
+
|
157
|
+
puts "### getFlatFile('Nost_PCC7120:pCC7120zeta')"
|
158
|
+
puts serv.getFlatFile('Nost_PCC7120:pCC7120zeta')
|
159
|
+
|
160
|
+
puts "### getFastaFile('Nost_PCC7120:pCC7120zeta')"
|
161
|
+
puts serv.getFastaFile('Nost_PCC7120:pCC7120zeta', 'cdsaa')
|
162
|
+
|
163
|
+
|
164
|
+
puts ">>> Bio::DDBJ::XML::Gtop"
|
165
|
+
serv = Bio::DDBJ::XML::Gtop.new
|
166
|
+
|
167
|
+
puts "### getOrganismList"
|
168
|
+
puts serv.getOrganismList
|
169
|
+
|
170
|
+
puts "### getMasterInfo"
|
171
|
+
puts serv.getMasterInfo('thrA', 'ecol0')
|
172
|
+
|
173
|
+
|
174
|
+
# puts ">>> Bio::DDBJ::XML::PML"
|
175
|
+
# serv = Bio::DDBJ::XML::PML.new
|
176
|
+
#
|
177
|
+
# puts "### getVariation('1')"
|
178
|
+
# puts serv.getVariation('1')
|
179
|
+
|
180
|
+
|
181
|
+
puts ">>> Bio::DDBJ::XML::SRS"
|
182
|
+
serv = Bio::DDBJ::XML::SRS.new
|
183
|
+
|
184
|
+
puts "### searchSimple('[pathway-des:sugar]')"
|
185
|
+
puts serv.searchSimple('[pathway-des:sugar]')
|
186
|
+
|
187
|
+
puts "### searchParam('[swissprot-des:cohesin]', '-f seq -sf fasta')"
|
188
|
+
puts serv.searchParam('[swissprot-des:cohesin]', '-f seq -sf fasta')
|
189
|
+
|
190
|
+
|
191
|
+
puts ">>> Bio::DDBJ::XML::TxSearch"
|
192
|
+
serv = Bio::DDBJ::XML::TxSearch.new
|
193
|
+
|
194
|
+
puts "### searchSimple('*coli')"
|
195
|
+
puts serv.searchSimple('*coli')
|
196
|
+
|
197
|
+
puts "### searchSimple('*tardigrada*')"
|
198
|
+
puts serv.searchSimple('*tardigrada*')
|
199
|
+
|
200
|
+
puts "### getTxId('Escherichia coli')"
|
201
|
+
puts serv.getTxId('Escherichia coli')
|
202
|
+
|
203
|
+
puts "### getTxName('562')"
|
204
|
+
puts serv.getTxName('562')
|
205
|
+
|
206
|
+
query = "Campylobacter coli\nEscherichia coli"
|
207
|
+
rank = "family\ngenus"
|
208
|
+
|
209
|
+
puts "### searchLineage(query, rank, 'Bacteria')"
|
210
|
+
puts serv.searchLineage(query, rank, 'Bacteria')
|
211
|
+
|
212
|
+
#end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_fasta_remote.rb - demonstration of FASTA execution using GenomeNet web service
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2001, 2002 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# == Description
|
8
|
+
#
|
9
|
+
# Demonstration of Bio::Fasta.remote, wrapper class for FASTA execution using
|
10
|
+
# GenomeNet fasta.genome.jp web service.
|
11
|
+
#
|
12
|
+
# == Requirements
|
13
|
+
#
|
14
|
+
# * Internet connection
|
15
|
+
#
|
16
|
+
# == Usage
|
17
|
+
#
|
18
|
+
# Specify a files containing a nucleic acid sequence.
|
19
|
+
# The file format should be the fasta format.
|
20
|
+
#
|
21
|
+
# $ ruby demo_fasta_remote.rb file.fst
|
22
|
+
#
|
23
|
+
# Example usage using test data:
|
24
|
+
#
|
25
|
+
# $ ruby -Ilib sample/demo_fasta_remote.rb test/data/blast/b0002.faa
|
26
|
+
#
|
27
|
+
# Note that it may take very long time. Please wait for 3 to 5 minutes.
|
28
|
+
#
|
29
|
+
# == Development information
|
30
|
+
#
|
31
|
+
# The code was moved from lib/bio/appl/fasta.rb.
|
32
|
+
#
|
33
|
+
|
34
|
+
require 'bio'
|
35
|
+
|
36
|
+
#if __FILE__ == $0
|
37
|
+
begin
|
38
|
+
require 'pp'
|
39
|
+
alias p pp
|
40
|
+
rescue
|
41
|
+
end
|
42
|
+
|
43
|
+
# serv = Bio::Fasta.local('fasta34', 'hoge.nuc')
|
44
|
+
# serv = Bio::Fasta.local('fasta34', 'hoge.pep')
|
45
|
+
# serv = Bio::Fasta.local('ssearch34', 'hoge.pep')
|
46
|
+
|
47
|
+
# This may take 3 minutes or so.
|
48
|
+
serv = Bio::Fasta.remote('fasta', 'genes')
|
49
|
+
p serv.query(ARGF.read)
|
50
|
+
#end
|
51
|
+
|
@@ -0,0 +1,105 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_fastaformat.rb - demonstration of the FASTA format parser
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2001, 2002
|
5
|
+
# Naohisa Goto <ng@bioruby.org>,
|
6
|
+
# Toshiaki Katayama <k@bioruby.org>
|
7
|
+
# License:: The Ruby License
|
8
|
+
#
|
9
|
+
# $Id:$
|
10
|
+
#
|
11
|
+
# == Description
|
12
|
+
#
|
13
|
+
# Demonstration of FASTA format parser.
|
14
|
+
#
|
15
|
+
# == Usage
|
16
|
+
#
|
17
|
+
# Simply run the script.
|
18
|
+
#
|
19
|
+
# $ ruby demo_fastaformat.rb
|
20
|
+
#
|
21
|
+
# == Development information
|
22
|
+
#
|
23
|
+
# The code was moved from lib/bio/db/fasta.rb.
|
24
|
+
#
|
25
|
+
|
26
|
+
require 'bio'
|
27
|
+
|
28
|
+
f_str = <<END
|
29
|
+
>sce:YBR160W CDC28, SRM5; cyclin-dependent protein kinase catalytic subunit [EC:2.7.1.-] [SP:CC28_YEAST]
|
30
|
+
MSGELANYKRLEKVGEGTYGVVYKALDLRPGQGQRVVALKKIRLESEDEG
|
31
|
+
VPSTAIREISLLKELKDDNIVRLYDIVHSDAHKLYLVFEFLDLDLKRYME
|
32
|
+
GIPKDQPLGADIVKKFMMQLCKGIAYCHSHRILHRDLKPQNLLINKDGNL
|
33
|
+
KLGDFGLARAFGVPLRAYTHEIVTLWYRAPEVLLGGKQYSTGVDTWSIGC
|
34
|
+
IFAEMCNRKPIFSGDSEIDQIFKIFRVLGTPNEAIWPDIVYLPDFKPSFP
|
35
|
+
QWRRKDLSQVVPSLDPRGIDLLDKLLAYDPINRISARRAAIHPYFQES
|
36
|
+
>sce:YBR274W CHK1; probable serine/threonine-protein kinase [EC:2.7.1.-] [SP:KB9S_YEAST]
|
37
|
+
MSLSQVSPLPHIKDVVLGDTVGQGAFACVKNAHLQMDPSIILAVKFIHVP
|
38
|
+
TCKKMGLSDKDITKEVVLQSKCSKHPNVLRLIDCNVSKEYMWIILEMADG
|
39
|
+
GDLFDKIEPDVGVDSDVAQFYFQQLVSAINYLHVECGVAHRDIKPENILL
|
40
|
+
DKNGNLKLADFGLASQFRRKDGTLRVSMDQRGSPPYMAPEVLYSEEGYYA
|
41
|
+
DRTDIWSIGILLFVLLTGQTPWELPSLENEDFVFFIENDGNLNWGPWSKI
|
42
|
+
EFTHLNLLRKILQPDPNKRVTLKALKLHPWVLRRASFSGDDGLCNDPELL
|
43
|
+
AKKLFSHLKVSLSNENYLKFTQDTNSNNRYISTQPIGNELAELEHDSMHF
|
44
|
+
QTVSNTQRAFTSYDSNTNYNSGTGMTQEAKWTQFISYDIAALQFHSDEND
|
45
|
+
CNELVKRHLQFNPNKLTKFYTLQPMDVLLPILEKALNLSQIRVKPDLFAN
|
46
|
+
FERLCELLGYDNVFPLIINIKTKSNGGYQLCGSISIIKIEEELKSVGFER
|
47
|
+
KTGDPLEWRRLFKKISTICRDIILIPN
|
48
|
+
END
|
49
|
+
|
50
|
+
f = Bio::FastaFormat.new(f_str)
|
51
|
+
puts "### FastaFormat"
|
52
|
+
puts "# entry"
|
53
|
+
puts f.entry
|
54
|
+
puts "# entry_id"
|
55
|
+
p f.entry_id
|
56
|
+
puts "# definition"
|
57
|
+
p f.definition
|
58
|
+
puts "# data"
|
59
|
+
p f.data
|
60
|
+
puts "# seq"
|
61
|
+
p f.seq
|
62
|
+
puts "# seq.type"
|
63
|
+
p f.seq.type
|
64
|
+
puts "# length"
|
65
|
+
p f.length
|
66
|
+
puts "# aaseq"
|
67
|
+
p f.aaseq
|
68
|
+
puts "# aaseq.type"
|
69
|
+
p f.aaseq.type
|
70
|
+
puts "# aaseq.composition"
|
71
|
+
p f.aaseq.composition
|
72
|
+
puts "# aalen"
|
73
|
+
p f.aalen
|
74
|
+
|
75
|
+
puts
|
76
|
+
|
77
|
+
n_str = <<END
|
78
|
+
>CRA3575282.F
|
79
|
+
24 15 23 29 20 13 20 21 21 23 22 25 13 22 17 15 25 27 32 26
|
80
|
+
32 29 29 25
|
81
|
+
END
|
82
|
+
|
83
|
+
n = Bio::FastaNumericFormat.new(n_str)
|
84
|
+
puts "### FastaNumericFormat"
|
85
|
+
puts "# entry"
|
86
|
+
puts n.entry
|
87
|
+
puts "# entry_id"
|
88
|
+
p n.entry_id
|
89
|
+
puts "# definition"
|
90
|
+
p n.definition
|
91
|
+
puts "# data"
|
92
|
+
p n.data
|
93
|
+
puts "# length"
|
94
|
+
p n.length
|
95
|
+
#puts "# percent to ratio by yield"
|
96
|
+
#n.each do |x|
|
97
|
+
# p x/100.0
|
98
|
+
#end
|
99
|
+
puts "# first three"
|
100
|
+
p n[0]
|
101
|
+
p n[1]
|
102
|
+
p n[2]
|
103
|
+
puts "# last one"
|
104
|
+
p n[-1]
|
105
|
+
|
@@ -0,0 +1,132 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_genbank.rb - demonstration of Bio::GenBank
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2000-2005 Toshiaki Katayama <k@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
#
|
8
|
+
# == Description
|
9
|
+
#
|
10
|
+
# Demonstration of Bio::GenBank, the parser class for the GenBank entry.
|
11
|
+
#
|
12
|
+
# == Usage
|
13
|
+
#
|
14
|
+
# Usage 1: Without arguments, showing demo with a GenBank entry.
|
15
|
+
# Internet connection is needed.
|
16
|
+
#
|
17
|
+
# $ ruby demo_genbank.rb
|
18
|
+
#
|
19
|
+
# Usage 2: IDs or accession numbers are given as the arguments.
|
20
|
+
# Internet connection is needed.
|
21
|
+
#
|
22
|
+
# $ ruby demo_genbank.rb X94434 NM_000669
|
23
|
+
#
|
24
|
+
# Usage 3: When the first argument is "--files", "-files", "--file", or
|
25
|
+
# "-file", filenames are given as the arguments.
|
26
|
+
#
|
27
|
+
# $ ruby demo_genbank.rb --files file1.gbk file2.gbk ...
|
28
|
+
#
|
29
|
+
# == Development information
|
30
|
+
#
|
31
|
+
# The code was moved from lib/bio/db/genbank/genbank.rb, and modified
|
32
|
+
# as below:
|
33
|
+
# * To get sequences from the NCBI web service.
|
34
|
+
# * By default, arguments are sequence IDs (accession numbers).
|
35
|
+
# * New option "--files" (or "-files", "--file", or "-file") to
|
36
|
+
# read sequences from file(s).
|
37
|
+
#
|
38
|
+
|
39
|
+
require 'bio'
|
40
|
+
|
41
|
+
begin
|
42
|
+
require 'pp'
|
43
|
+
alias p pp
|
44
|
+
rescue LoadError
|
45
|
+
end
|
46
|
+
|
47
|
+
def demo_genbank(gb)
|
48
|
+
|
49
|
+
puts "### GenBank"
|
50
|
+
puts "## LOCUS"
|
51
|
+
puts "# GenBank.locus"
|
52
|
+
p gb.locus
|
53
|
+
puts "# GenBank.entry_id"
|
54
|
+
p gb.entry_id
|
55
|
+
puts "# GenBank.nalen"
|
56
|
+
p gb.nalen
|
57
|
+
puts "# GenBank.strand"
|
58
|
+
p gb.strand
|
59
|
+
puts "# GenBank.natype"
|
60
|
+
p gb.natype
|
61
|
+
puts "# GenBank.circular"
|
62
|
+
p gb.circular
|
63
|
+
puts "# GenBank.division"
|
64
|
+
p gb.division
|
65
|
+
puts "# GenBank.date"
|
66
|
+
p gb.date
|
67
|
+
|
68
|
+
puts "## DEFINITION"
|
69
|
+
p gb.definition
|
70
|
+
|
71
|
+
puts "## ACCESSION"
|
72
|
+
p gb.accession
|
73
|
+
|
74
|
+
puts "## VERSION"
|
75
|
+
p gb.versions
|
76
|
+
p gb.version
|
77
|
+
p gb.gi
|
78
|
+
|
79
|
+
puts "## NID"
|
80
|
+
p gb.nid
|
81
|
+
|
82
|
+
puts "## KEYWORDS"
|
83
|
+
p gb.keywords
|
84
|
+
|
85
|
+
puts "## SEGMENT"
|
86
|
+
p gb.segment
|
87
|
+
|
88
|
+
puts "## SOURCE"
|
89
|
+
p gb.source
|
90
|
+
p gb.common_name
|
91
|
+
p gb.vernacular_name
|
92
|
+
p gb.organism
|
93
|
+
p gb.taxonomy
|
94
|
+
|
95
|
+
puts "## REFERENCE"
|
96
|
+
p gb.references
|
97
|
+
|
98
|
+
puts "## COMMENT"
|
99
|
+
p gb.comment
|
100
|
+
|
101
|
+
puts "## FEATURES"
|
102
|
+
p gb.features
|
103
|
+
|
104
|
+
puts "## BASE COUNT"
|
105
|
+
p gb.basecount
|
106
|
+
p gb.basecount('a')
|
107
|
+
p gb.basecount('A')
|
108
|
+
|
109
|
+
puts "## ORIGIN"
|
110
|
+
p gb.origin
|
111
|
+
p gb.naseq
|
112
|
+
|
113
|
+
puts "=" * 78
|
114
|
+
end
|
115
|
+
|
116
|
+
case ARGV[0]
|
117
|
+
when '-file', '--file', '-files', '--files'
|
118
|
+
ARGV.shift
|
119
|
+
ARGV.each do |filename|
|
120
|
+
Bio::FlatFile.foreach(filename) do |gb|
|
121
|
+
demo_genbank(gb)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
else
|
125
|
+
efetch = Bio::NCBI::REST::EFetch.new
|
126
|
+
argv = ARGV.empty? ? [ 'X94434' ] : ARGV
|
127
|
+
argv.each do |id_or_accession|
|
128
|
+
raw = efetch.sequence(id_or_accession)
|
129
|
+
gb = Bio::GenBank.new(raw)
|
130
|
+
demo_genbank(gb)
|
131
|
+
end
|
132
|
+
end
|