]> git.donarmstrong.com Git - biopieces.git/blob - code_perl/Maasha/BWA.pm
adding bzip2 support in ruby
[biopieces.git] / code_perl / Maasha / BWA.pm
1 package Maasha::BWA;
2
3 # Copyright (C) 2006-2009 Martin A. Hansen.
4
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 # http://www.gnu.org/copyleft/gpl.html
20
21
22 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
23
24
25 # Routines for manipulation of bowtie indexes and results.
26
27 # http://maq.sourceforge.net/bwa-man.shtml
28
29
30 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
31
32
33 use warnings;
34 use strict;
35 use Data::Dumper;
36 use vars qw( @ISA @EXPORT );
37
38 @ISA = qw( Exporter );
39
40
41 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
42
43
44 sub bwa_index
45 {
46     # Martin A. Hansen, September 2009.
47
48     # Create a BWA index for fast sequence mapping.
49
50     my ( $src_file,   # filename of source file
51          $dst_dir,    # destination dir to store index
52          $base_name,  # base name of index
53          $verbose,    # verbose flag
54        ) = @_;
55
56     Maasha::Filesys::dir_create_if_not_exists( $dst_dir );
57
58     if ( $verbose ) {
59         Maasha::Common::run( "bwa", "index -p $dst_dir/$base_name $src_file" );
60     } else {
61         Maasha::Common::run( "bwa", "index -p $dst_dir/$base_name $src_file > /dev/null 2>&1" );
62     }
63 }
64
65
66 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
67
68
69 1;