IntroductionNumberingSequencesStructuresModellingMacrosPublicationsLinks
ColoringSequence StatisticsRenumberingAccessibilityTorsion AnglesStructural VariabilityHydrogen BondsDownloads

Macro AA_Empty

AA_Empty replaces a variety of gap indicators (empty cells, "~", "-", blank) by a white "." on a black background. The use of this macro is necessary if the gapping of the sequence alignment has to be transferred to other data, since macros like PDB_Gap, RSA_Gap, etc. only recognize "." as gap character, and interpret an empty cell or blank as "end of sequence"

Select the cells to be processed and invoke AA_Empty to go from this:


to this:

Usage:

  • Select the range of cells containing the sequences to be processed
  • Choose "Macro" for the "Tool" menu
  • Run macro AA_Empty

Sub AA_Empty()

'Fills empty cells with the gap character "." and colors them black

    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 extent of current selection
i1 = Selection.Row
i2 = i1 + Selection.Rows.Count - 1
j1 = Selection.Column
J2 = j1 + Selection.Columns.Count - 1

'select Cells row i1-i2, column j1-j2; change only indicated symbols
    
For i = i1 To i2 Step 1          'all selected rows
    For j = j1 To J2 Step 1      'all selected columns
        If (IsEmpty(Cells(i, j)) Or Cells(i, j) Like "." Or Cells(i, j) Like "~" Or Cells(i, j) Like "-" Or Cells(i, j) Like " ") Then
            Cells(i, j) = "."
            
            Cells(i, j).Select
            With Selection.Interior
                .ColorIndex = 1
                .Pattern = xlSolid
                Selection.Font.ColorIndex = 2
            End With
        End If
    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