IntroductionNumberingSequencesStructuresModellingMacrosPublicationsLinks
ColoringSequence StatisticsRenumberingAccessibilityTorsion AnglesStructural VariabilityHydrogen BondsDownloads

Macro PDB_CollectData

xxx.

Usage:

  • xxx
  • xxx

Cauton:

xxx

Sub PDB_CollectData()

'collects the sequences, residue labels and chain identifiers into separate worksheets
'and format these worksheets

    Worksheets("Files").Activate        'make sure that the new sheets are added before the "Files" worksheet
    Sheets.Add
    ActiveSheet.Name = "Seq"
    Sheets.Add
    ActiveSheet.Name = "Label"
    Sheets.Add
    ActiveSheet.Name = "Chain"
    Sheets.Add
    ActiveSheet.Name = "Insert"

    Sheets("Seq").Cells(1, 1) = "Chain"
    Sheets("Seq").Cells(1, 2) = "Residue"
    Sheets("Seq").Cells(1, 3) = "Insertion"
                
    For i = 1 To 250 Step 1
        If IsEmpty(Sheets("Files").Cells(i, 1)) Then Exit For
            FName = Sheets("Files").Cells(i, 1)
                
            Sheets("Label").Cells(1, i + 3) = FName
            Sheets("Seq").Cells(1, i + 3) = FName
            Sheets("Chain").Cells(1, i + 3) = FName
            Sheets("Insert").Cells(1, i + 3) = FName

            Sheets(FName).Select
            k = 2
        
            For j = 1 To 32768 Step 1                             'all atom records
                If (IsEmpty(Cells(j, 1))) Then Exit For           'end of table
            
                If (Cells(j, 4) Like "N") Then                    'new residue
                    k = k + 1
                    Sheets("Seq").Cells(k, i + 3) = Cells(j, 6)
                    Sheets("Chain").Cells(k, i + 3) = Cells(j, 8)
                    Sheets("Label").Cells(k, i + 3) = Cells(j, 9)
                    Sheets("Insert").Cells(k, i + 3) = Cells(j, 10)
                End If
            Next j
   
    Next i
   
    Sheets("Seq").Select
    Cells.Select
    Selection.ColumnWidth = 4
    
    Rows("1:1").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
        .Font.Bold = True
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
    End With
    
    Sheets("Label").Select
    Cells.Select
    Selection.ColumnWidth = 4
    
    Rows("1:1").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
        .Font.Bold = True
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
    End With
    
    Sheets("Chain").Select
    Cells.Select
    Selection.ColumnWidth = 1
    
    Rows("1:1").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
        .Font.Bold = True
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
    End With

    Sheets("Insert").Select
    Cells.Select
    Selection.ColumnWidth = 1
    
    Rows("1:1").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
        .Font.Bold = True
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 90
        .ShrinkToFit = False
        .MergeCells = False
    End With

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

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