[BioRuby-cvs] bioruby/lib/bio/util/color_scheme buried.rb, NONE, 1.1 helix.rb, NONE, 1.1 hydropathy.rb, NONE, 1.1 nucleotide.rb, NONE, 1.1 strand.rb, NONE, 1.1 taylor.rb, NONE, 1.1 turn.rb, NONE, 1.1 zappo.rb, NONE, 1.1

Katayama Toshiaki k at pub.open-bio.org
Sun Oct 23 04:40:43 EDT 2005


Update of /home/repository/bioruby/bioruby/lib/bio/util/color_scheme
In directory pub.open-bio.org:/tmp/cvs-serv18484/lib/bio/util/color_scheme

Added Files:
	buried.rb helix.rb hydropathy.rb nucleotide.rb strand.rb 
	taylor.rb turn.rb zappo.rb 
Log Message:
* Newly added Bio::ColorScheme module contributed by
  Trevor Wennblom <trevor at corevx.com>


--- NEW FILE: helix.rb ---
#
# bio/util/color_scheme/helix.rb - Color codings for helix propensity
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: helix.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Helix < Score

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

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

    @colors = {}
    @scores = {
      'A' => 1.42,
      'C' => 0.7,
      'D' => 1.01,
      'E' => 1.51,
      'F' => 1.13,
      'G' => 0.57,
      'H' => 1.0,
      'I' => 1.08,
      'K' => 1.16,
      'L' => 1.21,
      'M' => 1.45,
      'N' => 0.67,
      'P' => 0.57,
      'Q' => 1.11,
      'R' => 0.98,
      'S' => 0.77,
      'T' => 0.83,
      'U' => 0.0,
      'V' => 1.06,
      'W' => 1.08,
      'Y' => 0.69,

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

  end
end

--- NEW FILE: strand.rb ---
#
# bio/util/color_scheme/strand.rb - Color codings for strand propensity
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: strand.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Strand < Score

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

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

    @colors = {}
    @scores = {
      'A' => 0.83,
      'C' => 1.19,
      'D' => 0.54,
      'E' => 0.37,
      'F' => 1.38,
      'G' => 0.75,
      'H' => 0.87,
      'I' => 1.6,
      'K' => 0.74,
      'L' => 1.3,
      'M' => 1.05,
      'N' => 0.89,
      'P' => 0.55,
      'Q' => 1.1,
      'R' => 0.93,
      'S' => 0.75,
      'T' => 1.19,
      'U' => 0.0,
      'V' => 1.7,
      'W' => 1.37,
      'Y' => 1.47,

      'B' => 0.72,
      'X' => 1.0,
      'Z' => 0.74,
    }
    @min = 0.37
    @max = 1.7
    @scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
    @colors.default = 'FFFFFF'  # return white by default

  end
end

--- NEW FILE: turn.rb ---
#
# bio/util/color_scheme/turn.rb - Color codings for turn propensity
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: turn.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Turn < Score

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

    def self.score_to_rgb_hex(score, min, max)
      percent = score_to_percent(score, min, max)
      rgb_percent_to_hex(percent, 1.0-percent, 1.0-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.47
    @max = 1.56
    @scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
    @colors.default = 'FFFFFF'  # return white by default

  end
end

--- NEW FILE: taylor.rb ---
#
# bio/util/color_scheme/taylor.rb - Taylor color codings for amino acids
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: taylor.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Taylor < Simple

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

    @colors = {
      'A' => 'CCFF00',
      'C' => 'FFFF00',
      'D' => 'FF0000',
      'E' => 'FF0066',
      'F' => '00FF66',
      'G' => 'FF9900',
      'H' => '0066FF',
      'I' => '66FF00',
      'K' => '6600FF',
      'L' => '33FF00',
      'M' => '00FF00',
      'N' => 'CC00FF',
      'P' => 'FFCC00',
      'Q' => 'FF00CC',
      'R' => '0000FF',
      'S' => 'FF3300',
      'T' => 'FF6600',
      'U' => 'FFFFFF',
      'V' => '99FF00',
      'W' => '00CCFF',
      'Y' => '00FFCC',

      'B' => 'FFFFFF',
      'X' => 'FFFFFF',
      'Z' => 'FFFFFF',
    }
    @colors.default = 'FFFFFF'  # return white by default

  end
end

--- NEW FILE: hydropathy.rb ---
#
# bio/util/color_scheme/hydropathy.rb - Color codings for hydrophobicity
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: hydropathy.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

# Hydropathy index
# Kyte, J., and Doolittle, R.F., J. Mol. Biol.
# 1157, 105-132, 1982

module Bio::ColorScheme
  class Hydropathy < Score

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

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

    @colors = {}
    @scores = {
      'A' => 1.8,
      'C' => 2.5,
      'D' => -3.5,
      'E' => -3.5,
      'F' => 2.8,
      'G' => -0.4,
      'H' => -3.2,
      'I' => 4.5,
      'K' => -3.9,
      'L' => 3.8,
      'M' => 1.9,
      'N' => -3.5,
      'P' => -1.6,
      'Q' => -3.5,
      'R' => -4.5,
      'S' => -0.8,
      'T' => -0.7,
      'U' => 0.0,
      'V' => 4.2,
      'W' => -0.9,
      'Y' => -1.3,

      'B' => -3.5,
      'X' => -0.49,
      'Z' => -3.5,
    }
    @min = -3.9
    @max = 4.5
    @scores.each { |k,s| @colors[k] = score_to_rgb_hex(s, @min, @max) }
    @colors.default = 'FFFFFF'  # return white by default

  end
end

--- NEW FILE: zappo.rb ---
#
# bio/util/color_scheme/zappo.rb - Zappo color codings for amino acids
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: zappo.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Zappo < Simple

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

    @colors = {
      'A' => 'FFAFAF',
      'C' => 'FFFF00',
      'D' => 'FF0000',
      'E' => 'FF0000',
      'F' => 'FFC800',
      'G' => 'FF00FF',
      'H' => 'FF0000',
      'I' => 'FFAFAF',
      'K' => '6464FF',
      'L' => 'FFAFAF',
      'M' => 'FFAFAF',
      'N' => '00FF00',
      'P' => 'FF00FF',
      'Q' => '00FF00',
      'R' => '6464FF',
      'S' => '00FF00',
      'T' => '00FF00',
      'U' => 'FFFFFF',
      'V' => 'FFAFAF',
      'W' => 'FFC800',
      'Y' => 'FFC800',

      'B' => 'FFFFFF',
      'X' => 'FFFFFF',
      'Z' => 'FFFFFF',
    }
    @colors.default = 'FFFFFF'  # return white by default

  end
end

--- NEW FILE: nucleotide.rb ---
#
# bio/util/color_scheme/nucleotide.rb - Color codings for nucleotides
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: nucleotide.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Nucleotide < Simple

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

    @colors = {
      'A' => '64F73F',
      'C' => 'FFB340',
      'G' => 'EB413C',
      'T' => '3C88EE',
      'U' => '3C88EE',
    }
    @colors.default = 'FFFFFF'  # return white by default

  end
  NA = Nuc = Nucleotide
end

--- NEW FILE: buried.rb ---
#
# bio/util/color_scheme/buried.rb - Color codings for buried amino acids
#
#   Copyright (C) 2005 Trevor Wennblom <trevor at corevx.com>
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Lesser General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#  $Id: buried.rb,v 1.1 2005/10/23 08:40:41 k Exp $
#

require 'bio/util/color_scheme'

module Bio::ColorScheme
  class Buried < Score

    #########
    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



More information about the bioruby-cvs mailing list