PEATSA/Core/Classify.py
def doRun(self, matrix, responseVariable):
        """Run standard features - position, mutations, substitutions"""
        print matrix.columnHeaders()
        errorIndex = matrix.indexOfColumnWithHeader(responseVariable)
       
        print 'Positions \n'
        features = matrix.mutatedResidues()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutatedResidues, responseVariable)
        allPosition, systematicPosition, outliersPosition = self.runAnalysis(data, features)
    
        '''print '\nSubstitutions\n'
        features = matrix.substitutions()
        data = self.createDataSet(matrix, features, matrix.entriesWithSubstitutions, responseVariable)
        systematicSubstitution, outliersSubstitution = self.runAnalysis(data, features)
    
        print '\nPaired Positions\n'
        features = matrix.pairedMutatedResidues()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutatedResidues, responseVariable)
        systematicDualPos, outliersDualPos = self.runAnalysis(data, features)
    
        print '\nMutations\n'
        features = matrix.mutationCodes()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutations, responseVariable)
        systematicMuts, outliersMuts = self.runAnalysis(data, features)'''
    
        #subsitutionPositionDependance(systematicPosition, systematicSubstitution, matrix)
        #subsitutionPositionDependance(outliersPosition, systematicSubstitution, matrix)
    
        posGroups = self.createGroups(matrix,
                matrix.mutatedResidues(),
                [pos[0] for pos in systematicPosition],
                [pos[0] for pos in outliersPosition],
                'entriesWithMutatedResidues')
    
        '''subGroups = self.createGroups(matrix,
                matrix.substitutions(),
                [pos[0] for pos in systematicSubstitution],
                [pos[0] for pos in outliersSubstitution],
                'entriesWithSubstitutions')
    
        dualGroups = self.createGroups(matrix,
                matrix.pairedMutatedResidues(),
                [pos[0] for pos in systematicDualPos],
                [pos[0] for pos in outliersDualPos],
                'entriesWithMutatedResidues',
                multi=True)
    
        mutGroups = self.createGroups(matrix, 
                matrix.mutationCodes(), 
                [pos[0] for pos in systematicMuts], 
                [pos[0] for pos in outliersMuts], 
                'entriesWithMutations',
                multi=True)'''
    
        print '\nIntra-Group\n'
    
        self.intraGroupDependance(matrix, posGroups['systematic'], 'entriesWithMutatedResidues',
                                     matrix.mutatedResidues(), responseVariable)
        print '\n'
        '''self.intraGroupDependance(matrix, subGroups['systematic'], 'entriesWithSubstitutions',
                                    matrix.substitutions(), responseVariable)
        print '\n'
        self.intraGroupDependance(matrix, mutGroups['systematic'], 'entriesWithMutations', matrix.mutationCodes(), responseVariable)
        
        print '\nCo-dependance\n'
        self.compareGroups(posGroups, subGroups, 'Position', 'Substitution', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(posGroups, mutGroups, 'Position', 'Mutations', 'entriesWithMutations', responseVariable)
        print '\n'
        self.compareGroups(posGroups, posGroups, 'Position', 'Position', 'entriesWithMutatedResidues', responseVariable)
        print '\n'
        self.compareGroups(subGroups, subGroups, 'Substitution', 'Substitution', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(dualGroups, posGroups, 'Double Pos', 'Single Pos', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(dualGroups, subGroups, 'Double Pos', 'Subs', 'entriesWithSubstitutions', responseVariable)
        '''        
        return allPosition, systematicPosition, outliersPosition
Run standard features - position, mutations, substitutions
Run standard features - position, mutations, substitutions
Run standard features - position mutations substitutions
def doRun(self, matrix, responseVariable):
        print matrix.columnHeaders()
        errorIndex = matrix.indexOfColumnWithHeader(responseVariable)
        print 'Positions \n'
        features = matrix.mutatedResidues()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutatedResidues, responseVariable)
        allPosition, systematicPosition, outliersPosition = self.runAnalysis(data, features)
        posGroups = self.createGroups(matrix,
                matrix.mutatedResidues(),
                [pos[0] for pos in systematicPosition],
                [pos[0] for pos in outliersPosition],
                'entriesWithMutatedResidues')
        print '\nIntra-Group\n'
        self.intraGroupDependance(matrix, posGroups['systematic'], 'entriesWithMutatedResidues',
                                     matrix.mutatedResidues(), responseVariable)
        print '\n'
        return allPosition, systematicPosition, outliersPosition
