IntroductionNumberingSequencesStructuresModellingMacrosPublicationsLinks
ColoringSequence StatisticsRenumberingAccessibilityTorsion AnglesStructural VariabilityHydrogen BondsDownloads

Macro AA_SeqVarColor

Converts the Kabat sequence variability calculated by AA_frequency to a color code

Usage:

  • select the cells you wish to color
  • Select "Macro" in the "Tool" menu
  • Run macro AA_SeqVarColor
  • If you want to have the variability color code superimposed on the sequence rather than the values, either select the colored cells, copy and "paste special: Formats" onto the row containing sthe sequence, or copy the sequence and "past special:Values" onto the colored cells

Sub AA_SeqVarColor()

'Color Code for the sequence variability in an alignment
'Applied to the line containing the Kabat sequence variability in the result
'produced by "AA-Frequency", it converts the numeric values to a color code


    i1 = Selection.Row
    i2 = i1 + Selection.Rows.Count - 1
    j1 = Selection.Column
    j2 = j1 + Selection.Columns.Count - 1
    
    For i = i1 To i2 Step 1
        For j = j1 To j2 Step 1

        If (IsEmpty(Cells(i, j)) Or Not (IsNumeric(Cells(i, j)))) Then
            k = 1 'black
            ElseIf Cells(i, j).Value > 100 Then
                k = 33 'red
                ElseIf Cells(i, j).Value > 75 Then
                    k = 34 'orange-red
                    ElseIf Cells(i, j).Value > 50 Then
                        k = 35 'orange
                        ElseIf Cells(i, j).Value > 25 Then
                            k = 36 'orange-yellow
                            ElseIf Cells(i, j).Value > 10 Then
                                k = 37 'yellow
                                Else
                                    k = 2 'white
        End If

        Cells(i, j).Select
        With Selection.Interior
            .ColorIndex = k
            .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