Sha256: 9904524d8f999ef83de1568d72809c1999cece53397c655ef8776a78a38eafa9

Contents?: true

Size: 1.24 KB

Versions: 33

Compression:

Stored size: 1.24 KB

Contents

#
# bio/util/color_scheme/buried.rb - Color codings for buried amino acids
#
# Author::    Trevor Wennblom  <mailto:trevor@corevx.com>
# Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com)
# License::   The Ruby License
#
#  $Id: buried.rb,v 1.4 2007/04/05 23:35:41 trevor Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Buried < Score #:nodoc:

    #########
    protected
    #########

    def self.score_to_rgb_hex(score, min, max)
      percent = score_to_percent(score, min, max)
      rgb_percent_to_hex(0.0, 1.0-percent, percent)
    end

    @colors = {}
    @scores = {
      'A' => 0.66,
      'C' => 1.19,
      'D' => 1.46,
      'E' => 0.74,
      'F' => 0.6,
      'G' => 1.56,
      'H' => 0.95,
      'I' => 0.47,
      'K' => 1.01,
      'L' => 0.59,
      'M' => 0.6,
      'N' => 1.56,
      'P' => 1.52,
      'Q' => 0.98,
      'R' => 0.95,
      'S' => 1.43,
      'T' => 0.96,
      'U' => 0,
      'V' => 0.5,
      'W' => 0.96,
      'Y' => 1.14,

      'B' => 1.51,
      'X' => 1.0,
      'Z' => 0.86,
    }
    @min = 0.05
    @max = 4.6
    @scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
    @colors.default = 'FFFFFF'  # return white by default

  end
end

Version data entries

33 entries across 33 versions & 5 rubygems

Version Path
bio-2.0.5 lib/bio/util/color_scheme/buried.rb
bio-2.0.4 lib/bio/util/color_scheme/buried.rb
bio-2.0.3 lib/bio/util/color_scheme/buried.rb
bio-2.0.2 lib/bio/util/color_scheme/buried.rb
bio-2.0.1 lib/bio/util/color_scheme/buried.rb
bio-2.0.0 lib/bio/util/color_scheme/buried.rb
bio-1.6.0.pre.20181210 lib/bio/util/color_scheme/buried.rb
bio-1.5.2 lib/bio/util/color_scheme/buried.rb
bio-1.5.1 lib/bio/util/color_scheme/buried.rb
bio-1.5.0 lib/bio/util/color_scheme/buried.rb
bioruby-bio-1.2.9.9001 lib/bio/util/color_scheme/buried.rb
bioruby-bio-1.2.9.9501 lib/bio/util/color_scheme/buried.rb
bioruby-bio-1.3.0.5000 lib/bio/util/color_scheme/buried.rb
bioruby-bio-1.3.0.9901 lib/bio/util/color_scheme/buried.rb
bioruby-bio-1.3.0 lib/bio/util/color_scheme/buried.rb
bioruby-bio-1.3.1.5000 lib/bio/util/color_scheme/buried.rb
jandot-bio-1.2.1 lib/bio/util/color_scheme/buried.rb
ngoto-bio-1.2.9.9001 lib/bio/util/color_scheme/buried.rb
ngoto-bio-1.2.9.9501 lib/bio/util/color_scheme/buried.rb
ngoto-bio-1.3.0.5000 lib/bio/util/color_scheme/buried.rb