From fd9b74bbcf9d93b0b46c233e39ae3d61510f12aa Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 7 Sep 2009 18:53:40 +0000 Subject: [PATCH] sanitized create_bowtie_index code git-svn-id: http://biopieces.googlecode.com/svn/trunk@659 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/create_bowtie_index | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bp_bin/create_bowtie_index b/bp_bin/create_bowtie_index index fa6b99a..95354f6 100755 --- a/bp_bin/create_bowtie_index +++ b/bp_bin/create_bowtie_index @@ -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; -- 2.39.2