-Maasha::Filesys::dir_create_if_not_exists( $options->{ 'directory' } );
-
-if ( $options->{ 'verbose' } ) {
- Maasha::Common::run( "bwa", "index -p $options->{ 'directory' }/$options->{ 'index_name' } $file_tmp" );
-} else {
- Maasha::Common::run( "bwa", "index -p $options->{ 'directory' }/$options->{ 'index_name' } $file_tmp > /dev/null 2>&1" );
-}
+Maasha::BWA::bwa_index( $file_tmp, $options->{ 'directory' }, $options->{ 'index_name' }, $options->{ 'verbose' } );