def execute(choices, galaxyFn=None, username=''):
        '''Is called when execute-button is pushed by web-user.
        Should print output as HTML to standard out, which will be directed to a results page in Galaxy history.
        If getOutputFormat is anything else than HTML, the output should be written to the file with path galaxyFn.
        If needed, StaticFile can be used to get a path where additional files can be put (e.g. generated image files).
        choices is a list of selections made by web-user in each options box.
        '''
        from time import time
        startTime = time()
        from quick.application.ExternalTrackManager import ExternalTrackManager
        from quick.util.StaticFile import GalaxyRunSpecificFile
        import os

        motifFn = ExternalTrackManager.extractFnFromGalaxyTN( choices[0].split(':'))
        observedFasta = ExternalTrackManager.extractFnFromGalaxyTN( choices[1].split(':'))

        randomGalaxyTN = choices[2].split(':')
        randomName = ExternalTrackManager.extractNameFromHistoryTN(randomGalaxyTN)
        randomGalaxyFn = ExternalTrackManager.extractFnFromGalaxyTN( randomGalaxyTN)
        randomStatic = GalaxyRunSpecificFile(['random'],randomGalaxyFn) #finds path to static file created for a previous history element (randomFn), and directs to a folder containing several files..
        #print os.listdir(randomStatic.getDiskPath())
        randomFastaPath = randomStatic.getDiskPath()

        #motifFn, observedFasta, randomFastaPath = '/Users/sandve/egne_dokumenter/_faglig/NullModels/DnaSeqExample/liver.pwm', 'liver.fa', 'randomFastas'
        testStatistic = choices[3]
        if testStatistic == 'Average of max score per sequence':
            scoreFunc = scoreMotifOnFastaAsAvgOfBestScores
        elif testStatistic == 'Sum of scores across all positions of all sequences':
            scoreFunc = scoreMotifOnFastaAsSumOfAllScores
        elif testStatistic == 'Score of Frith et al. (2004)':
            scoreFunc = lr4
        elif testStatistic == 'Product of max per sequence':
            scoreFunc = scoreMotifOnFastaAsProductOfBestScores
        else:
            raise
        
        pvals = mcPvalFromMotifAndFastas(motifFn, observedFasta, randomFastaPath, scoreFunc)
        print 'Pvals for motifs (%s) against observed (%s) vs random (%s - %s) sequences.' % (motifFn, observedFasta, randomName, randomFastaPath)
        for motif,pval in sorted(pvals.items()):
            print motif+'\t'+('%.4f'%pval)
            
        from quick.util.StaticFile import GalaxyRunSpecificFile
        from gold.application.RSetup import r, robjects
        histStaticFile = GalaxyRunSpecificFile(['pvalHist.png'],galaxyFn)
        #histStaticFile.openRFigure()
        histStaticFile.plotRHist(pvals.values(), [x/40.0 for x in range(41)], 'Histogram of p-values', xlim=robjects.FloatVector([0.0, 1.0]))
        #r.hist(robjects.FloatVector(pvals.values()), breaks=robjects.FloatVector([x/40.0 for x in range(41)]), xlim=robjects.FloatVector([0.0, 1.0]), main='Histogram of p-values' )
        #histStaticFile.closeRFigure()
        print histStaticFile.getLink('Histogram')
        print 'Time (s):', time()-startTime