]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/create_bowtie_index
adding bzip2 support in ruby
[biopieces.git] / bp_bin / create_bowtie_index
index 95354f61a3f6364ee7cb47c919d0dd1f4bdd7a52..49c1cfdc86fa205e2349f6863d3237f7b4b5c155 100755 (executable)
@@ -32,6 +32,7 @@ use Maasha::Common;
 use Maasha::Biopieces;
 use Maasha::Filesys;
 use Maasha::Fasta;
+use Maasha::Bowtie;
 
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -47,8 +48,6 @@ $options = Maasha::Biopieces::parse_options(
     ]   
 );
 
-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" } );
@@ -69,13 +68,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( "bowtie-build", "$file_tmp $options->{ 'directory' }/$options->{ 'index_name' }" );
-} else {
-    Maasha::Common::run( "bowtie-build", "$file_tmp $options->{ 'directory' }/$options->{ 'index_name' } > /dev/null 2>&1" );
-}
+Maasha::Bowtie::bowtie_index( $file_tmp, $options->{ 'directory' }, $options->{ 'index_name' }, $options->{ 'verbose' } );
 
 unlink $file_tmp;