def doRun ( self , matrix , responseVariable ) : print matrix . columnHeaders ( ) errorIndex = matrix . indexOfColumnWithHeader ( responseVariable ) print 'Positions \n' features = matrix . mutatedResidues ( ) data = self . createDataSet ( matrix , features , matrix . entriesWithMutatedResidues , responseVariable ) allPosition , systematicPosition , outliersPosition = self . runAnalysis ( data , features ) '''print '\nSubstitutions\n'
        features = matrix.substitutions()
        data = self.createDataSet(matrix, features, matrix.entriesWithSubstitutions, responseVariable)
        systematicSubstitution, outliersSubstitution = self.runAnalysis(data, features)
    
        print '\nPaired Positions\n'
        features = matrix.pairedMutatedResidues()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutatedResidues, responseVariable)
        systematicDualPos, outliersDualPos = self.runAnalysis(data, features)
    
        print '\nMutations\n'
        features = matrix.mutationCodes()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutations, responseVariable)
        systematicMuts, outliersMuts = self.runAnalysis(data, features)''' posGroups = self . createGroups ( matrix , matrix . mutatedResidues ( ) , [ pos [ 0 ] for pos in systematicPosition ] , [ pos [ 0 ] for pos in outliersPosition ] , 'entriesWithMutatedResidues' ) '''subGroups = self.createGroups(matrix,
                matrix.substitutions(),
                [pos[0] for pos in systematicSubstitution],
                [pos[0] for pos in outliersSubstitution],
                'entriesWithSubstitutions')
    
        dualGroups = self.createGroups(matrix,
                matrix.pairedMutatedResidues(),
                [pos[0] for pos in systematicDualPos],
                [pos[0] for pos in outliersDualPos],
                'entriesWithMutatedResidues',
                multi=True)
    
        mutGroups = self.createGroups(matrix, 
                matrix.mutationCodes(), 
                [pos[0] for pos in systematicMuts], 
                [pos[0] for pos in outliersMuts], 
                'entriesWithMutations',
                multi=True)''' print '\nIntra-Group\n' self . intraGroupDependance ( matrix , posGroups [ 'systematic' ] , 'entriesWithMutatedResidues' , matrix . mutatedResidues ( ) , responseVariable ) print '\n' '''self.intraGroupDependance(matrix, subGroups['systematic'], 'entriesWithSubstitutions',
                                    matrix.substitutions(), responseVariable)
        print '\n'
        self.intraGroupDependance(matrix, mutGroups['systematic'], 'entriesWithMutations', matrix.mutationCodes(), responseVariable)
        
        print '\nCo-dependance\n'
        self.compareGroups(posGroups, subGroups, 'Position', 'Substitution', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(posGroups, mutGroups, 'Position', 'Mutations', 'entriesWithMutations', responseVariable)
        print '\n'
        self.compareGroups(posGroups, posGroups, 'Position', 'Position', 'entriesWithMutatedResidues', responseVariable)
        print '\n'
        self.compareGroups(subGroups, subGroups, 'Substitution', 'Substitution', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(dualGroups, posGroups, 'Double Pos', 'Single Pos', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(dualGroups, subGroups, 'Double Pos', 'Subs', 'entriesWithSubstitutions', responseVariable)
        ''' return allPosition , systematicPosition , outliersPosition
Run standard features - position, mutations, substitutions
Run standard features - position mutations substitutions
"""Run standard features - position, mutations, substitutions""" '''print '\nSubstitutions\n'
        features = matrix.substitutions()
        data = self.createDataSet(matrix, features, matrix.entriesWithSubstitutions, responseVariable)
        systematicSubstitution, outliersSubstitution = self.runAnalysis(data, features)
    
        print '\nPaired Positions\n'
        features = matrix.pairedMutatedResidues()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutatedResidues, responseVariable)
        systematicDualPos, outliersDualPos = self.runAnalysis(data, features)
    
        print '\nMutations\n'
        features = matrix.mutationCodes()
        data = self.createDataSet(matrix, features, matrix.entriesWithMutations, responseVariable)
        systematicMuts, outliersMuts = self.runAnalysis(data, features)''' #subsitutionPositionDependance(systematicPosition, systematicSubstitution, matrix) #subsitutionPositionDependance(outliersPosition, systematicSubstitution, matrix) '''subGroups = self.createGroups(matrix,
                matrix.substitutions(),
                [pos[0] for pos in systematicSubstitution],
                [pos[0] for pos in outliersSubstitution],
                'entriesWithSubstitutions')
    
        dualGroups = self.createGroups(matrix,
                matrix.pairedMutatedResidues(),
                [pos[0] for pos in systematicDualPos],
                [pos[0] for pos in outliersDualPos],
                'entriesWithMutatedResidues',
                multi=True)
    
        mutGroups = self.createGroups(matrix, 
                matrix.mutationCodes(), 
                [pos[0] for pos in systematicMuts], 
                [pos[0] for pos in outliersMuts], 
                'entriesWithMutations',
                multi=True)''' '''self.intraGroupDependance(matrix, subGroups['systematic'], 'entriesWithSubstitutions',
                                    matrix.substitutions(), responseVariable)
        print '\n'
        self.intraGroupDependance(matrix, mutGroups['systematic'], 'entriesWithMutations', matrix.mutationCodes(), responseVariable)
        
        print '\nCo-dependance\n'
        self.compareGroups(posGroups, subGroups, 'Position', 'Substitution', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(posGroups, mutGroups, 'Position', 'Mutations', 'entriesWithMutations', responseVariable)
        print '\n'
        self.compareGroups(posGroups, posGroups, 'Position', 'Position', 'entriesWithMutatedResidues', responseVariable)
        print '\n'
        self.compareGroups(subGroups, subGroups, 'Substitution', 'Substitution', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(dualGroups, posGroups, 'Double Pos', 'Single Pos', 'entriesWithSubstitutions', responseVariable)
        print '\n'
        self.compareGroups(dualGroups, subGroups, 'Double Pos', 'Subs', 'entriesWithSubstitutions', responseVariable)
        '''
self
matrix
responseVariable