IntroductionNumberingSequencesStructuresModellingMacrosPublicationsLinks
ColoringSequence StatisticsRenumberingAccessibilityTorsion AnglesStructural VariabilityHydrogen BondsDownloads

Macro AA_Hydropathy

Macro AA_Hydropathy colors the selected sequence block according to the hydrophobicity of the individual amino acid residues: Hydrophobic residues are colored yellow, residues of intermediate hydrophobicity green and hydrophilic residues blue (Color Code).

The hydrophobicity ranking is based on the parameters of Kyte+Doolittle, J. Mol. Biol. 157(1982)105-132). Alternative hydropathy scales are listed in the worksheet "Hydropathy" of the workbook "AHo_macros.xls"

Usage:

  • Select the range of cells containing the sequences to be colored
  • Choose "Macro" for the "Tool" menu
  • Run macro AA_Hydropathy
Sub AA_Hydropathy()

'colors cells according to amino acid hydropathy (Parameters of Kyte+Doolittle, J. Mol. Biol. 157(1982)105-132)

    If Selection.Columns.Count = 0 Then      'Error, nothing selected
        MsgBox Prompt:="No cells selected, please select the sequences you wish to color"
        Exit Sub
    End If

'get current selection
i1 = Selection.Row
i2 = i1 + Selection.Rows.Count - 1
j1 = Selection.Column
j2 = j1 + Selection.Columns.Count - 1

'Format selected area
    Selection.Borders(xlLeft).LineStyle = xlNone
    Selection.Borders(xlRight).LineStyle = xlNone
    Selection.Borders(xlTop).LineStyle = xlNone
    Selection.Borders(xlBottom).LineStyle = xlNone
    Selection.BorderAround Weight:=xlThick
    Selection.Interior.ColorIndex = xlNone
    Selection.Font.Name = "Geneva"
    Selection.Font.FontStyle = "Regular"
    Selection.Font.Size = 9
    Selection.Font.ColorIndex = 1
    Selection.Font.Bold = True
    Selection.HorizontalAlignment = xlCenter
    Selection.VerticalAlignment = xlCenter
    
For i = i1 To i2 Step 1
    For j = j1 To j2 Step 1
        n = 1
        If (IsEmpty(Cells(i, j)) Or Cells(i, j) Like ".") Then
        n = 1
         ElseIf ((Cells(i, j) Like "C") Or (Cells(i, j) Like "V") Or (Cells(i, j) Like "I") Or (Cells(i, j) Like "L") Or (Cells(i, j) Like "M") Or (Cells(i, j) Like "F")) Then n = 37
          ElseIf ((Cells(i, j) Like "A") Or (Cells(i, j) Like "G") Or (Cells(i, j) Like "S") Or (Cells(i, j) Like "T")) Then n = 38
           ElseIf ((Cells(i, j) Like "P") Or (Cells(i, j) Like "W") Or (Cells(i, j) Like "Y")) Then n = 39
            ElseIf ((Cells(i, j) Like "D") Or (Cells(i, j) Like "E") Or (Cells(i, j) Like "H") Or (Cells(i, j) Like "Q") Or (Cells(i, j) Like "N")) Then n = 41
             ElseIf ((Cells(i, j) Like "K") Or (Cells(i, j) Like "R")) Then n = 42
               Else: n = 1
        End If
        
        Cells(i, j).Select
        With Selection.Interior
            .ColorIndex = n
            .Pattern = xlSolid
        End With
        
    Next j
Next i

End Sub
AAAAA Homepage Zürich University Dept. of Biochemistry Plückthun Group Annemarie Honegger

Last Modified by A.Honegger Wednesday, January 26, 2005