PEATDB/plugins/PEATSAplugin.py
def matrix2Table(self, matrix):
        """Creates a table model from a peatsa matrix"""         
        M = TableModel()
        M.addColumn('Mutations')

        fields = matrix.columnHeaders()
        for f in fields:
            M.addColumn(f)
        i = matrix.indexOfColumnWithHeader('Mutations')
        for row in matrix:
            mutationSet = Core.Data.MutationSet(row[i])
            code = '+'.join(mutationSet.mutationCodes(reduced=True))
            M.addRow(code)
            for f in fields:
                j = matrix.indexOfColumnWithHeader(f)
                if f == 'Mutations':
                    M.data[code]['Mutations'] = code
                else:                   
                    M.data[code][f] = str(row[j])
        return M
Creates a table model from a peatsa matrix
Creates a table model from a peatsa matrix
Creates a table model from a peatsa matrix
def matrix2Table(self, matrix):
        M = TableModel()
        M.addColumn('Mutations')
        fields = matrix.columnHeaders()
        for f in fields:
            M.addColumn(f)
        i = matrix.indexOfColumnWithHeader('Mutations')
        for row in matrix:
            mutationSet = Core.Data.MutationSet(row[i])
            code = '+'.join(mutationSet.mutationCodes(reduced=True))
            M.addRow(code)
            for f in fields:
                j = matrix.indexOfColumnWithHeader(f)
                if f == 'Mutations':
                    M.data[code]['Mutations'] = code
                else:                   
                    M.data[code][f] = str(row[j])
        return M
def matrix2Table ( self , matrix ) : M = TableModel ( ) M . addColumn ( 'Mutations' ) fields = matrix . columnHeaders ( ) for f in fields : M . addColumn ( f ) i = matrix . indexOfColumnWithHeader ( 'Mutations' ) for row in matrix : mutationSet = Core . Data . MutationSet ( row [ i ] ) code = '+' . join ( mutationSet . mutationCodes ( reduced = True ) ) M . addRow ( code ) for f in fields : j = matrix . indexOfColumnWithHeader ( f ) if f == 'Mutations' : M . data [ code ] [ 'Mutations' ] = code else : M . data [ code ] [ f ] = str ( row [ j ] ) return M
Creates a table model from a peatsa matrix
Creates a table model from a peatsa matrix
"""Creates a table model from a peatsa matrix"""
self
matrix