use Maasha::Biopieces;
use Maasha::Filesys;
use Maasha::Fasta;
+use Maasha::BWA;
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
]
);
-Maasha::Common::error( qq(Directory already exists: "$options->{ 'directory' }") ) if -d $options->{ 'directory' };
-
Maasha::Filesys::dir_create_if_not_exists( $options->{ 'directory' } );
$in = Maasha::Biopieces::read_stream( $options->{ "stream_in" } );
close $fh_tmp;
-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' } );
unlink $file_tmp;