]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/create_bwa_index
added BWA index support
[biopieces.git] / bp_bin / create_bwa_index
index 9ccb0e427568b65d20b0f5e11337a2ec75455e78..aff3befad90496105aa885a0981af9f3b348c482 100755 (executable)
@@ -32,6 +32,7 @@ use Maasha::Common;
 use Maasha::Biopieces;
 use Maasha::Filesys;
 use Maasha::Fasta;
+use Maasha::BWA;
 
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -69,13 +70,7 @@ while ( $record = Maasha::Biopieces::get_record( $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;