bio 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/bioruby +107 -0
- data/bin/br_biofetch.rb +59 -0
- data/bin/br_bioflat.rb +294 -0
- data/bin/br_biogetseq.rb +57 -0
- data/bin/br_pmfetch.rb +431 -0
- data/doc/BioRuby.rd.ja +225 -0
- data/doc/Changes-0.7.rd +236 -0
- data/doc/Design.rd.ja +341 -0
- data/doc/KEGG_API.rd +1437 -0
- data/doc/KEGG_API.rd.ja +1399 -0
- data/doc/TODO.rd.ja +138 -0
- data/doc/Tutorial.rd +1138 -0
- data/doc/Tutorial.rd.ja +2110 -0
- data/etc/bioinformatics/seqdatabase.ini +210 -0
- data/lib/bio.rb +256 -0
- data/lib/bio/alignment.rb +1906 -0
- data/lib/bio/appl/bl2seq/report.rb +350 -0
- data/lib/bio/appl/blast.rb +269 -0
- data/lib/bio/appl/blast/format0.rb +1402 -0
- data/lib/bio/appl/blast/format8.rb +95 -0
- data/lib/bio/appl/blast/report.rb +652 -0
- data/lib/bio/appl/blast/rexml.rb +151 -0
- data/lib/bio/appl/blast/wublast.rb +553 -0
- data/lib/bio/appl/blast/xmlparser.rb +222 -0
- data/lib/bio/appl/blat/report.rb +392 -0
- data/lib/bio/appl/clustalw.rb +191 -0
- data/lib/bio/appl/clustalw/report.rb +154 -0
- data/lib/bio/appl/emboss.rb +68 -0
- data/lib/bio/appl/fasta.rb +262 -0
- data/lib/bio/appl/fasta/format10.rb +428 -0
- data/lib/bio/appl/fasta/format6.rb +37 -0
- data/lib/bio/appl/genscan/report.rb +570 -0
- data/lib/bio/appl/hmmer.rb +129 -0
- data/lib/bio/appl/hmmer/report.rb +556 -0
- data/lib/bio/appl/mafft.rb +222 -0
- data/lib/bio/appl/mafft/report.rb +119 -0
- data/lib/bio/appl/psort.rb +555 -0
- data/lib/bio/appl/psort/report.rb +473 -0
- data/lib/bio/appl/sim4.rb +134 -0
- data/lib/bio/appl/sim4/report.rb +501 -0
- data/lib/bio/appl/sosui/report.rb +166 -0
- data/lib/bio/appl/spidey/report.rb +604 -0
- data/lib/bio/appl/targetp/report.rb +283 -0
- data/lib/bio/appl/tmhmm/report.rb +238 -0
- data/lib/bio/command.rb +166 -0
- data/lib/bio/data/aa.rb +354 -0
- data/lib/bio/data/codontable.rb +740 -0
- data/lib/bio/data/na.rb +226 -0
- data/lib/bio/db.rb +340 -0
- data/lib/bio/db/aaindex.rb +280 -0
- data/lib/bio/db/embl/common.rb +332 -0
- data/lib/bio/db/embl/embl.rb +446 -0
- data/lib/bio/db/embl/sptr.rb +954 -0
- data/lib/bio/db/embl/swissprot.rb +32 -0
- data/lib/bio/db/embl/trembl.rb +31 -0
- data/lib/bio/db/embl/uniprot.rb +32 -0
- data/lib/bio/db/fantom.rb +604 -0
- data/lib/bio/db/fasta.rb +869 -0
- data/lib/bio/db/genbank/common.rb +299 -0
- data/lib/bio/db/genbank/ddbj.rb +34 -0
- data/lib/bio/db/genbank/genbank.rb +354 -0
- data/lib/bio/db/genbank/genpept.rb +73 -0
- data/lib/bio/db/genbank/refseq.rb +31 -0
- data/lib/bio/db/gff.rb +106 -0
- data/lib/bio/db/go.rb +497 -0
- data/lib/bio/db/kegg/brite.rb +51 -0
- data/lib/bio/db/kegg/cell.rb +88 -0
- data/lib/bio/db/kegg/compound.rb +130 -0
- data/lib/bio/db/kegg/enzyme.rb +125 -0
- data/lib/bio/db/kegg/expression.rb +173 -0
- data/lib/bio/db/kegg/genes.rb +293 -0
- data/lib/bio/db/kegg/genome.rb +362 -0
- data/lib/bio/db/kegg/glycan.rb +213 -0
- data/lib/bio/db/kegg/keggtab.rb +418 -0
- data/lib/bio/db/kegg/kgml.rb +299 -0
- data/lib/bio/db/kegg/ko.rb +178 -0
- data/lib/bio/db/kegg/reaction.rb +97 -0
- data/lib/bio/db/litdb.rb +131 -0
- data/lib/bio/db/medline.rb +317 -0
- data/lib/bio/db/nbrf.rb +199 -0
- data/lib/bio/db/pdb.rb +38 -0
- data/lib/bio/db/pdb/atom.rb +60 -0
- data/lib/bio/db/pdb/chain.rb +117 -0
- data/lib/bio/db/pdb/model.rb +106 -0
- data/lib/bio/db/pdb/pdb.rb +1682 -0
- data/lib/bio/db/pdb/residue.rb +122 -0
- data/lib/bio/db/pdb/utils.rb +234 -0
- data/lib/bio/db/prosite.rb +616 -0
- data/lib/bio/db/rebase.rb +417 -0
- data/lib/bio/db/transfac.rb +387 -0
- data/lib/bio/feature.rb +201 -0
- data/lib/bio/io/brdb.rb +103 -0
- data/lib/bio/io/das.rb +471 -0
- data/lib/bio/io/dbget.rb +212 -0
- data/lib/bio/io/ddbjxml.rb +614 -0
- data/lib/bio/io/fastacmd.rb +123 -0
- data/lib/bio/io/fetch.rb +114 -0
- data/lib/bio/io/flatfile.rb +496 -0
- data/lib/bio/io/flatfile/bdb.rb +266 -0
- data/lib/bio/io/flatfile/index.rb +1308 -0
- data/lib/bio/io/flatfile/indexer.rb +778 -0
- data/lib/bio/io/higet.rb +92 -0
- data/lib/bio/io/keggapi.rb +863 -0
- data/lib/bio/io/pubmed.rb +189 -0
- data/lib/bio/io/registry.rb +308 -0
- data/lib/bio/io/soapwsdl.rb +114 -0
- data/lib/bio/io/sql.rb +428 -0
- data/lib/bio/location.rb +650 -0
- data/lib/bio/pathway.rb +991 -0
- data/lib/bio/reference.rb +308 -0
- data/lib/bio/sequence.rb +593 -0
- data/lib/bio/shell.rb +51 -0
- data/lib/bio/shell/core.rb +512 -0
- data/lib/bio/shell/plugin/codon.rb +228 -0
- data/lib/bio/shell/plugin/entry.rb +85 -0
- data/lib/bio/shell/plugin/flatfile.rb +119 -0
- data/lib/bio/shell/plugin/keggapi.rb +187 -0
- data/lib/bio/shell/plugin/midi.rb +448 -0
- data/lib/bio/shell/plugin/obda.rb +63 -0
- data/lib/bio/shell/plugin/seq.rb +238 -0
- data/lib/bio/shell/session.rb +214 -0
- data/lib/bio/util/color_scheme.rb +214 -0
- data/lib/bio/util/color_scheme/buried.rb +78 -0
- data/lib/bio/util/color_scheme/helix.rb +78 -0
- data/lib/bio/util/color_scheme/hydropathy.rb +83 -0
- data/lib/bio/util/color_scheme/nucleotide.rb +50 -0
- data/lib/bio/util/color_scheme/strand.rb +78 -0
- data/lib/bio/util/color_scheme/taylor.rb +69 -0
- data/lib/bio/util/color_scheme/turn.rb +78 -0
- data/lib/bio/util/color_scheme/zappo.rb +69 -0
- data/lib/bio/util/contingency_table.rb +337 -0
- data/lib/bio/util/sirna.rb +306 -0
- data/lib/bioruby.rb +34 -0
- data/sample/biofetch.rb +475 -0
- data/sample/color_scheme_na.rb +99 -0
- data/sample/dbget +37 -0
- data/sample/fasta2tab.rb +99 -0
- data/sample/fsplit.rb +51 -0
- data/sample/gb2fasta.rb +31 -0
- data/sample/gb2tab.rb +325 -0
- data/sample/gbtab2mysql.rb +161 -0
- data/sample/genes2nuc.rb +33 -0
- data/sample/genes2pep.rb +33 -0
- data/sample/genes2tab.rb +81 -0
- data/sample/genome2rb.rb +29 -0
- data/sample/genome2tab.rb +76 -0
- data/sample/goslim.rb +311 -0
- data/sample/gt2fasta.rb +47 -0
- data/sample/pmfetch.rb +42 -0
- data/sample/pmsearch.rb +42 -0
- data/sample/psortplot_html.rb +222 -0
- data/sample/ssearch2tab.rb +96 -0
- data/sample/tdiary.rb +158 -0
- data/sample/tfastx2tab.rb +100 -0
- data/sample/vs-genes.rb +212 -0
- data/test/data/SOSUI/sample.report +11 -0
- data/test/data/TMHMM/sample.report +21 -0
- data/test/data/blast/eco:b0002.faa +15 -0
- data/test/data/blast/eco:b0002.faa.m0 +128 -0
- data/test/data/blast/eco:b0002.faa.m7 +65 -0
- data/test/data/blast/eco:b0002.faa.m8 +1 -0
- data/test/data/embl/AB090716.embl +65 -0
- data/test/data/genscan/sample.report +63 -0
- data/test/data/prosite/prosite.dat +2233 -0
- data/test/data/refseq/nm_126355.entret +64 -0
- data/test/data/uniprot/p53_human.uniprot +1456 -0
- data/test/runner.rb +10 -0
- data/test/unit/bio/appl/blast/test_report.rb +427 -0
- data/test/unit/bio/appl/blast/test_xmlparser.rb +400 -0
- data/test/unit/bio/appl/genscan/test_report.rb +195 -0
- data/test/unit/bio/appl/sosui/test_report.rb +94 -0
- data/test/unit/bio/appl/targetp/test_report.rb +159 -0
- data/test/unit/bio/appl/test_blast.rb +159 -0
- data/test/unit/bio/appl/test_fasta.rb +142 -0
- data/test/unit/bio/appl/tmhmm/test_report.rb +139 -0
- data/test/unit/bio/data/test_aa.rb +103 -0
- data/test/unit/bio/data/test_codontable.rb +120 -0
- data/test/unit/bio/data/test_na.rb +89 -0
- data/test/unit/bio/db/embl/test_common.rb +130 -0
- data/test/unit/bio/db/embl/test_embl.rb +227 -0
- data/test/unit/bio/db/embl/test_sptr.rb +268 -0
- data/test/unit/bio/db/embl/test_uniprot.rb +44 -0
- data/test/unit/bio/db/kegg/test_genes.rb +58 -0
- data/test/unit/bio/db/test_fasta.rb +263 -0
- data/test/unit/bio/db/test_gff.rb +140 -0
- data/test/unit/bio/db/test_prosite.rb +1450 -0
- data/test/unit/bio/io/test_ddbjxml.rb +87 -0
- data/test/unit/bio/io/test_soapwsdl.rb +45 -0
- data/test/unit/bio/shell/plugin/test_seq.rb +175 -0
- data/test/unit/bio/test_alignment.rb +1028 -0
- data/test/unit/bio/test_command.rb +71 -0
- data/test/unit/bio/test_db.rb +109 -0
- data/test/unit/bio/test_feature.rb +128 -0
- data/test/unit/bio/test_location.rb +51 -0
- data/test/unit/bio/test_pathway.rb +485 -0
- data/test/unit/bio/test_sequence.rb +386 -0
- data/test/unit/bio/test_shell.rb +31 -0
- data/test/unit/bio/util/test_color_scheme.rb +45 -0
- data/test/unit/bio/util/test_contingency_table.rb +106 -0
- data/test/unit/bio/util/test_sirna.rb +258 -0
- metadata +295 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
module Bio
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# bio/util/color_scheme.rb - Popular color codings for nucleic and amino acids
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: Copyright (C) 2005 Trevor Wennblom <trevor@corevx.com>
|
|
7
|
+
# License:: LGPL
|
|
8
|
+
#
|
|
9
|
+
# $Id: color_scheme.rb,v 1.2 2005/12/13 14:58:07 trevor Exp $
|
|
10
|
+
#
|
|
11
|
+
#
|
|
12
|
+
#--
|
|
13
|
+
#
|
|
14
|
+
# This library is free software; you can redistribute it and/or
|
|
15
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
16
|
+
# License as published by the Free Software Foundation; either
|
|
17
|
+
# version 2 of the License, or (at your option) any later version.
|
|
18
|
+
#
|
|
19
|
+
# This library is distributed in the hope that it will be useful,
|
|
20
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
22
|
+
# Lesser General Public License for more details.
|
|
23
|
+
#
|
|
24
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
25
|
+
# License along with this library; if not, write to the Free Software
|
|
26
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
27
|
+
#
|
|
28
|
+
#++
|
|
29
|
+
#
|
|
30
|
+
#
|
|
31
|
+
|
|
32
|
+
=begin rdoc
|
|
33
|
+
bio/util/color_scheme.rb - Popular color codings for nucleic and amino acids
|
|
34
|
+
|
|
35
|
+
== Synopsis
|
|
36
|
+
|
|
37
|
+
The Bio::ColorScheme module contains classes that return popular color codings
|
|
38
|
+
for nucleic and amino acids in RGB hex format suitable for HTML code.
|
|
39
|
+
|
|
40
|
+
The current schemes supported are:
|
|
41
|
+
* Buried - Buried index
|
|
42
|
+
* Helix - Helix propensity
|
|
43
|
+
* Hydropathy - Hydrophobicity
|
|
44
|
+
* Nucleotide - Nucelotide color coding
|
|
45
|
+
* Strand - Strand propensity
|
|
46
|
+
* Taylor - Taylor color coding
|
|
47
|
+
* Turn - Turn propensity
|
|
48
|
+
* Zappo - Zappo color coding
|
|
49
|
+
|
|
50
|
+
Planned color schemes include:
|
|
51
|
+
* BLOSUM62
|
|
52
|
+
* ClustalX
|
|
53
|
+
* Percentage Identity (PID)
|
|
54
|
+
|
|
55
|
+
Color schemes BLOSUM62, ClustalX, and Percentage Identity are all dependent
|
|
56
|
+
on the alignment consensus.
|
|
57
|
+
|
|
58
|
+
This data is currently referenced from the JalView alignment editor.
|
|
59
|
+
Clamp, M., Cuff, J., Searle, S. M. and Barton, G. J. (2004),
|
|
60
|
+
"The Jalview Java Alignment Editor," Bioinformatics, 12, 426-7
|
|
61
|
+
http://www.jalview.org
|
|
62
|
+
|
|
63
|
+
Currently the score data for things such as hydropathy, helix, turn, etc. are contained
|
|
64
|
+
here but should be moved to bio/data/aa once a good reference is found for these
|
|
65
|
+
values.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
== Usage
|
|
69
|
+
|
|
70
|
+
require 'bio/util/color_scheme'
|
|
71
|
+
|
|
72
|
+
seq = 'gattaca'
|
|
73
|
+
scheme = Bio::ColorScheme::Zappo
|
|
74
|
+
postfix = '</span>'
|
|
75
|
+
html = ''
|
|
76
|
+
seq.each_byte do |c|
|
|
77
|
+
color = scheme[c.chr]
|
|
78
|
+
prefix = %Q(<span style="background:\##{color};">)
|
|
79
|
+
html += prefix + c.chr + postfix
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
puts html
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
=== Accessing colors
|
|
86
|
+
|
|
87
|
+
puts Bio::ColorScheme::Buried['A'] # 00DC22
|
|
88
|
+
puts Bio::ColorScheme::Buried[:c] # 00BF3F
|
|
89
|
+
puts Bio::ColorScheme::Buried[nil] # nil
|
|
90
|
+
puts Bio::ColorScheme::Buried['-'] # FFFFFF
|
|
91
|
+
puts Bio::ColorScheme::Buried[7] # FFFFFF
|
|
92
|
+
puts Bio::ColorScheme::Buried['junk'] # FFFFFF
|
|
93
|
+
puts Bio::ColorScheme::Buried['t'] # 00CC32
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
== Author
|
|
97
|
+
Trevor Wennblom <trevor@corevx.com>
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
== Copyright
|
|
101
|
+
Copyright (C) 2005 Trevor Wennblom
|
|
102
|
+
Licensed under the same terms as BioRuby.
|
|
103
|
+
|
|
104
|
+
=end
|
|
105
|
+
module ColorScheme
|
|
106
|
+
cs_location = 'bio/util/color_scheme'
|
|
107
|
+
|
|
108
|
+
# Score sub-classes
|
|
109
|
+
autoload :Buried, "#{cs_location}/buried"
|
|
110
|
+
autoload :Helix, "#{cs_location}/helix"
|
|
111
|
+
autoload :Hydropathy, "#{cs_location}/hydropathy"
|
|
112
|
+
autoload :Strand, "#{cs_location}/strand"
|
|
113
|
+
autoload :Turn, "#{cs_location}/turn"
|
|
114
|
+
|
|
115
|
+
# Simple sub-classes
|
|
116
|
+
autoload :Nucleotide, "#{cs_location}/nucleotide"
|
|
117
|
+
autoload :Taylor, "#{cs_location}/taylor"
|
|
118
|
+
autoload :Zappo, "#{cs_location}/zappo"
|
|
119
|
+
|
|
120
|
+
# Consensus sub-classes
|
|
121
|
+
# NOTE todo
|
|
122
|
+
# BLOSUM62
|
|
123
|
+
# ClustalX
|
|
124
|
+
# PID
|
|
125
|
+
|
|
126
|
+
# A very basic class template for color code referencing.
|
|
127
|
+
class Simple
|
|
128
|
+
def self.[](x)
|
|
129
|
+
return if x.nil?
|
|
130
|
+
# accept symbols and any case
|
|
131
|
+
@colors[x.to_s.upcase]
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def self.colors() @colors end
|
|
135
|
+
|
|
136
|
+
#######
|
|
137
|
+
private
|
|
138
|
+
#######
|
|
139
|
+
|
|
140
|
+
# Example
|
|
141
|
+
@colors = {
|
|
142
|
+
'A' => '64F73F',
|
|
143
|
+
}
|
|
144
|
+
@colors.default = 'FFFFFF' # return white by default
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# A class template for color code referencing of color schemes
|
|
149
|
+
# that are score based. This template is expected to change
|
|
150
|
+
# when the scores are moved into bio/data/aa
|
|
151
|
+
class Score
|
|
152
|
+
def self.[](x)
|
|
153
|
+
return if x.nil?
|
|
154
|
+
# accept symbols and any case
|
|
155
|
+
@colors[x.to_s.upcase]
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def self.min(x) @min end
|
|
159
|
+
def self.max(x) @max end
|
|
160
|
+
def self.scores() @scores end
|
|
161
|
+
def self.colors() @colors end
|
|
162
|
+
|
|
163
|
+
#########
|
|
164
|
+
protected
|
|
165
|
+
#########
|
|
166
|
+
|
|
167
|
+
def self.percent_to_hex(percent)
|
|
168
|
+
percent = percent.to_f if percent.is_a?(String)
|
|
169
|
+
if (percent > 1.0) or (percent < 0.0) or percent.nil?
|
|
170
|
+
raise 'Percentage must be between 0.0 and 1.0'
|
|
171
|
+
end
|
|
172
|
+
"%02X" % (percent * 255.0)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def self.rgb_percent_to_hex(red, green, blue)
|
|
176
|
+
percent_to_hex(red) + percent_to_hex(green) + percent_to_hex(blue)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def self.score_to_percent(score, min, max)
|
|
180
|
+
# .to_f to ensure every operation is float-aware
|
|
181
|
+
percent = (score.to_f - min) / (max.to_f - min)
|
|
182
|
+
percent = 1.0 if percent > 1.0
|
|
183
|
+
percent = 0.0 if percent < 0.0
|
|
184
|
+
percent
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
#######
|
|
188
|
+
private
|
|
189
|
+
#######
|
|
190
|
+
|
|
191
|
+
# Example
|
|
192
|
+
def self.score_to_rgb_hex(score, min, max)
|
|
193
|
+
percent = score_to_percent(score, min, max)
|
|
194
|
+
rgb_percent_to_hex(percent, 0.0, 1.0-percent)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
@colors = {}
|
|
198
|
+
@scores = {
|
|
199
|
+
'A' => 0.83,
|
|
200
|
+
}
|
|
201
|
+
@min = 0.37
|
|
202
|
+
@max = 1.7
|
|
203
|
+
@scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
|
|
204
|
+
@colors.default = 'FFFFFF' # return white by default
|
|
205
|
+
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
# NOTE todo
|
|
210
|
+
class Consensus
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
end # module ColorScheme
|
|
214
|
+
end # module Bio
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#
|
|
2
|
+
# bio/util/color_scheme/buried.rb - Color codings for buried amino acids
|
|
3
|
+
#
|
|
4
|
+
# Copyright:: Copyright (C) 2005 Trevor Wennblom <trevor@corevx.com>
|
|
5
|
+
# License:: LGPL
|
|
6
|
+
#
|
|
7
|
+
# $Id: buried.rb,v 1.2 2005/12/13 14:58:07 trevor Exp $
|
|
8
|
+
#
|
|
9
|
+
#
|
|
10
|
+
#--
|
|
11
|
+
#
|
|
12
|
+
# This library is free software; you can redistribute it and/or
|
|
13
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
+
# License as published by the Free Software Foundation; either
|
|
15
|
+
# version 2 of the License, or (at your option) any later version.
|
|
16
|
+
#
|
|
17
|
+
# This library is distributed in the hope that it will be useful,
|
|
18
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
+
# Lesser General Public License for more details.
|
|
21
|
+
#
|
|
22
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
+
# License along with this library; if not, write to the Free Software
|
|
24
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
+
#
|
|
26
|
+
#++
|
|
27
|
+
#
|
|
28
|
+
#
|
|
29
|
+
|
|
30
|
+
require 'bio/util/color_scheme'
|
|
31
|
+
|
|
32
|
+
module Bio::ColorScheme
|
|
33
|
+
class Buried < Score
|
|
34
|
+
|
|
35
|
+
#########
|
|
36
|
+
protected
|
|
37
|
+
#########
|
|
38
|
+
|
|
39
|
+
def self.score_to_rgb_hex(score, min, max)
|
|
40
|
+
percent = score_to_percent(score, min, max)
|
|
41
|
+
rgb_percent_to_hex(0.0, 1.0-percent, percent)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
@colors = {}
|
|
45
|
+
@scores = {
|
|
46
|
+
'A' => 0.66,
|
|
47
|
+
'C' => 1.19,
|
|
48
|
+
'D' => 1.46,
|
|
49
|
+
'E' => 0.74,
|
|
50
|
+
'F' => 0.6,
|
|
51
|
+
'G' => 1.56,
|
|
52
|
+
'H' => 0.95,
|
|
53
|
+
'I' => 0.47,
|
|
54
|
+
'K' => 1.01,
|
|
55
|
+
'L' => 0.59,
|
|
56
|
+
'M' => 0.6,
|
|
57
|
+
'N' => 1.56,
|
|
58
|
+
'P' => 1.52,
|
|
59
|
+
'Q' => 0.98,
|
|
60
|
+
'R' => 0.95,
|
|
61
|
+
'S' => 1.43,
|
|
62
|
+
'T' => 0.96,
|
|
63
|
+
'U' => 0,
|
|
64
|
+
'V' => 0.5,
|
|
65
|
+
'W' => 0.96,
|
|
66
|
+
'Y' => 1.14,
|
|
67
|
+
|
|
68
|
+
'B' => 1.51,
|
|
69
|
+
'X' => 1.0,
|
|
70
|
+
'Z' => 0.86,
|
|
71
|
+
}
|
|
72
|
+
@min = 0.05
|
|
73
|
+
@max = 4.6
|
|
74
|
+
@scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
|
|
75
|
+
@colors.default = 'FFFFFF' # return white by default
|
|
76
|
+
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#
|
|
2
|
+
# bio/util/color_scheme/helix.rb - Color codings for helix propensity
|
|
3
|
+
#
|
|
4
|
+
# Copyright:: Copyright (C) 2005 Trevor Wennblom <trevor@corevx.com>
|
|
5
|
+
# License:: LGPL
|
|
6
|
+
#
|
|
7
|
+
# $Id: helix.rb,v 1.2 2005/12/13 14:58:07 trevor Exp $
|
|
8
|
+
#
|
|
9
|
+
#
|
|
10
|
+
#--
|
|
11
|
+
#
|
|
12
|
+
# This library is free software; you can redistribute it and/or
|
|
13
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
+
# License as published by the Free Software Foundation; either
|
|
15
|
+
# version 2 of the License, or (at your option) any later version.
|
|
16
|
+
#
|
|
17
|
+
# This library is distributed in the hope that it will be useful,
|
|
18
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
+
# Lesser General Public License for more details.
|
|
21
|
+
#
|
|
22
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
+
# License along with this library; if not, write to the Free Software
|
|
24
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
+
#
|
|
26
|
+
#++
|
|
27
|
+
#
|
|
28
|
+
#
|
|
29
|
+
|
|
30
|
+
require 'bio/util/color_scheme'
|
|
31
|
+
|
|
32
|
+
module Bio::ColorScheme
|
|
33
|
+
class Helix < Score
|
|
34
|
+
|
|
35
|
+
#########
|
|
36
|
+
protected
|
|
37
|
+
#########
|
|
38
|
+
|
|
39
|
+
def self.score_to_rgb_hex(score, min, max)
|
|
40
|
+
percent = score_to_percent(score, min, max)
|
|
41
|
+
rgb_percent_to_hex(percent, 1.0-percent, percent)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
@colors = {}
|
|
45
|
+
@scores = {
|
|
46
|
+
'A' => 1.42,
|
|
47
|
+
'C' => 0.7,
|
|
48
|
+
'D' => 1.01,
|
|
49
|
+
'E' => 1.51,
|
|
50
|
+
'F' => 1.13,
|
|
51
|
+
'G' => 0.57,
|
|
52
|
+
'H' => 1.0,
|
|
53
|
+
'I' => 1.08,
|
|
54
|
+
'K' => 1.16,
|
|
55
|
+
'L' => 1.21,
|
|
56
|
+
'M' => 1.45,
|
|
57
|
+
'N' => 0.67,
|
|
58
|
+
'P' => 0.57,
|
|
59
|
+
'Q' => 1.11,
|
|
60
|
+
'R' => 0.98,
|
|
61
|
+
'S' => 0.77,
|
|
62
|
+
'T' => 0.83,
|
|
63
|
+
'U' => 0.0,
|
|
64
|
+
'V' => 1.06,
|
|
65
|
+
'W' => 1.08,
|
|
66
|
+
'Y' => 0.69,
|
|
67
|
+
|
|
68
|
+
'B' => 0.84,
|
|
69
|
+
'X' => 1.0,
|
|
70
|
+
'Z' => 1.31,
|
|
71
|
+
}
|
|
72
|
+
@min = 0.57
|
|
73
|
+
@max = 1.51
|
|
74
|
+
@scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
|
|
75
|
+
@colors.default = 'FFFFFF' # return white by default
|
|
76
|
+
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#
|
|
2
|
+
# bio/util/color_scheme/hydropathy.rb - Color codings for hydrophobicity
|
|
3
|
+
#
|
|
4
|
+
# Copyright:: Copyright (C) 2005 Trevor Wennblom <trevor@corevx.com>
|
|
5
|
+
# License:: LGPL
|
|
6
|
+
#
|
|
7
|
+
# $Id: hydropathy.rb,v 1.2 2005/12/13 14:58:07 trevor Exp $
|
|
8
|
+
#
|
|
9
|
+
#
|
|
10
|
+
#--
|
|
11
|
+
#
|
|
12
|
+
# This library is free software; you can redistribute it and/or
|
|
13
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
14
|
+
# License as published by the Free Software Foundation; either
|
|
15
|
+
# version 2 of the License, or (at your option) any later version.
|
|
16
|
+
#
|
|
17
|
+
# This library is distributed in the hope that it will be useful,
|
|
18
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20
|
+
# Lesser General Public License for more details.
|
|
21
|
+
#
|
|
22
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
23
|
+
# License along with this library; if not, write to the Free Software
|
|
24
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25
|
+
#
|
|
26
|
+
#++
|
|
27
|
+
#
|
|
28
|
+
#
|
|
29
|
+
|
|
30
|
+
require 'bio/util/color_scheme'
|
|
31
|
+
|
|
32
|
+
module Bio::ColorScheme
|
|
33
|
+
|
|
34
|
+
# Hydropathy index
|
|
35
|
+
# Kyte, J., and Doolittle, R.F., J. Mol. Biol.
|
|
36
|
+
# 1157, 105-132, 1982
|
|
37
|
+
|
|
38
|
+
class Hydropathy < Score
|
|
39
|
+
|
|
40
|
+
#########
|
|
41
|
+
protected
|
|
42
|
+
#########
|
|
43
|
+
|
|
44
|
+
def self.score_to_rgb_hex(score, min, max)
|
|
45
|
+
percent = score_to_percent(score, min, max)
|
|
46
|
+
rgb_percent_to_hex(percent, 0.0, 1.0-percent)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
@colors = {}
|
|
50
|
+
@scores = {
|
|
51
|
+
'A' => 1.8,
|
|
52
|
+
'C' => 2.5,
|
|
53
|
+
'D' => -3.5,
|
|
54
|
+
'E' => -3.5,
|
|
55
|
+
'F' => 2.8,
|
|
56
|
+
'G' => -0.4,
|
|
57
|
+
'H' => -3.2,
|
|
58
|
+
'I' => 4.5,
|
|
59
|
+
'K' => -3.9,
|
|
60
|
+
'L' => 3.8,
|
|
61
|
+
'M' => 1.9,
|
|
62
|
+
'N' => -3.5,
|
|
63
|
+
'P' => -1.6,
|
|
64
|
+
'Q' => -3.5,
|
|
65
|
+
'R' => -4.5,
|
|
66
|
+
'S' => -0.8,
|
|
67
|
+
'T' => -0.7,
|
|
68
|
+
'U' => 0.0,
|
|
69
|
+
'V' => 4.2,
|
|
70
|
+
'W' => -0.9,
|
|
71
|
+
'Y' => -1.3,
|
|
72
|
+
|
|
73
|
+
'B' => -3.5,
|
|
74
|
+
'X' => -0.49,
|
|
75
|
+
'Z' => -3.5,
|
|
76
|
+
}
|
|
77
|
+
@min = -3.9
|
|
78
|
+
@max = 4.5
|
|
79
|
+
@scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
|
|
80
|
+
@colors.default = 'FFFFFF' # return white by default
|
|
81
|
+
|
|
82
|
+
end
|
|
83
|
+
end
|