]> git.donarmstrong.com Git - biopieces.git/commitdiff
sanitized create_bowtie_index code
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 7 Sep 2009 18:53:40 +0000 (18:53 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 7 Sep 2009 18:53:40 +0000 (18:53 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@659 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/create_bowtie_index

index fa6b99a6a336b1deeef32de23d0794fe89a6085e..95354f61a3f6364ee7cb47c919d0dd1f4bdd7a52 100755 (executable)
@@ -30,7 +30,6 @@ use warnings;
 use strict;
 use Maasha::Common;
 use Maasha::Biopieces;
-use Maasha::Bowtie;
 use Maasha::Filesys;
 use Maasha::Fasta;
 
@@ -48,7 +47,7 @@ $options = Maasha::Biopieces::parse_options(
     ]   
 );
 
-Maasha::Common::error( qw(Directory already exists: "$options->{ 'directory' }") ) if -d $options->{ 'directory' };
+Maasha::Common::error( qq(Directory already exists: "$options->{ 'directory' }") ) if -d $options->{ 'directory' };
 
 Maasha::Filesys::dir_create_if_not_exists( $options->{ 'directory' } );
 
@@ -70,7 +69,13 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 
 close $fh_tmp;
 
-Maasha::Bowtie::bowtie_index( $file_tmp, $options->{ 'directory' }, $options->{ 'index_name' }, $options->{ 'verbose' } );
+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" );
+}
 
 unlink $file_tmp;