def run(self):
        '''It runs the analysis.'''
        self._log({'analysis_started':True})
        inputs = self._get_input_fpaths()
        bam_path = inputs['bam']
        bam_fpath = bam_path.last_version
        reference_fpath = inputs['reference'].last_version
        out_fhand = open(bam_path.next_version, 'w')
        cmd = ['samtools', 'calmd', '-Abr', bam_fpath, reference_fpath]
        call(cmd, raise_on_error=True, stdout=out_fhand)

        create_bam_index(out_fhand.name)

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