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
data/lib/bio/tree.rb
CHANGED
@@ -261,9 +261,22 @@ module Bio
|
|
261
261
|
@pathway = Bio::Pathway.new([], true)
|
262
262
|
@root = nil
|
263
263
|
@options = {}
|
264
|
+
_init_cache
|
264
265
|
self.concat(tree) if tree
|
265
266
|
end
|
266
267
|
|
268
|
+
# (private) clear internal cache
|
269
|
+
def _init_cache
|
270
|
+
@cache_parent = {}
|
271
|
+
end
|
272
|
+
private :_init_cache
|
273
|
+
|
274
|
+
# (private) clear internal cache
|
275
|
+
def _clear_cache
|
276
|
+
@cache_parent.clear
|
277
|
+
end
|
278
|
+
private :_clear_cache
|
279
|
+
|
267
280
|
# root node of this tree
|
268
281
|
# (even if unrooted tree, it is used by some methods)
|
269
282
|
attr_accessor :root
|
@@ -366,6 +379,7 @@ module Bio
|
|
366
379
|
# Returns the newly added edge.
|
367
380
|
# If the edge already exists, it is overwritten with new one.
|
368
381
|
def add_edge(source, target, edge = Edge.new)
|
382
|
+
_clear_cache
|
369
383
|
@pathway.append(Bio::Relation.new(source, target, edge))
|
370
384
|
edge
|
371
385
|
end
|
@@ -387,6 +401,7 @@ module Bio
|
|
387
401
|
# Returns self.
|
388
402
|
# If the node already exists, it does nothing.
|
389
403
|
def add_node(node)
|
404
|
+
_clear_cache
|
390
405
|
@pathway.graph[node] ||= {}
|
391
406
|
self
|
392
407
|
end
|
@@ -404,6 +419,7 @@ module Bio
|
|
404
419
|
unless self.include?(node)
|
405
420
|
raise IndexError, 'the node does not exist'
|
406
421
|
end
|
422
|
+
_clear_cache
|
407
423
|
@pathway.relations.delete_if do |rel|
|
408
424
|
rel.node.include?(node)
|
409
425
|
end
|
@@ -419,6 +435,7 @@ module Bio
|
|
419
435
|
# Returns self.
|
420
436
|
# If the node does not exist, raises IndexError.
|
421
437
|
def remove_node(node)
|
438
|
+
#_clear_cache #done in clear_node(node)
|
422
439
|
self.clear_node(node)
|
423
440
|
@pathway.graph.delete(node)
|
424
441
|
self
|
@@ -428,6 +445,7 @@ module Bio
|
|
428
445
|
# All edges connected with the removed nodes are also removed.
|
429
446
|
# Returns self.
|
430
447
|
def remove_node_if
|
448
|
+
#_clear_cache #done in clear_node(node)
|
431
449
|
all = self.nodes
|
432
450
|
all.each do |node|
|
433
451
|
if yield node then
|
@@ -449,6 +467,7 @@ module Bio
|
|
449
467
|
unless self.get_edge(source, target) then
|
450
468
|
raise IndexError, 'edge not found'
|
451
469
|
end
|
470
|
+
_clear_cache
|
452
471
|
fwd = [ source, target ]
|
453
472
|
rev = [ target, source ]
|
454
473
|
@pathway.relations.delete_if do |rel|
|
@@ -464,6 +483,7 @@ module Bio
|
|
464
483
|
# Removes each edge if the block returns not nil.
|
465
484
|
# Returns self.
|
466
485
|
def remove_edge_if #:yields: source, target, edge
|
486
|
+
_clear_cache
|
467
487
|
removed_rel = []
|
468
488
|
@pathway.relations.delete_if do |rel|
|
469
489
|
if yield rel.node[0], rel.node[1], edge then
|
@@ -485,6 +505,7 @@ module Bio
|
|
485
505
|
# Replaces each node by each block's return value.
|
486
506
|
# Returns self.
|
487
507
|
def collect_node! #:yields: node
|
508
|
+
_clear_cache
|
488
509
|
tr = {}
|
489
510
|
self.each_node do |node|
|
490
511
|
tr[node] = yield node
|
@@ -505,6 +526,7 @@ module Bio
|
|
505
526
|
# Replaces each edge by each block's return value.
|
506
527
|
# Returns self.
|
507
528
|
def collect_edge! #:yields: source, target, edge
|
529
|
+
_clear_cache
|
508
530
|
@pathway.relations.each do |rel|
|
509
531
|
newedge = yield rel.node[0], rel.node[1], rel.relation
|
510
532
|
rel.relation = newedge
|
@@ -573,6 +595,7 @@ module Bio
|
|
573
595
|
# shared in the concatinated tree.
|
574
596
|
def concat(other)
|
575
597
|
#raise TypeError unless other.kind_of?(self.class)
|
598
|
+
_clear_cache
|
576
599
|
other.each_node do |node|
|
577
600
|
self.add_node(node)
|
578
601
|
end
|
@@ -591,6 +614,7 @@ module Bio
|
|
591
614
|
raise IndexError, 'node1 not found' unless @pathway.graph[node1]
|
592
615
|
raise IndexError, 'node2 not found' unless @pathway.graph[node2]
|
593
616
|
return [ node1 ] if node1 == node2
|
617
|
+
return [ node1, node2 ] if @pathway.graph[node1][node2]
|
594
618
|
step, path = @pathway.bfs_shortest_path(node1, node2)
|
595
619
|
unless path[0] == node1 and path[-1] == node2 then
|
596
620
|
raise NoPathError, 'node1 and node2 are not connected'
|
@@ -622,13 +646,53 @@ module Bio
|
|
622
646
|
distance
|
623
647
|
end
|
624
648
|
|
649
|
+
# (private) get parent only by using cache
|
650
|
+
def _get_cached_parent(node, root)
|
651
|
+
@cache_parent[root] ||= Hash.new
|
652
|
+
cache = @cache_parent[root]
|
653
|
+
if node == root then
|
654
|
+
unless cache.has_key?(root) then
|
655
|
+
self.adjacent_nodes(root).each do |n|
|
656
|
+
cache[n] ||= root if n != root
|
657
|
+
end
|
658
|
+
cache[root] = nil
|
659
|
+
end
|
660
|
+
parent = nil
|
661
|
+
else
|
662
|
+
unless parent = cache[node] then
|
663
|
+
parent = self.adjacent_nodes(node).find { |n|
|
664
|
+
(m = cache[n]) && (m != node)
|
665
|
+
}
|
666
|
+
_cache_parent(node, parent, root) if parent
|
667
|
+
end
|
668
|
+
parent
|
669
|
+
end
|
670
|
+
end
|
671
|
+
private :_get_cached_parent
|
672
|
+
|
673
|
+
# (private) set parent cache
|
674
|
+
def _cache_parent(node, parent, root)
|
675
|
+
return unless parent
|
676
|
+
cache = @cache_parent[root]
|
677
|
+
cache[node] = parent
|
678
|
+
self.adjacent_nodes(node).each do |n|
|
679
|
+
cache[n] ||= node if n != parent
|
680
|
+
end
|
681
|
+
end
|
682
|
+
private :_cache_parent
|
683
|
+
|
625
684
|
# Gets the parent node of the _node_.
|
626
685
|
# If _root_ isn't specified or _root_ is <code>nil</code>, @root is used.
|
627
686
|
# Returns an <code>Node</code> object or nil.
|
628
687
|
# The result is unspecified for cyclic trees.
|
629
688
|
def parent(node, root = nil)
|
630
689
|
root ||= @root
|
631
|
-
|
690
|
+
raise IndexError, 'can not get parent for unrooted tree' unless root
|
691
|
+
unless ret = _get_cached_parent(node, root) then
|
692
|
+
ret = self.path(root, node)[-2]
|
693
|
+
_cache_parent(node, ret, root)
|
694
|
+
end
|
695
|
+
ret
|
632
696
|
end
|
633
697
|
|
634
698
|
# Gets the adjacent children nodes of the _node_.
|
@@ -637,10 +701,9 @@ module Bio
|
|
637
701
|
# The result is unspecified for cyclic trees.
|
638
702
|
def children(node, root = nil)
|
639
703
|
root ||= @root
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
result
|
704
|
+
c = self.adjacent_nodes(node)
|
705
|
+
c.delete(self.parent(node, root))
|
706
|
+
c
|
644
707
|
end
|
645
708
|
|
646
709
|
# Gets all descendent nodes of the _node_.
|
@@ -788,6 +851,7 @@ module Bio
|
|
788
851
|
# Returns removed nodes.
|
789
852
|
# Note that orphan nodes are still kept unchanged.
|
790
853
|
def remove_nonsense_nodes
|
854
|
+
_clear_cache
|
791
855
|
hash = {}
|
792
856
|
self.each_node do |node|
|
793
857
|
hash[node] = true if @pathway.graph[node].size == 2
|
@@ -828,6 +892,7 @@ module Bio
|
|
828
892
|
unless edge = self.get_edge(node1, node2) then
|
829
893
|
raise IndexError, 'nodes not found or two nodes are not adjacent'
|
830
894
|
end
|
895
|
+
_clear_cache
|
831
896
|
new_edge = Edge.new(new_distance)
|
832
897
|
self.remove_edge(node1, node2)
|
833
898
|
self.add_edge(node1, new_node, new_edge)
|
@@ -68,8 +68,9 @@ class SingleStrand < Bio::Sequence::NA
|
|
68
68
|
# *Returns*:: nothing
|
69
69
|
def initialize( sequence, *c )
|
70
70
|
c.flatten! # if an array was supplied as an argument
|
71
|
-
|
72
|
-
sequence
|
71
|
+
# NOTE t| 2009-09-19 commented out for library efficiency
|
72
|
+
# validate_args(sequence, c)
|
73
|
+
sequence = sequence.downcase
|
73
74
|
|
74
75
|
if sequence =~ re_cut_symbol
|
75
76
|
@cut_locations_in_enzyme_notation = CutLocationsInEnzymeNotation.new( strip_padding(sequence) )
|
data/lib/bio/util/sirna.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Itoshi NIKAIDO <dritoshi@gmail.com>
|
6
6
|
# License:: The Ruby License
|
7
7
|
#
|
8
|
-
# $Id
|
8
|
+
# $Id:$
|
9
9
|
#
|
10
10
|
# == Bio::SiRNA - Designing siRNA.
|
11
11
|
#
|
@@ -250,28 +250,6 @@ module Bio
|
|
250
250
|
|
251
251
|
end # module Bio
|
252
252
|
|
253
|
-
|
254
|
-
if __FILE__ == $0
|
255
|
-
|
256
|
-
seq = Bio::Sequence::NA.new(ARGF.read)
|
257
|
-
|
258
|
-
sirna = Bio::SiRNA.new(seq)
|
259
|
-
pairs = sirna.design # or .design('uitei') or .uitei or .reynolds
|
260
|
-
|
261
|
-
pairs.each do |pair|
|
262
|
-
puts pair.report
|
263
|
-
|
264
|
-
shrna = Bio::SiRNA::ShRNA.new(pair)
|
265
|
-
shrna.design # or .design('BLOCK-iT') or .block_it
|
266
|
-
puts shrna.report
|
267
|
-
|
268
|
-
puts "# as DNA"
|
269
|
-
puts shrna.top_strand.dna
|
270
|
-
puts shrna.bottom_strand.dna
|
271
|
-
end
|
272
|
-
|
273
|
-
end
|
274
|
-
|
275
253
|
=begin
|
276
254
|
|
277
255
|
= ChangeLog
|
data/lib/bio/version.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
module Bio
|
11
11
|
|
12
12
|
# BioRuby version (Array containing Integer)
|
13
|
-
BIORUBY_VERSION = [1,
|
13
|
+
BIORUBY_VERSION = [1, 4, 0].extend(Comparable).freeze
|
14
14
|
|
15
15
|
# Extra version specifier (String or nil).
|
16
16
|
# Existance of the value indicates pre-release version or modified version.
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_aaindex.rb - demonstration of Bio::AAindex1 and AAindex2
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2001
|
5
|
+
# KAWASHIMA Shuichi <s@bioruby.org>
|
6
|
+
# Copyright:: Copyright (C) 2006
|
7
|
+
# Mitsuteru C. Nakao <n@bioruby.org>
|
8
|
+
# License:: The Ruby License
|
9
|
+
#
|
10
|
+
#
|
11
|
+
# == Description
|
12
|
+
#
|
13
|
+
# Demonstration of Bio::AAindex1 and Bio::AAindex2.
|
14
|
+
#
|
15
|
+
# == Requirements
|
16
|
+
#
|
17
|
+
# Internet connection and/or OBDA (Open Bio Database Access) configuration.
|
18
|
+
#
|
19
|
+
# == Usage
|
20
|
+
#
|
21
|
+
# Simply run this script.
|
22
|
+
#
|
23
|
+
# $ ruby demo_aaindex.rb
|
24
|
+
#
|
25
|
+
# == Development information
|
26
|
+
#
|
27
|
+
# The code was moved from lib/bio/db/aaindex.rb.
|
28
|
+
#
|
29
|
+
|
30
|
+
require 'bio'
|
31
|
+
|
32
|
+
#if __FILE__ == $0
|
33
|
+
|
34
|
+
puts "### AAindex1 (PRAM900102)"
|
35
|
+
aax1 = Bio::AAindex1.new(Bio::Fetch.query('aaindex', 'PRAM900102', 'raw'))
|
36
|
+
p aax1.entry_id
|
37
|
+
p aax1.definition
|
38
|
+
p aax1.dblinks
|
39
|
+
p aax1.author
|
40
|
+
p aax1.title
|
41
|
+
p aax1.journal
|
42
|
+
p aax1.comment
|
43
|
+
p aax1.correlation_coefficient
|
44
|
+
p aax1.index
|
45
|
+
p aax1
|
46
|
+
puts "### AAindex2 (DAYM780301)"
|
47
|
+
aax2 = Bio::AAindex2.new(Bio::Fetch.query('aaindex', 'DAYM780301', 'raw'))
|
48
|
+
p aax2.entry_id
|
49
|
+
p aax2.definition
|
50
|
+
p aax2.dblinks
|
51
|
+
p aax2.author
|
52
|
+
p aax2.title
|
53
|
+
p aax2.journal
|
54
|
+
p aax1.comment
|
55
|
+
p aax2.rows
|
56
|
+
p aax2.cols
|
57
|
+
p aax2.matrix
|
58
|
+
p aax2.matrix[2,2]
|
59
|
+
p aax2.matrix[2,3]
|
60
|
+
p aax2.matrix[4,3]
|
61
|
+
p aax2.matrix.determinant
|
62
|
+
p aax2.matrix.rank
|
63
|
+
p aax2.matrix.transpose
|
64
|
+
p aax2
|
65
|
+
|
66
|
+
#end
|
67
|
+
|
@@ -0,0 +1,101 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_aminoacid.rb - demonstration of Bio::AminoAcid
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2001, 2005
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License:: The Ruby License
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# == Description
|
10
|
+
#
|
11
|
+
# Demonstration of Bio::AminoAcid, the class for amino acid data.
|
12
|
+
#
|
13
|
+
# == Usage
|
14
|
+
#
|
15
|
+
# Simply run this script.
|
16
|
+
#
|
17
|
+
# $ ruby demo_aminoacid.rb
|
18
|
+
#
|
19
|
+
# == Development information
|
20
|
+
#
|
21
|
+
# The code was moved from lib/bio/data/aa.rb.
|
22
|
+
#
|
23
|
+
|
24
|
+
require 'bio'
|
25
|
+
|
26
|
+
#if __FILE__ == $0
|
27
|
+
|
28
|
+
puts "### aa = Bio::AminoAcid.new"
|
29
|
+
aa = Bio::AminoAcid.new
|
30
|
+
|
31
|
+
puts "# Bio::AminoAcid['A']"
|
32
|
+
p Bio::AminoAcid['A']
|
33
|
+
puts "# aa['A']"
|
34
|
+
p aa['A']
|
35
|
+
|
36
|
+
puts "# Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')"
|
37
|
+
p Bio::AminoAcid.name('A'), Bio::AminoAcid.name('Ala')
|
38
|
+
puts "# aa.name('A'), aa.name('Ala')"
|
39
|
+
p aa.name('A'), aa.name('Ala')
|
40
|
+
|
41
|
+
puts "# Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')"
|
42
|
+
p Bio::AminoAcid.to_1('alanine'), Bio::AminoAcid.one('alanine')
|
43
|
+
puts "# aa.to_1('alanine'), aa.one('alanine')"
|
44
|
+
p aa.to_1('alanine'), aa.one('alanine')
|
45
|
+
puts "# Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')"
|
46
|
+
p Bio::AminoAcid.to_1('Ala'), Bio::AminoAcid.one('Ala')
|
47
|
+
puts "# aa.to_1('Ala'), aa.one('Ala')"
|
48
|
+
p aa.to_1('Ala'), aa.one('Ala')
|
49
|
+
puts "# Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')"
|
50
|
+
p Bio::AminoAcid.to_1('A'), Bio::AminoAcid.one('A')
|
51
|
+
puts "# aa.to_1('A'), aa.one('A')"
|
52
|
+
p aa.to_1('A'), aa.one('A')
|
53
|
+
|
54
|
+
puts "# Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')"
|
55
|
+
p Bio::AminoAcid.to_3('alanine'), Bio::AminoAcid.three('alanine')
|
56
|
+
puts "# aa.to_3('alanine'), aa.three('alanine')"
|
57
|
+
p aa.to_3('alanine'), aa.three('alanine')
|
58
|
+
puts "# Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')"
|
59
|
+
p Bio::AminoAcid.to_3('Ala'), Bio::AminoAcid.three('Ala')
|
60
|
+
puts "# aa.to_3('Ala'), aa.three('Ala')"
|
61
|
+
p aa.to_3('Ala'), aa.three('Ala')
|
62
|
+
puts "# Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')"
|
63
|
+
p Bio::AminoAcid.to_3('A'), Bio::AminoAcid.three('A')
|
64
|
+
puts "# aa.to_3('A'), aa.three('A')"
|
65
|
+
p aa.to_3('A'), aa.three('A')
|
66
|
+
|
67
|
+
puts "# Bio::AminoAcid.one2three('A')"
|
68
|
+
p Bio::AminoAcid.one2three('A')
|
69
|
+
puts "# aa.one2three('A')"
|
70
|
+
p aa.one2three('A')
|
71
|
+
|
72
|
+
puts "# Bio::AminoAcid.three2one('Ala')"
|
73
|
+
p Bio::AminoAcid.three2one('Ala')
|
74
|
+
puts "# aa.three2one('Ala')"
|
75
|
+
p aa.three2one('Ala')
|
76
|
+
|
77
|
+
puts "# Bio::AminoAcid.one2name('A')"
|
78
|
+
p Bio::AminoAcid.one2name('A')
|
79
|
+
puts "# aa.one2name('A')"
|
80
|
+
p aa.one2name('A')
|
81
|
+
|
82
|
+
puts "# Bio::AminoAcid.name2one('alanine')"
|
83
|
+
p Bio::AminoAcid.name2one('alanine')
|
84
|
+
puts "# aa.name2one('alanine')"
|
85
|
+
p aa.name2one('alanine')
|
86
|
+
|
87
|
+
puts "# Bio::AminoAcid.three2name('Ala')"
|
88
|
+
p Bio::AminoAcid.three2name('Ala')
|
89
|
+
puts "# aa.three2name('Ala')"
|
90
|
+
p aa.three2name('Ala')
|
91
|
+
|
92
|
+
puts "# Bio::AminoAcid.name2three('alanine')"
|
93
|
+
p Bio::AminoAcid.name2three('alanine')
|
94
|
+
puts "# aa.name2three('alanine')"
|
95
|
+
p aa.name2three('alanine')
|
96
|
+
|
97
|
+
puts "# Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')"
|
98
|
+
p Bio::AminoAcid.to_re('BZACDEFGHIKLMNPQRSTVWYU')
|
99
|
+
|
100
|
+
#end
|
101
|
+
|
@@ -0,0 +1,220 @@
|
|
1
|
+
#
|
2
|
+
# = sample/demo_bl2seq_report.rb - demo of bl2seq (BLAST 2 sequences) parser
|
3
|
+
#
|
4
|
+
# Copyright:: Copyright (C) 2005 Naohisa Goto <ng@bioruby.org>
|
5
|
+
# License:: The Ruby License
|
6
|
+
#
|
7
|
+
# == Description
|
8
|
+
#
|
9
|
+
# Demonstration of Bio::Blast::Bl2seq::Report, bl2seq (BLAST 2 sequences)
|
10
|
+
# parser class.
|
11
|
+
#
|
12
|
+
# == Usage
|
13
|
+
#
|
14
|
+
# Run this script with specifying filename(s) containing bl2seq result(s).
|
15
|
+
#
|
16
|
+
# $ ruby demo_bl2seq_report.rb files...
|
17
|
+
#
|
18
|
+
# Example usage using test data:
|
19
|
+
#
|
20
|
+
# $ ruby -I lib sample/demo_bl2seq_report.rb test/data/bl2seq/cd8a_cd8b_blastp.bl2seq
|
21
|
+
#
|
22
|
+
# == Development information
|
23
|
+
#
|
24
|
+
# The code was moved from lib/bio/appl/bl2seq/report.rb
|
25
|
+
#
|
26
|
+
|
27
|
+
require 'bio'
|
28
|
+
|
29
|
+
if ARGV.empty? then
|
30
|
+
puts "Demonstration of bl2seq (BLAST 2 sequences) parser."
|
31
|
+
puts "Usage: #{$0} files..."
|
32
|
+
exit(0)
|
33
|
+
end
|
34
|
+
|
35
|
+
Bio::FlatFile.open(Bio::Blast::Bl2seq::Report, ARGF) do |ff|
|
36
|
+
ff.each do |rep|
|
37
|
+
|
38
|
+
print "# === Bio::Blast::Bl2seq::Report\n"
|
39
|
+
puts
|
40
|
+
#@#print " rep.program #=> "; p rep.program
|
41
|
+
#@#print " rep.version #=> "; p rep.version
|
42
|
+
#@#print " rep.reference #=> "; p rep.reference
|
43
|
+
#@#print " rep.db #=> "; p rep.db
|
44
|
+
#print " rep.query_id #=> "; p rep.query_id
|
45
|
+
print " rep.query_def #=> "; p rep.query_def
|
46
|
+
print " rep.query_len #=> "; p rep.query_len
|
47
|
+
#puts
|
48
|
+
#@#print " rep.version_number #=> "; p rep.version_number
|
49
|
+
#@#print " rep.version_date #=> "; p rep.version_date
|
50
|
+
puts
|
51
|
+
|
52
|
+
print "# === Parameters\n"
|
53
|
+
#puts
|
54
|
+
#print " rep.parameters #=> "; p rep.parameters
|
55
|
+
puts
|
56
|
+
print " rep.matrix #=> "; p rep.matrix
|
57
|
+
print " rep.expect #=> "; p rep.expect
|
58
|
+
#print " rep.inclusion #=> "; p rep.inclusion
|
59
|
+
print " rep.sc_match #=> "; p rep.sc_match
|
60
|
+
print " rep.sc_mismatch #=> "; p rep.sc_mismatch
|
61
|
+
print " rep.gap_open #=> "; p rep.gap_open
|
62
|
+
print " rep.gap_extend #=> "; p rep.gap_extend
|
63
|
+
#print " rep.filter #=> "; p rep.filter
|
64
|
+
#@#print " rep.pattern #=> "; p rep.pattern
|
65
|
+
#print " rep.entrez_query #=> "; p rep.entrez_query
|
66
|
+
#puts
|
67
|
+
#@#print " rep.pattern_positions #=> "; p rep.pattern_positions
|
68
|
+
puts
|
69
|
+
|
70
|
+
print "# === Statistics (last iteration's)\n"
|
71
|
+
#puts
|
72
|
+
#print " rep.statistics #=> "; p rep.statistics
|
73
|
+
puts
|
74
|
+
print " rep.db_num #=> "; p rep.db_num
|
75
|
+
print " rep.db_len #=> "; p rep.db_len
|
76
|
+
#print " rep.hsp_len #=> "; p rep.hsp_len
|
77
|
+
print " rep.eff_space #=> "; p rep.eff_space
|
78
|
+
print " rep.kappa #=> "; p rep.kappa
|
79
|
+
print " rep.lambda #=> "; p rep.lambda
|
80
|
+
print " rep.entropy #=> "; p rep.entropy
|
81
|
+
puts
|
82
|
+
print " rep.num_hits #=> "; p rep.num_hits
|
83
|
+
print " rep.gapped_kappa #=> "; p rep.gapped_kappa
|
84
|
+
print " rep.gapped_lambda #=> "; p rep.gapped_lambda
|
85
|
+
print " rep.gapped_entropy #=> "; p rep.gapped_entropy
|
86
|
+
print " rep.posted_date #=> "; p rep.posted_date
|
87
|
+
puts
|
88
|
+
|
89
|
+
#@#print "# === Message (last iteration's)\n"
|
90
|
+
#@#puts
|
91
|
+
#@#print " rep.message #=> "; p rep.message
|
92
|
+
#puts
|
93
|
+
#@#print " rep.converged? #=> "; p rep.converged?
|
94
|
+
#@#puts
|
95
|
+
|
96
|
+
print "# === Iterations\n"
|
97
|
+
puts
|
98
|
+
print " rep.itrerations.each do |itr|\n"
|
99
|
+
puts
|
100
|
+
|
101
|
+
rep.iterations.each do |itr|
|
102
|
+
|
103
|
+
print "# --- Bio::Blast::Bl2seq::Report::Iteration\n"
|
104
|
+
puts
|
105
|
+
|
106
|
+
print " itr.num #=> "; p itr.num
|
107
|
+
#print " itr.statistics #=> "; p itr.statistics
|
108
|
+
#@#print " itr.message #=> "; p itr.message
|
109
|
+
print " itr.hits.size #=> "; p itr.hits.size
|
110
|
+
#puts
|
111
|
+
#@#print " itr.hits_newly_found.size #=> "; p itr.hits_newly_found.size;
|
112
|
+
#@#print " itr.hits_found_again.size #=> "; p itr.hits_found_again.size;
|
113
|
+
#@#if itr.hits_for_pattern then
|
114
|
+
#@#itr.hits_for_pattern.each_with_index do |hp, hpi|
|
115
|
+
#@#print " itr.hits_for_pattern[#{hpi}].size #=> "; p hp.size;
|
116
|
+
#@#end
|
117
|
+
#@#end
|
118
|
+
#@#print " itr.converged? #=> "; p itr.converged?
|
119
|
+
puts
|
120
|
+
|
121
|
+
print " itr.hits.each do |hit|\n"
|
122
|
+
puts
|
123
|
+
|
124
|
+
itr.hits.each_with_index do |hit, i|
|
125
|
+
|
126
|
+
print "# --- Bio::Blast::Bl2seq::Default::Report::Hit"
|
127
|
+
print " ([#{i}])\n"
|
128
|
+
puts
|
129
|
+
|
130
|
+
#print " hit.num #=> "; p hit.num
|
131
|
+
#print " hit.hit_id #=> "; p hit.hit_id
|
132
|
+
print " hit.len #=> "; p hit.len
|
133
|
+
print " hit.definition #=> "; p hit.definition
|
134
|
+
#print " hit.accession #=> "; p hit.accession
|
135
|
+
#puts
|
136
|
+
print " hit.found_again? #=> "; p hit.found_again?
|
137
|
+
|
138
|
+
print " --- compatible/shortcut ---\n"
|
139
|
+
#print " hit.query_id #=> "; p hit.query_id
|
140
|
+
#print " hit.query_def #=> "; p hit.query_def
|
141
|
+
#print " hit.query_len #=> "; p hit.query_len
|
142
|
+
#print " hit.target_id #=> "; p hit.target_id
|
143
|
+
print " hit.target_def #=> "; p hit.target_def
|
144
|
+
print " hit.target_len #=> "; p hit.target_len
|
145
|
+
|
146
|
+
print " --- first HSP's values (shortcut) ---\n"
|
147
|
+
print " hit.evalue #=> "; p hit.evalue
|
148
|
+
print " hit.bit_score #=> "; p hit.bit_score
|
149
|
+
print " hit.identity #=> "; p hit.identity
|
150
|
+
#print " hit.overlap #=> "; p hit.overlap
|
151
|
+
|
152
|
+
print " hit.query_seq #=> "; p hit.query_seq
|
153
|
+
print " hit.midline #=> "; p hit.midline
|
154
|
+
print " hit.target_seq #=> "; p hit.target_seq
|
155
|
+
|
156
|
+
print " hit.query_start #=> "; p hit.query_start
|
157
|
+
print " hit.query_end #=> "; p hit.query_end
|
158
|
+
print " hit.target_start #=> "; p hit.target_start
|
159
|
+
print " hit.target_end #=> "; p hit.target_end
|
160
|
+
print " hit.lap_at #=> "; p hit.lap_at
|
161
|
+
print " --- first HSP's vaules (shortcut) ---\n"
|
162
|
+
print " --- compatible/shortcut ---\n"
|
163
|
+
|
164
|
+
puts
|
165
|
+
print " hit.hsps.size #=> "; p hit.hsps.size
|
166
|
+
if hit.hsps.size == 0 then
|
167
|
+
puts " (HSP not found: please see blastall's -b and -v options)"
|
168
|
+
puts
|
169
|
+
else
|
170
|
+
|
171
|
+
puts
|
172
|
+
print " hit.hsps.each do |hsp|\n"
|
173
|
+
puts
|
174
|
+
|
175
|
+
hit.hsps.each_with_index do |hsp, j|
|
176
|
+
|
177
|
+
print "# --- Bio::Blast::Default::Report::HSP (Bio::Blast::Bl2seq::Report::HSP)"
|
178
|
+
print " ([#{j}])\n"
|
179
|
+
puts
|
180
|
+
#print " hsp.num #=> "; p hsp.num
|
181
|
+
print " hsp.bit_score #=> "; p hsp.bit_score
|
182
|
+
print " hsp.score #=> "; p hsp.score
|
183
|
+
print " hsp.evalue #=> "; p hsp.evalue
|
184
|
+
print " hsp.identity #=> "; p hsp.identity
|
185
|
+
print " hsp.gaps #=> "; p hsp.gaps
|
186
|
+
print " hsp.positive #=> "; p hsp.positive
|
187
|
+
print " hsp.align_len #=> "; p hsp.align_len
|
188
|
+
#print " hsp.density #=> "; p hsp.density
|
189
|
+
|
190
|
+
print " hsp.query_frame #=> "; p hsp.query_frame
|
191
|
+
print " hsp.query_from #=> "; p hsp.query_from
|
192
|
+
print " hsp.query_to #=> "; p hsp.query_to
|
193
|
+
|
194
|
+
print " hsp.hit_frame #=> "; p hsp.hit_frame
|
195
|
+
print " hsp.hit_from #=> "; p hsp.hit_from
|
196
|
+
print " hsp.hit_to #=> "; p hsp.hit_to
|
197
|
+
|
198
|
+
#print " hsp.pattern_from#=> "; p hsp.pattern_from
|
199
|
+
#print " hsp.pattern_to #=> "; p hsp.pattern_to
|
200
|
+
|
201
|
+
print " hsp.qseq #=> "; p hsp.qseq
|
202
|
+
print " hsp.midline #=> "; p hsp.midline
|
203
|
+
print " hsp.hseq #=> "; p hsp.hseq
|
204
|
+
puts
|
205
|
+
print " hsp.percent_identity #=> "; p hsp.percent_identity
|
206
|
+
#print " hsp.mismatch_count #=> "; p hsp.mismatch_count
|
207
|
+
#
|
208
|
+
print " hsp.query_strand #=> "; p hsp.query_strand
|
209
|
+
print " hsp.hit_strand #=> "; p hsp.hit_strand
|
210
|
+
print " hsp.percent_positive #=> "; p hsp.percent_positive
|
211
|
+
print " hsp.percent_gaps #=> "; p hsp.percent_gaps
|
212
|
+
puts
|
213
|
+
|
214
|
+
end #each
|
215
|
+
end #if hit.hsps.size == 0
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end #ff.each
|
219
|
+
end #FlatFile.open
|
220
|
+
|