| 1 | # $Id$ | ||
| 2 | # | ||
| 3 | # BioPerl module for Bio::Tools::Run::BWA::Config | ||
| 4 | # | ||
| 5 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 6 | # | ||
| 7 | # Cared for by Mark A. Jensen <maj@fortinbras.us> | ||
| 8 | # | ||
| 9 | # Copyright Mark A. Jensen | ||
| 10 | # | ||
| 11 | # You may distribute this module under the same terms as perl itself | ||
| 12 | |||
| 13 | # POD documentation - main docs before the code | ||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | Bio::Tools::Run::BWA::Config - Configuration data for BWA commands | ||
| 18 | |||
| 19 | =head1 SYNOPSIS | ||
| 20 | |||
| 21 | Used internally by L<Bio::Tools::Run::BWA>. | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | This package exports information describing BWA commands, parameters, | ||
| 26 | switches, and input and output filetypes for individual BWA commands. | ||
| 27 | See L<http://bio-bwa.sourceforge.net/bwa.shtml>. | ||
| 28 | |||
| 29 | =head1 FEEDBACK | ||
| 30 | |||
| 31 | =head2 Mailing Lists | ||
| 32 | |||
| 33 | User feedback is an integral part of the evolution of this and other | ||
| 34 | Bioperl modules. Send your comments and suggestions preferably to | ||
| 35 | the Bioperl mailing list. Your participation is much appreciated. | ||
| 36 | |||
| 37 | bioperl-l@bioperl.org - General discussion | ||
| 38 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 39 | |||
| 40 | =head2 Support | ||
| 41 | |||
| 42 | Please direct usage questions or support issues to the mailing list: | ||
| 43 | |||
| 44 | L<bioperl-l@bioperl.org> | ||
| 45 | |||
| 46 | rather than to the module maintainer directly. Many experienced and | ||
| 47 | reponsive experts will be able look at the problem and quickly | ||
| 48 | address it. Please include a thorough description of the problem | ||
| 49 | with code and data examples if at all possible. | ||
| 50 | |||
| 51 | =head2 Reporting Bugs | ||
| 52 | |||
| 53 | Report bugs to the Bioperl bug tracking system to help us keep track | ||
| 54 | of the bugs and their resolution. Bug reports can be submitted via | ||
| 55 | the web: | ||
| 56 | |||
| 57 | http://redmine.open-bio.org/projects/bioperl/ | ||
| 58 | |||
| 59 | =head1 AUTHOR - Mark A. Jensen | ||
| 60 | |||
| 61 | Email maj@fortinbras.us | ||
| 62 | |||
| 63 | Describe contact details here | ||
| 64 | |||
| 65 | =head1 CONTRIBUTORS | ||
| 66 | |||
| 67 | Additional contributors names and emails here | ||
| 68 | |||
| 69 | =head1 APPENDIX | ||
| 70 | |||
| 71 | The rest of the documentation details each of the object methods. | ||
| 72 | Internal methods are usually preceded with a _ | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | # Let the code begin... | ||
| 77 | |||
| 78 | package Bio::Tools::Run::BWA::Config; | ||
| 79 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 80 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 81 | 1 | ▶ | no warnings qw(qw); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 82 | 1 | ▶ | use Bio::Root::Root; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 83 | 1 | ▶ | use Exporter; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 84 | 1 | ▶ | use base qw(Bio::Root::Root ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 85 | |||
| 86 | 1 | our (@ISA, @EXPORT, @EXPORT_OK); | |
| 87 | 1 | push @ISA, 'Exporter'; | |
| 88 | 1 | @EXPORT = qw( | |
| 89 | @program_commands | ||
| 90 | %command_prefixes | ||
| 91 | %composite_commands | ||
| 92 | @program_params | ||
| 93 | @program_switches | ||
| 94 | %param_translation | ||
| 95 | %command_files | ||
| 96 | ); | ||
| 97 | |||
| 98 | 1 | @EXPORT_OK = qw(); | |
| 99 | |||
| 100 | 1 | our @program_commands = qw( | |
| 101 | run | ||
| 102 | index | ||
| 103 | aln | ||
| 104 | samse | ||
| 105 | sampe | ||
| 106 | dbwtsw | ||
| 107 | ); | ||
| 108 | |||
| 109 | # composite commands: pseudo-commands that run a | ||
| 110 | # sequence of commands | ||
| 111 | # composite command prefix => list of prefixes of commands this | ||
| 112 | # composite command runs | ||
| 113 | # | ||
| 114 | |||
| 115 | 1 | our %composite_commands = ( | |
| 116 | 'run' => [qw( map asm c2q )] | ||
| 117 | ); | ||
| 118 | |||
| 119 | # prefixes only for commands that take params/switches... | ||
| 120 | 1 | our %command_prefixes = ( | |
| 121 | 'aln' => 'aln', | ||
| 122 | 'dbwtsw' => 'bwt', | ||
| 123 | 'index' => 'idx', | ||
| 124 | 'samse' => 'sms', | ||
| 125 | 'sampe' => 'smp', | ||
| 126 | 'run' => 'run' | ||
| 127 | ); | ||
| 128 | |||
| 129 | 1 | our @program_params = qw( | |
| 130 | command | ||
| 131 | idx|output_prefix | ||
| 132 | idx|algorithm | ||
| 133 | aln|max_edit_dist | ||
| 134 | aln|max_gap_opens | ||
| 135 | aln|max_gap_extns | ||
| 136 | aln|deln_protect_3p | ||
| 137 | aln|deln_protect_ends | ||
| 138 | aln|subseq_seed | ||
| 139 | aln|max_edit_dist_seed | ||
| 140 | aln|n_threads | ||
| 141 | aln|mm_penalty | ||
| 142 | aln|gap_open_penalty | ||
| 143 | aln|gap_extn_penalty | ||
| 144 | aln|subopt_hit_threshold | ||
| 145 | aln|trim_parameter | ||
| 146 | sms|hit_limit | ||
| 147 | smp|max_insert_size | ||
| 148 | smp|max_read_occur | ||
| 149 | bwt|match_score | ||
| 150 | bwt|mm_penalty | ||
| 151 | bwt|gap_open_penalty | ||
| 152 | bwt|gap_extn_penalty | ||
| 153 | bwt|n_threads | ||
| 154 | bwt|band_width | ||
| 155 | bwt|rel_min_score_threshold | ||
| 156 | bwt|threshold_adj_coeff | ||
| 157 | bwt|z_best | ||
| 158 | bwt|max_sa_interval | ||
| 159 | bwt|min_seeds_to_skip | ||
| 160 | |||
| 161 | ); | ||
| 162 | |||
| 163 | 1 | our @program_switches = qw( | |
| 164 | idx|color_space_idx | ||
| 165 | aln|reverse_no_comp | ||
| 166 | aln|no_iter_search | ||
| 167 | ); | ||
| 168 | |||
| 169 | 1 | our %param_translation = ( | |
| 170 | 'idx|output_prefix' => 'p', | ||
| 171 | 'idx|algorithm' => 'a', | ||
| 172 | 'aln|max_edit_dist' => 'n', | ||
| 173 | 'aln|max_gap_opens' => 'o', | ||
| 174 | 'aln|max_gap_extns' => 'e', | ||
| 175 | 'aln|deln_protect_3p' => 'd', | ||
| 176 | 'aln|deln_protect_ends' => 'i', | ||
| 177 | 'aln|subseq_seed' => 'l', | ||
| 178 | 'aln|max_edit_dist_seed' => 'k', | ||
| 179 | 'aln|n_threads' => 't', | ||
| 180 | 'aln|mm_penalty' => 'M', | ||
| 181 | 'aln|gap_open_penalty' => 'O', | ||
| 182 | 'aln|gap_extn_penalty' => 'E', | ||
| 183 | 'aln|subopt_hit_threshold' => 'R', | ||
| 184 | 'aln|trim_parameter' => 'q', | ||
| 185 | 'sms|hit_limit' => 'n', | ||
| 186 | 'smp|max_insert_size' => 'a', | ||
| 187 | 'smp|max_read_occur' => 'o', | ||
| 188 | 'bwt|match_score' => 'a', | ||
| 189 | 'bwt|mm_penalty' => 'b', | ||
| 190 | 'bwt|gap_open_penalty' => 'q', | ||
| 191 | 'bwt|gap_extn_penalty' => 'r', | ||
| 192 | 'bwt|n_threads' => 't', | ||
| 193 | 'bwt|band_width' => 'w', | ||
| 194 | 'bwt|rel_min_score_threshold' => 'T', | ||
| 195 | 'bwt|threshold_adj_coeff' => 'c', | ||
| 196 | 'bwt|z_best' => 'z', | ||
| 197 | 'bwt|max_sa_interval' => 's', | ||
| 198 | 'bwt|min_seeds_to_skip' => 'N' | ||
| 199 | ); | ||
| 200 | |||
| 201 | # | ||
| 202 | # the order in the arrayrefs is the order required | ||
| 203 | # on the command line | ||
| 204 | # | ||
| 205 | # the strings in the arrayrefs (less special chars) | ||
| 206 | # become the keys for named parameters to run_maq | ||
| 207 | # | ||
| 208 | # special chars: | ||
| 209 | # | ||
| 210 | # '#' implies optional | ||
| 211 | # '*' implies variable number of this type | ||
| 212 | # <|> implies stdin/stdout redirect | ||
| 213 | # | ||
| 214 | |||
| 215 | 1 | our %command_files = ( | |
| 216 | 'run' => [qw( faq fas faq )], | ||
| 217 | 'index' => [qw( fas )], | ||
| 218 | 'aln' => [qw( fas faq >sai )], | ||
| 219 | 'samse' => [qw( fas sai faq >sam )], | ||
| 220 | 'sampe' => [qw( fas sai1 sai2 faq1 faq2 >sam )], | ||
| 221 | 'dbwtsw' => [qw( fas faq )] | ||
| 222 | ); | ||
| 223 | |||
| 224 | INIT { | ||
| 225 | # add subcommand params and switches for | ||
| 226 | # composite commands | ||
| 227 | my @sub_params; | ||
| 228 | my @sub_switches; | ||
| 229 | foreach my $cmd (keys %composite_commands) { | ||
| 230 | foreach my $subcmd ( @{$composite_commands{$cmd}} ) { | ||
| 231 | my @sub_program_params = grep /^$subcmd\|/, @program_params; | ||
| 232 | my @sub_program_switches = grep /^$subcmd\|/, @program_switches; | ||
| 233 | for (@sub_program_params) { | ||
| 234 | m/^$subcmd\|(.*)/; | ||
| 235 | push @sub_params, "$cmd\|${subcmd}_".$1; | ||
| 236 | } | ||
| 237 | for (@sub_program_switches) { | ||
| 238 | m/^$subcmd\|(.*)/; | ||
| 239 | push @sub_switches, "$cmd\|${subcmd}_".$1; | ||
| 240 | } | ||
| 241 | } | ||
| 242 | } | ||
| 243 | push @program_params, @sub_params; | ||
| 244 | push @program_switches, @sub_switches; | ||
| 245 | # translations for subcmd params/switches not necessary | ||
| 246 | } | ||
| 247 | 1 | 1; | |