Exemplo n.º 1
0
 def getColumn(self, columnIndex):
     """Get a column (trivial!)
     Return None on error
     """
     if columnIndex < 0 or columnIndex > self.colSize:
         return None
     result = NTlist()
     for row in self:
         result.append(row[columnIndex])
     return result
Exemplo n.º 2
0
 def getDiagonal(self):
     """
     Get the diagonal of a square NTlistOfLists
     return NTlist instance or None on error
     """
     if self.rowSize != self.colSize:
         nTerror(
             'NTlistOflists.getDiagonal: unequal number of rows (%d) and collumns (%d)',
             self.rowSize, self.colSize)
         return None
     result = NTlist()
     for i in range(self.rowSize):
         result.append(self[i][i])
     #end for
     return result
Exemplo n.º 3
0
def to3StateDssp(strNTList):
    """Personal communications JFD with Rob Hooft and Gert Vriend.

    3, H -> H
    B, E -> S
    space, S, G, T -> coil (represented by ' ')

    See namesake method in procheck class.
    """
    result = NTlist()
    for c in strNTList:
        n = DSSP_C
        if c == '3' or c == 'H':
            n = DSSP_H
        # end if
        elif c == 'B' or c == 'E':
            n = DSSP_S
        # end if
        result.append(n)
    return result
Exemplo n.º 4
0
 def __init__(self):
     NTdict.__init__(self)
     self[ERROR_ID] = NTlist()
     self[WARNING_ID] = NTlist()
     self[MESSAGE_ID] = NTlist()
     self[DEBUG_ID] = NTlist()