def run(self):
        self.loadArgs()
        self.args['outputdirectory'] = self.outputDir
    
#        if self.projectionlayers <> '':
#            #A command line input overrides an input in the args csv
#            self.args['projectionlayers'] = self.projectionlayers
#    
        self.validateInputs()
    
        if self.inputMDS <> '':
            self.prepInputs()
        else:
            raise Exception, "No MDS supplied."

        if not self.args.has_key('projectionlayers'):
            self.args['projectionlayers'] = ''

        if self.trainingCSV <> '':
            self.args['samplesfile'] = self.trainingCSV
        else:
            raise Exception, "No Samples file supplied"
        
        if self.testCSV <> '':
            self.args['testsamplesfile'] = self.testCSV
        
        if self.backgroundCSV <> '':
            self.args['environmentallayers'] = self.backgroundCSV
        
        
        self.args['autorun'] = 'true'
        #self.args['outputgrids'] = 'false'
        
        if ' ' in self.args['species_name']:
            self.args['species_name'] = self.args['species_name'].replace(' ', '_')
        
        strargs = ['='.join((str(k),str(v))) for k,v in self.args.iteritems() if k <> "species_name"]
        for categorical in self.categoricals:
            strargs += ['togglelayertype=' + categorical.replace('_categorical', '')]
        #strargs = ' '.join(strargs)
        #print strargs
        
        if not self.maxentpath.endswith('.jar'):
            jar = os.path.join(self.maxentpath, 'maxent.jar')
        else:
            jar = self.maxentpath
            
        self.run_cmd_line_jar(jar, strargs)
dataset/ETHPy150Open VisTrails/VisTrails/contrib/sahm/pySAHM/MaxentRunner.py/MAXENTRunner.run/original