def run(self):
        '''It runs the analysis.'''
        self._log({'analysis_started':True})
        project_settings = self._project_settings
        settings = project_settings['Mappers']
        tmp_dir  = project_settings['General_settings']['tmpdir']
        project_path = project_settings['General_settings']['project_path']
        unmapped_fhand = None
        if 'keep_unmapped_reads_in_bam' in settings:
            if settings['keep_unmapped_reads_in_bam'] == False:
                unmapped_fpath = os.path.join(project_path,
                                            BACKBONE_DIRECTORIES['mappings'][0],
                                            BACKBONE_BASENAMES['unmapped_list'])
                unmapped_fhand = GzipFile(unmapped_fpath, 'w')
        inputs = self._get_input_fpaths()
        reads_fpaths = inputs['reads']
        output_dir = self._create_output_dirs(timestamped=True)['result']

        # define color and sequence references
        reference_path    = inputs['reference']
        mapping_index_dir = inputs['mapping_index']
        #print reference_path, mapping_index_dir

        #memory for the java programs
        java_mem = self._project_settings['Other_settings']['java_memory']
        picard_path = self._project_settings['Other_settings']['picard_path']

        for read_fpath in reads_fpaths:
            mapping_parameters = {}
            read_info = scrape_info_from_fname(read_fpath)
            platform = read_info['pl']
            #which maper are we using for this platform
            mapper = settings['mapper_for_%s' % platform]

            (reference_fpath,
             color_space) = self._prepare_mapper_index(mapping_index_dir,
                                                      reference_path,
                                                      platform, mapper)

            mapping_parameters['unmapped_fhand'] = unmapped_fhand
            mapping_parameters['colorspace'] = color_space
            out_bam_fpath = os.path.join(output_dir,
                                         read_fpath.basename + '.bam')

            if platform in ('454', 'sanger'):
                mapping_parameters['reads_length'] = 'long'
            else:
                mapping_parameters['reads_length'] = 'short'

            if not os.path.exists(out_bam_fpath):
                mapping_parameters['threads']   = self.threads
                mapping_parameters['java_conf'] = {'java_memory':java_mem,
                                                   'picard_path':picard_path}
                mapping_parameters['tmp_dir'] = tmp_dir
                map_reads(mapper,
                          reads_fpath=read_fpath.last_version,
                          reference_fpath=reference_fpath,
                          out_bam_fpath=out_bam_fpath,
                          parameters=mapping_parameters)

        # Now we run the select _last mapping
        self._spawn_analysis(DEFINITIONS['_select_last_mapping'],
                             silent=self._silent)

        self._log({'analysis_finished':True})