Check if the current configuration is valid.

        Parameters:
        -----------
        None

        Returns
        -------
        bool
            True iff no problems were found.

def check(self):
        """Check if the current configuration is valid.

        Parameters:
        -----------
        None

        Returns
        -------
        bool
            True iff no problems were found.

        """

        passed = True

        def check_type(attr, types):
            # checks whether the parameter has a certain type
            val = getattr(self, attr)
            if not isinstance(val, types):
                logger.error('Parameter "%s" = %s: invalid type ' +
                        '(should be %s).', attr, val, str(types))
                passed = False

        def check_file_exists(attr):
            # check whether the specified file exists
            path = getattr(self, attr)
            if not os.path.isfile(path):
                logger.error('Parameter "%s" = %s: file does not exist. ',
                        attr, path)
                passed = False

        def check_dir_exists(attr):
            # check whether the specified directory exists
            path = getattr(self, attr)
            if not os.path.isdir(path):
                logger.error('Parameter "%s" = %s: directory does not exist.',
                        attr, path)
                passed = False

        def check_dir_writable(attr):
            path = getattr(self, attr)
            if not misc.test_dir_writable(path):
                logger.error('Parameter "%s" = %s: directory is not writable',
                        attr, path)
                passed = False

        def check_file_writable(attr):
            # check whether the specified file is writable
            path = getattr(self, attr)
            if not misc.test_file_writable(path):
                logger.error('Parameter "%s" = %s: file not writable.',
                        attr, path)
                passed = False

        def check_range(attr, mn = None, mx = None,
                left_open = False, right_open = False):
            # checks if a GO-PCA parameter falls within a certain numeric range

            val = getattr(self, attr)
            in_range = True

            rel_op = {True: '<', False: '<='}

            if mn is not None:
                left_rel = '%s %s ' %(str(mn), rel_op[left_open])
                if left_open:
                    if not mn < val: in_range = False
                else:
                    if not mn <= val: in_range = False

            if mx is not None:
                right_rel = ' %s %s' %(rel_op[right_open], str(mx))
                if right_open:
                    if not val < mx: in_range = False
                else:
                    if not val <= mx: in_range = False

            if not in_range:
                logger.error('Parameter "%s" = %s: out of range ' +
                        '(should be %s %s %s).',
                        attr, val, left_rel, attr, right_rel)
                passed = False

        # check if input files are strings
        # specification of gene ontology file is optional
        check_type('data_dir', (str, unicode))
        check_dir_writable('data_dir')

        check_type('job_dir', (str, unicode))
        check_dir_writable('job_dir')

        if self.ssl_dir is not None:
            check_dir_exists('ssl_dir')
            if not os.path.isfile(ssl_dir + os.sep + 'gopca_server.cert'):
                logger.error('SSL certificate file not found!')
                passed = False
            if not os.path.isfile(ssl_dir + os.sep + 'gopca_server.key'):
                logger.error('SSL key file no found!')
                passed = False

        check_type('port', int)

        # TO-DO: check remaining parameters
        return passed