« blib/lib/Bio/DB/SoapEUtilities/FetchAdaptor/species.pm
↑ Summary
blib/lib/Bio/Tools/Run/Analysis/soap.pm »
| 1 | # $Id$ | ||||||||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||||||||
| 3 | # Copyright Balamurugan Kumarasamy | ||||||||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||||||||
| 5 | # You may distribute this module under the same terms as perl itself | ||||||||||||||||||||||||||||||||||
| 6 | # POD documentation - main docs before the code | ||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||
| 10 | Bio::Tools::Run::Alignment::Blat | ||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||
| 12 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||
| 14 | Build a Blat factory. | ||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||
| 16 | use Bio::Tools::Run::Alignment::Blat; | ||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||
| 18 | my $factory = Bio::Tools::Run::Alignment::Blat->new(); | ||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||
| 20 | # Pass the factory a Bio::Seq object | ||||||||||||||||||||||||||||||||||
| 21 | # @feats is an array of Bio::SeqFeature::Generic objects | ||||||||||||||||||||||||||||||||||
| 22 | my @feats = $factory->run($seq,$DB); | ||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||
| 24 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||
| 26 | Wrapper module for Blat program. This newer version allows for all | ||||||||||||||||||||||||||||||||||
| 27 | parameters to be set. | ||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||
| 29 | Key bits not implemented yet (TODO): | ||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||
| 31 | =over 3 | ||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||
| 33 | =item * Implement all needed L<Bio::Tools::Run::WrapperBase> methods | ||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||
| 35 | Missing are a few, including version(). | ||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||
| 37 | =item * Re-implement using L<IPC::Run> | ||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||
| 39 | Would like to get this running under something less reliant on OS-dependent | ||||||||||||||||||||||||||||||||||
| 40 | changes within code. | ||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||
| 42 | =item * No .2bit or .nib conversions yet | ||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||
| 44 | These require callouts to faToNib or faTwoTwoBit, which may or may not be | ||||||||||||||||||||||||||||||||||
| 45 | installed on a user's machine. We can possibly add functionality to | ||||||||||||||||||||||||||||||||||
| 46 | check for faToTwoBit/faToNib and other UCSC tools in the future. | ||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||
| 48 | =back | ||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||
| 50 | =head1 FEEDBACK | ||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||
| 52 | =head2 Mailing Lists | ||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||
| 54 | User feedback is an integral part of the evolution of this and other | ||||||||||||||||||||||||||||||||||
| 55 | Bioperl modules. Send your comments and suggestions preferably to one | ||||||||||||||||||||||||||||||||||
| 56 | of the Bioperl mailing lists. Your participation is much appreciated. | ||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||
| 58 | bioperl-l@bioperl.org - General discussion | ||||||||||||||||||||||||||||||||||
| 59 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||
| 61 | =head2 Support | ||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||
| 63 | Please direct usage questions or support issues to the mailing list: | ||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||
| 65 | I<bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||
| 67 | rather than to the module maintainer directly. Many experienced and | ||||||||||||||||||||||||||||||||||
| 68 | reponsive experts will be able look at the problem and quickly | ||||||||||||||||||||||||||||||||||
| 69 | address it. Please include a thorough description of the problem | ||||||||||||||||||||||||||||||||||
| 70 | with code and data examples if at all possible. | ||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||
| 72 | =head2 Reporting Bugs | ||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||
| 74 | Report bugs to the Bioperl bug tracking system to help us keep track | ||||||||||||||||||||||||||||||||||
| 75 | the bugs and their resolution. Bug reports can be submitted via the | ||||||||||||||||||||||||||||||||||
| 76 | web: | ||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||
| 78 | http://redmine.open-bio.org/projects/bioperl/ | ||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||
| 80 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||
| 82 | Chris Fields - cjfields at bioperl dot org | ||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||
| 84 | Original author- Bala Email bala@tll.org.sg | ||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||
| 86 | =head1 APPENDIX | ||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||
| 88 | The rest of the documentation details each of the object | ||||||||||||||||||||||||||||||||||
| 89 | methods. Internal methods are usually preceded with a _ | ||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||
| 91 | =cut | ||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||
| 93 | package Bio::Tools::Run::Alignment::Blat; | ||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||
| 95 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 96 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 97 | 1 | ▶ | use base qw(Bio::Root::Root Bio::Tools::Run::WrapperBase); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||
| 99 | 1 | ▶ | use Bio::SeqIO; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 100 | 1 | ▶ | use Bio::Root::Root; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 101 | 1 | ▶ | use Bio::Factory::ApplicationFactoryI; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 102 | 1 | ▶ | use Bio::SearchIO; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 103 | 1 | ▶ | use Bio::Tools::Run::WrapperBase; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||
| 105 | 1 | our ($PROGRAM, $PROGRAMDIR, $PROGRAMNAME); | |||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||
| 107 | 1 | our %BLAT_PARAMS = map {$_ => 1} qw(ooc t q tileSize stepSize oneOff | |||||||||||||||||||||||||||||||||
| 108 | minMatch minScore minIdentity maxGap makeOoc repmatch mask qMask repeats | ||||||||||||||||||||||||||||||||||
| 109 | minRepeatsDivergence dots out maxIntron); | ||||||||||||||||||||||||||||||||||
| 110 | 1 | our %BLAT_SWITCHES = map {$_ => 1} qw(prot noHead trimT noTrimA trimHardA | |||||||||||||||||||||||||||||||||
| 111 | fastMap fine extendThroughN); | ||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||
| 113 | 1 | our %LOCAL_ATTRIBUTES = map {$_ => 1} qw(db DB qsegment hsegment searchio | |||||||||||||||||||||||||||||||||
| 114 | outfile_name quiet); | ||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||
| 116 | 1 | our %searchio_map = ( | |||||||||||||||||||||||||||||||||
| 117 | 'psl' => 'psl', | ||||||||||||||||||||||||||||||||||
| 118 | 'pslx' => 'psl', # I don't think there is support for this yet | ||||||||||||||||||||||||||||||||||
| 119 | 'axt' => 'axt', | ||||||||||||||||||||||||||||||||||
| 120 | 'blast' => 'blast', | ||||||||||||||||||||||||||||||||||
| 121 | 'sim4' => 'sim4', | ||||||||||||||||||||||||||||||||||
| 122 | 'wublast' => 'blast', | ||||||||||||||||||||||||||||||||||
| 123 | 'blast8' => 'blasttable', | ||||||||||||||||||||||||||||||||||
| 124 | 'blast9' => 'blasttable' | ||||||||||||||||||||||||||||||||||
| 125 | ); | ||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||
| 127 | =head2 new | ||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||
| 129 | Title : new | ||||||||||||||||||||||||||||||||||
| 130 | Usage : $blat->new(@params) | ||||||||||||||||||||||||||||||||||
| 131 | Function: creates a new Blat factory | ||||||||||||||||||||||||||||||||||
| 132 | Returns : Bio::Tools::Run::Alignment::Blat | ||||||||||||||||||||||||||||||||||
| 133 | Args : | ||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||
| 135 | =cut | ||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||
| 137 | sub new { | ||||||||||||||||||||||||||||||||||
| 138 | 1 | ▶ | my ($class,@args) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 139 | 1 | my $self = $class->SUPER::new(@args); | |||||||||||||||||||||||||||||||||
| 140 | 1 | $self->io->_initialize_io(); | |||||||||||||||||||||||||||||||||
| 141 | 1 | $self->set_parameters(@args); | |||||||||||||||||||||||||||||||||
| 142 | 1 | return $self; | |||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||
| 145 | =head2 program_name | ||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||
| 147 | Title : program_name | ||||||||||||||||||||||||||||||||||
| 148 | Usage : $factory->program_name() | ||||||||||||||||||||||||||||||||||
| 149 | Function: holds the program name | ||||||||||||||||||||||||||||||||||
| 150 | Returns : string | ||||||||||||||||||||||||||||||||||
| 151 | Args : None | ||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||
| 153 | =cut | ||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||
| 155 | sub program_name { | ||||||||||||||||||||||||||||||||||
| 156 | 6 | ▶ | return 'blat'; | ||||||||||||||||||||||||||||||||
|
Subroutine
program_name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||
| 159 | =head2 program_dir | ||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||
| 161 | Title : program_dir | ||||||||||||||||||||||||||||||||||
| 162 | Usage : $factory->program_dir(@params) | ||||||||||||||||||||||||||||||||||
| 163 | Function: returns the program directory, obtained from ENV variable. | ||||||||||||||||||||||||||||||||||
| 164 | Returns : string | ||||||||||||||||||||||||||||||||||
| 165 | Args : | ||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||
| 167 | =cut | ||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||
| 169 | sub program_dir { | ||||||||||||||||||||||||||||||||||
| 170 | 3 | ▶ | return Bio::Root::IO->catfile($ENV{BLATDIR}) if $ENV{BLATDIR}; | ||||||||||||||||||||||||||||||||
|
Subroutine
program_dir: called CC=2 SCAR=7.6
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||
| 173 | =head2 run | ||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||
| 175 | Title : run() | ||||||||||||||||||||||||||||||||||
| 176 | Usage : $obj->run($query) | ||||||||||||||||||||||||||||||||||
| 177 | Function: Runs Blat and creates an array of featrues | ||||||||||||||||||||||||||||||||||
| 178 | Returns : An array of Bio::SeqFeature::Generic objects | ||||||||||||||||||||||||||||||||||
| 179 | Args : A Bio::PrimarySeqI or a file name | ||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||
| 181 | =cut | ||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||
| 183 | sub run { | ||||||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | my ($self,$query) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
run: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 185 | 0 | my @feats; | |||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | if (ref($query) ) { # it is an object | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | if (ref($query) =~ /GLOB/) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 189 | 0 | $self->throw("Cannot use filehandle as argument to run()"); | |||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||
| 191 | 0 | my $infile = $self->_writeSeqFile($query); | |||||||||||||||||||||||||||||||||
| 192 | 0 | return $self->_run($infile); | |||||||||||||||||||||||||||||||||
| 193 | } else { | ||||||||||||||||||||||||||||||||||
| 194 | 0 | return $self->_run($query); | |||||||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||
| 198 | =head2 align | ||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||
| 200 | Title : align | ||||||||||||||||||||||||||||||||||
| 201 | Usage : $obj->align($query) | ||||||||||||||||||||||||||||||||||
| 202 | Function: Alias to run() | ||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||
| 204 | =cut | ||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||
| 206 | sub align { | ||||||||||||||||||||||||||||||||||
| 207 | 0 | ▶ | return shift->run(@_); | ||||||||||||||||||||||||||||||||
|
Subroutine
align: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||
| 210 | =head2 db | ||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||
| 212 | =cut | ||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||
| 214 | sub db { | ||||||||||||||||||||||||||||||||||
| 215 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
db: called CC=2 SCAR=8.1
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 216 | 1 | ▶ | return $self->{blat_db} = shift if @_; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 217 | 0 | return $self->{blat_db}; | |||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||
| 220 | # this is a kludge for tests (so one might expect this to be used elsewhere). | ||||||||||||||||||||||||||||||||||
| 221 | # None of the other parameters worked in the past, so not replacing them | ||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||
| 223 | 1 | *DB = \&db; | |||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||
| 225 | =head2 qsegment | ||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||
| 227 | Title : qsegment | ||||||||||||||||||||||||||||||||||
| 228 | Usage : $obj->qsegment('sequence_a:0-1000') | ||||||||||||||||||||||||||||||||||
| 229 | Function : pass in a B<UCSC-compliant> string for the query sequence(s) | ||||||||||||||||||||||||||||||||||
| 230 | Returns : string | ||||||||||||||||||||||||||||||||||
| 231 | Args : string | ||||||||||||||||||||||||||||||||||
| 232 | Status : New | ||||||||||||||||||||||||||||||||||
| 233 | Note : Requires the sequence(s) in question be 2bit or nib format | ||||||||||||||||||||||||||||||||||
| 234 | Reminder : UCSC segment/regions coordinates are 0-based half-open (sequence | ||||||||||||||||||||||||||||||||||
| 235 | begins at 0, but start isn't counted with length), whereas BioPerl | ||||||||||||||||||||||||||||||||||
| 236 | coordinates are 1-based closed (sequence begins with 1, both start | ||||||||||||||||||||||||||||||||||
| 237 | and end are counted in the length of the segment). For example, a | ||||||||||||||||||||||||||||||||||
| 238 | segment that is 'sequence_a:0-1000' will have BioPerl coordinates of | ||||||||||||||||||||||||||||||||||
| 239 | 'sequence_a:1-1000', both with the same length (1000). | ||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||
| 241 | =cut | ||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||
| 243 | sub qsegment { | ||||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
qsegment: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | return $self->{blat_qsegment} = shift if @_; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 246 | 0 | return $self->{blat_qsegment}; | |||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||
| 249 | =head2 tsegment | ||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||
| 251 | Title : tsegment | ||||||||||||||||||||||||||||||||||
| 252 | Usage : $obj->tsegment('sequence_a:0-1000') | ||||||||||||||||||||||||||||||||||
| 253 | Function : pass in a B<UCSC-compliant> string for the target sequence(s) | ||||||||||||||||||||||||||||||||||
| 254 | Returns : string | ||||||||||||||||||||||||||||||||||
| 255 | Args : string | ||||||||||||||||||||||||||||||||||
| 256 | Status : New | ||||||||||||||||||||||||||||||||||
| 257 | Note : Requires the sequence(s) in question be 2bit or nib format | ||||||||||||||||||||||||||||||||||
| 258 | Reminder : UCSC segment/regions coordinates are 0-based half-open (sequence | ||||||||||||||||||||||||||||||||||
| 259 | begins at 0, but start isn't counted with length), whereas BioPerl | ||||||||||||||||||||||||||||||||||
| 260 | coordinates are 1-based closed (sequence begins with 1, both start | ||||||||||||||||||||||||||||||||||
| 261 | and end are counted in the length of the segment). For example, a | ||||||||||||||||||||||||||||||||||
| 262 | segment that is 'sequence_a:0-1000' will have BioPerl coordinates of | ||||||||||||||||||||||||||||||||||
| 263 | 'sequence_a:1-1000', both with the same length (1000). | ||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||
| 265 | =cut | ||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||
| 267 | sub tsegment { | ||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
tsegment: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 269 | 0 | ▶ | return $self->{blat_tsegment} = shift if @_; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 270 | 0 | return $self->{blat_tsegment}; | |||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||
| 273 | # override this, otherwise one gets a default of 'mlc' | ||||||||||||||||||||||||||||||||||
| 274 | sub outfile_name { | ||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
outfile_name: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | return $self->{blat_outfile} = shift if @_; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 277 | 0 | return $self->{blat_outfile}; | |||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||
| 280 | =head2 searchio | ||||||||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||||||||
| 282 | Title : searchio | ||||||||||||||||||||||||||||||||||
| 283 | Usage : $obj->searchio{-writer => $writer} | ||||||||||||||||||||||||||||||||||
| 284 | Function : Pass in additional parameters to the returned Bio::SearchIO parser | ||||||||||||||||||||||||||||||||||
| 285 | Returns : Hash reference with Bio::SearchIO parameters | ||||||||||||||||||||||||||||||||||
| 286 | Args : Hash reference | ||||||||||||||||||||||||||||||||||
| 287 | Status : New | ||||||||||||||||||||||||||||||||||
| 288 | Note : Currently, this implementation overrides any passed -format | ||||||||||||||||||||||||||||||||||
| 289 | parameter based on whether the output is changed ('out'). This | ||||||||||||||||||||||||||||||||||
| 290 | may change if requested, but we can't see the utility of doing so, | ||||||||||||||||||||||||||||||||||
| 291 | as requesting mismatched output/parser combinations is just a recipe | ||||||||||||||||||||||||||||||||||
| 292 | for disaster | ||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||
| 294 | =cut | ||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||
| 296 | sub searchio { | ||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | my ($self, $params) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
searchio: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | if ($params && ref $params eq 'HASH') { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$params and ref $params eq "HASH"
MC/DC0%0/2
$params and ref $params eq "HASH"
$params
ref $params eq "HASH"
Truth table0%0/3
A and B
A= $paramsB= ref $params eq "HASH"
| |||||||||||||||||||||||||||||||||||
| 299 | 0 | delete $params->{-format}; | |||||||||||||||||||||||||||||||||
| 300 | 0 | $self->{blat_searchio} = $params; | |||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||
| 302 | 0 | ▶ | return $self->{blat_searchio} || {}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'blat_searchio'} || {}
MC/DC0%0/1
$self->{'blat_searchio'} || {}
$self->{'blat_searchio'}
Truth table0%0/2
A
A= $self->{'blat_searchio'}
| |||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||
| 305 | =head1 Bio::ParameterBaseI-specific methods | ||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||
| 307 | These methods are part of the Bio::ParameterBaseI interface | ||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||
| 309 | =cut | ||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||
| 311 | =head2 set_parameters | ||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||
| 313 | Title : set_parameters | ||||||||||||||||||||||||||||||||||
| 314 | Usage : $pobj->set_parameters(%params); | ||||||||||||||||||||||||||||||||||
| 315 | Function: sets the parameters listed in the hash or array | ||||||||||||||||||||||||||||||||||
| 316 | Returns : None | ||||||||||||||||||||||||||||||||||
| 317 | Args : [optional] hash or array of parameter/values. These can optionally | ||||||||||||||||||||||||||||||||||
| 318 | be hash or array references | ||||||||||||||||||||||||||||||||||
| 319 | Note : This only sets parameters; to set methods use the method name | ||||||||||||||||||||||||||||||||||
| 320 | =cut | ||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||
| 322 | sub set_parameters { | ||||||||||||||||||||||||||||||||||
| 323 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
set_parameters: called CC=9 SCAR=27.5
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 324 | # circumvent any issues arising from passing in refs | ||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | my %args = (ref($_[0]) eq 'HASH') ? %{$_[0]} : | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 326 | 1 | ▶ | (ref($_[0]) eq 'ARRAY') ? @{$_[0]} : | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 327 | @_; | ||||||||||||||||||||||||||||||||||
| 328 | # set the parameters passed in, but only ones supported for the program | ||||||||||||||||||||||||||||||||||
| 329 | 1 | %args = map { my $a = $_; | |||||||||||||||||||||||||||||||||
| 330 | 2 | $a =~ s{^-}{}; | |||||||||||||||||||||||||||||||||
| 331 | 2 | $a => $args{$_}; | |||||||||||||||||||||||||||||||||
| 332 | } sort keys %args; | ||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||
| 334 | 1 | ▶ | while (my ($key, $val) = each %args) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 335 | 2 | ▶ | if (exists $BLAT_PARAMS{$key}) { | ||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||
| 336 | 0 | $self->{parameters}->{$key} = $val; | |||||||||||||||||||||||||||||||||
| 337 | } elsif (exists $BLAT_SWITCHES{$key}) { | ||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | $self->{parameters}->{$key} = $BLAT_SWITCHES{$key} ? 1 : 0; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 339 | ▶ | } elsif ($LOCAL_ATTRIBUTES{$key} && $self->can($key)) { | |||||||||||||||||||||||||||||||||
|
Condition33%1/3
$Bio::Tools::Run::Alignment::Blat::LOCAL_ATTRIBUTES{$key} and $self->can($key)
MC/DC0%0/2
$Bio::Tools::Run::Alignment::Blat::LOCAL_ATTRIBUTES{$key} and $self->can($key)
$Bio::Tools::Run::Alignment::Blat::LOCAL_ATTRIBUTES{$key}
$self->can($key)
Truth table33%1/3
A and B
A= $Bio::Tools::Run::Alignment::Blat::LOCAL_ATTRIBUTES{$key}B= $self->can($key)
| |||||||||||||||||||||||||||||||||||
| 340 | 2 | $self->$key($val); | |||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||
| 345 | =head2 reset_parameters | ||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||
| 347 | Title : reset_parameters | ||||||||||||||||||||||||||||||||||
| 348 | Usage : resets values | ||||||||||||||||||||||||||||||||||
| 349 | Function: resets parameters to either undef or value in passed hash | ||||||||||||||||||||||||||||||||||
| 350 | Returns : none | ||||||||||||||||||||||||||||||||||
| 351 | Args : [optional] hash of parameter-value pairs | ||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||
| 353 | =cut | ||||||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||||||
| 355 | sub reset_parameters { | ||||||||||||||||||||||||||||||||||
| 356 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
reset_parameters: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 357 | 0 | delete $self->{parameters}; | |||||||||||||||||||||||||||||||||
| 358 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 359 | 0 | $self->set_parameters(@_); | |||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||
| 363 | =head2 validate_parameters | ||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||
| 365 | Title : validate_parameters | ||||||||||||||||||||||||||||||||||
| 366 | Usage : $pobj->validate_parameters(1); | ||||||||||||||||||||||||||||||||||
| 367 | Function: sets a flag indicating whether to validate parameters via | ||||||||||||||||||||||||||||||||||
| 368 | set_parameters() or reset_parameters() | ||||||||||||||||||||||||||||||||||
| 369 | Returns : Bool | ||||||||||||||||||||||||||||||||||
| 370 | Args : [optional] value evaluating to True/False | ||||||||||||||||||||||||||||||||||
| 371 | Note : NYI | ||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||
| 373 | =cut | ||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||
| 375 | 0 | ▶ | sub validate_parameters { 0 } | ||||||||||||||||||||||||||||||||
|
Subroutine
validate_parameters: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||
| 377 | =head2 parameters_changed | ||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||
| 379 | Title : parameters_changed | ||||||||||||||||||||||||||||||||||
| 380 | Usage : if ($pobj->parameters_changed) {...} | ||||||||||||||||||||||||||||||||||
| 381 | Function: Returns boolean true (1) if parameters have changed | ||||||||||||||||||||||||||||||||||
| 382 | Returns : Boolean (0 or 1) | ||||||||||||||||||||||||||||||||||
| 383 | Args : None | ||||||||||||||||||||||||||||||||||
| 384 | Note : This module does not run state checks, so this always returns True | ||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||
| 386 | =cut | ||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||
| 388 | 0 | ▶ | sub parameters_changed { 1 } | ||||||||||||||||||||||||||||||||
|
Subroutine
parameters_changed: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||
| 390 | =head2 available_parameters | ||||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||||
| 392 | Title : available_parameters | ||||||||||||||||||||||||||||||||||
| 393 | Usage : @params = $pobj->available_parameters() | ||||||||||||||||||||||||||||||||||
| 394 | Function: Returns a list of the available parameters | ||||||||||||||||||||||||||||||||||
| 395 | Returns : Array of parameters | ||||||||||||||||||||||||||||||||||
| 396 | Args : [optional] name of executable being used; defaults to returning all | ||||||||||||||||||||||||||||||||||
| 397 | available parameters | ||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||
| 399 | =cut | ||||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||
| 401 | sub available_parameters { | ||||||||||||||||||||||||||||||||||
| 402 | 0 | ▶ | my ($self, $exec) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
available_parameters: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 403 | 0 | my @params = (sort keys %BLAT_PARAMS, sort keys %BLAT_SWITCHES); | |||||||||||||||||||||||||||||||||
| 404 | 0 | return @params; | |||||||||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||
| 407 | =head2 get_parameters | ||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||
| 409 | Title : get_parameters | ||||||||||||||||||||||||||||||||||
| 410 | Usage : %params = $pobj->get_parameters; | ||||||||||||||||||||||||||||||||||
| 411 | Function: Returns list of set key-value pairs, parameter => value | ||||||||||||||||||||||||||||||||||
| 412 | Returns : List of key-value pairs | ||||||||||||||||||||||||||||||||||
| 413 | Args : none | ||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||
| 415 | =cut | ||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||
| 417 | sub get_parameters { | ||||||||||||||||||||||||||||||||||
| 418 | 0 | ▶ | my ($self, $option) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
get_parameters: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | $option ||= ''; # no option | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
$option ||= ""
MC/DC0%0/1
$option ||= ""
$option
Truth table0%0/2
A
A= $option
| |||||||||||||||||||||||||||||||||||
| 420 | 0 | my %params; | |||||||||||||||||||||||||||||||||
| 421 | 0 | ▶ | if (exists $self->{parameters}) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 422 | 0 | %params = map {$_ => $self->{parameters}->{$_}} sort keys %{$self->{parameters}}; | |||||||||||||||||||||||||||||||||
| 423 | } else { | ||||||||||||||||||||||||||||||||||
| 424 | 0 | %params = (); | |||||||||||||||||||||||||||||||||
| 425 | } | ||||||||||||||||||||||||||||||||||
| 426 | 0 | return %params; | |||||||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||||||||
| 429 | =head1 to_* methods | ||||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||||
| 431 | All to_* methods are implementation-specific | ||||||||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||||||||
| 433 | =cut | ||||||||||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||||||||
| 435 | =head2 to_exe_string | ||||||||||||||||||||||||||||||||||
| 436 | |||||||||||||||||||||||||||||||||||
| 437 | Title : to_exe_string | ||||||||||||||||||||||||||||||||||
| 438 | Usage : $string = $pobj->to_exe_string; | ||||||||||||||||||||||||||||||||||
| 439 | Function: Returns string (command line string in this case) | ||||||||||||||||||||||||||||||||||
| 440 | Returns : String | ||||||||||||||||||||||||||||||||||
| 441 | Args : | ||||||||||||||||||||||||||||||||||
| 442 | |||||||||||||||||||||||||||||||||||
| 443 | =cut | ||||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||||
| 445 | sub to_exe_string { | ||||||||||||||||||||||||||||||||||
| 446 | 0 | ▶ | my ($self, @passed) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
to_exe_string: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 447 | 0 | my ($seq) = $self->_rearrange([qw(SEQ_FILE)], @passed); | |||||||||||||||||||||||||||||||||
| 448 | 0 | ▶ | $self->throw("Must provide a seq_file") unless defined $seq; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 449 | 0 | my %params = $self->get_parameters(); | |||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||
| 451 | 0 | my ($exe, $db, $qseg, $tseg) = ($self->executable, | |||||||||||||||||||||||||||||||||
| 452 | $self->db, | ||||||||||||||||||||||||||||||||||
| 453 | $self->qsegment, | ||||||||||||||||||||||||||||||||||
| 454 | $self->tsegment); | ||||||||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||||||||
| 456 | 0 | ▶ | $self->throw("Executable not found") unless defined($exe); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||||||||
| 458 | 0 | ▶ | if ($tseg) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 459 | 0 | $db .= ":$tseg"; | |||||||||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||
| 462 | 0 | ▶ | if ($qseg) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 463 | 0 | $seq .= ":$qseg"; | |||||||||||||||||||||||||||||||||
| 464 | } | ||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||
| 466 | 0 | my @params; | |||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||
| 468 | 0 | for my $p (sort keys %BLAT_SWITCHES) { | |||||||||||||||||||||||||||||||||
| 469 | 0 | ▶ | if (exists $params{$p}) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 470 | 0 | push @params, "-$p" | |||||||||||||||||||||||||||||||||
| 471 | } | ||||||||||||||||||||||||||||||||||
| 472 | } | ||||||||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||||||
| 474 | 0 | for my $p (sort keys %BLAT_PARAMS) { | |||||||||||||||||||||||||||||||||
| 475 | 0 | ▶ | if (exists $params{$p}) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 476 | 0 | push @params, "-$p=$params{$p}" | |||||||||||||||||||||||||||||||||
| 477 | } | ||||||||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||||||||
| 480 | # this only passes in the first seq file (no globs are allow AFAIK) | ||||||||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||||||||
| 482 | 0 | push @params, ($db, $seq); | |||||||||||||||||||||||||||||||||
| 483 | |||||||||||||||||||||||||||||||||||
| 484 | # quiet! Unfortunately, it is NYI | ||||||||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||||||||
| 486 | 0 | my $string = "$exe ".join(' ',@params); | |||||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||||||
| 488 | 0 | $string; | |||||||||||||||||||||||||||||||||
| 489 | } | ||||||||||||||||||||||||||||||||||
| 490 | |||||||||||||||||||||||||||||||||||
| 491 | #=head2 _input | ||||||||||||||||||||||||||||||||||
| 492 | # | ||||||||||||||||||||||||||||||||||
| 493 | # Title : _input | ||||||||||||||||||||||||||||||||||
| 494 | # Usage : obj->_input($seqFile) | ||||||||||||||||||||||||||||||||||
| 495 | # Function: Internal (not to be used directly) | ||||||||||||||||||||||||||||||||||
| 496 | # Returns : | ||||||||||||||||||||||||||||||||||
| 497 | # Args : | ||||||||||||||||||||||||||||||||||
| 498 | # | ||||||||||||||||||||||||||||||||||
| 499 | #=cut | ||||||||||||||||||||||||||||||||||
| 500 | |||||||||||||||||||||||||||||||||||
| 501 | sub _input() { | ||||||||||||||||||||||||||||||||||
| 502 | 0 | ▶ | my ($self,$infile1) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
_input: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||
| 503 | 0 | ▶ | if(defined $infile1){ | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 504 | 0 | $self->{'input'}=$infile1; | |||||||||||||||||||||||||||||||||
| 505 | } | ||||||||||||||||||||||||||||||||||
| 506 | 0 | return $self->{'input'}; | |||||||||||||||||||||||||||||||||
| 507 | } | ||||||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||||
| 509 | #=head2 _database | ||||||||||||||||||||||||||||||||||
| 510 | # | ||||||||||||||||||||||||||||||||||
| 511 | # Title : _database | ||||||||||||||||||||||||||||||||||
| 512 | # Usage : obj->_database($seqFile) | ||||||||||||||||||||||||||||||||||
| 513 | # Function: Internal (not to be used directly) | ||||||||||||||||||||||||||||||||||
| 514 | # Returns : | ||||||||||||||||||||||||||||||||||
| 515 | # Args : | ||||||||||||||||||||||||||||||||||
| 516 | # | ||||||||||||||||||||||||||||||||||
| 517 | #=cut | ||||||||||||||||||||||||||||||||||
| 518 | |||||||||||||||||||||||||||||||||||
| 519 | sub _database() { | ||||||||||||||||||||||||||||||||||
| 520 | 0 | ▶ | my ($self,$infile1) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
_database: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||
| 521 | 0 | ▶ | $self->{'db'} = $infile1 if(defined $infile1); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 522 | 0 | return $self->{'db'}; | |||||||||||||||||||||||||||||||||
| 523 | } | ||||||||||||||||||||||||||||||||||
| 524 | |||||||||||||||||||||||||||||||||||
| 525 | |||||||||||||||||||||||||||||||||||
| 526 | #=head2 _run | ||||||||||||||||||||||||||||||||||
| 527 | # | ||||||||||||||||||||||||||||||||||
| 528 | # Title : _run | ||||||||||||||||||||||||||||||||||
| 529 | # Usage : $obj->_run() | ||||||||||||||||||||||||||||||||||
| 530 | # Function: Internal (not to be used directly) | ||||||||||||||||||||||||||||||||||
| 531 | # Returns : An array of Bio::SeqFeature::Generic objects | ||||||||||||||||||||||||||||||||||
| 532 | # Args : | ||||||||||||||||||||||||||||||||||
| 533 | # | ||||||||||||||||||||||||||||||||||
| 534 | #=cut | ||||||||||||||||||||||||||||||||||
| 535 | |||||||||||||||||||||||||||||||||||
| 536 | sub _run { | ||||||||||||||||||||||||||||||||||
| 537 | 0 | ▶ | my ($self)= shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
_run: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||
| 538 | 0 | my $str = $self->to_exe_string(-seq_file => shift); | |||||||||||||||||||||||||||||||||
| 539 | |||||||||||||||||||||||||||||||||||
| 540 | 0 | ▶ | my $out = $self->outfile_name || $self->_tempfile; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$self->outfile_name || $self->_tempfile
MC/DC0%0/2
$self->outfile_name || $self->_tempfile
$self->outfile_name
$self->_tempfile
Truth table0%0/3
A || B
A= $self->outfile_nameB= $self->_tempfile
| |||||||||||||||||||||||||||||||||||
| 541 | |||||||||||||||||||||||||||||||||||
| 542 | 0 | $str .= " $out".$self->_quiet; | |||||||||||||||||||||||||||||||||
| 543 | 0 | ▶ | $self->debug($str."\n") if( $self->verbose > 0 ); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 544 | |||||||||||||||||||||||||||||||||||
| 545 | 0 | my %params = $self->get_parameters; | |||||||||||||||||||||||||||||||||
| 546 | |||||||||||||||||||||||||||||||||||
| 547 | 0 | my $status = system($str); | |||||||||||||||||||||||||||||||||
| 548 | 0 | ▶ | $self->throw( "Blat call ($str) crashed: $? \n") unless $status==0; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 549 | |||||||||||||||||||||||||||||||||||
| 550 | my $format = exists($params{out}) ? | ||||||||||||||||||||||||||||||||||
| 551 | 0 | ▶ | $searchio_map{$params{out}} : 'psl'; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 552 | |||||||||||||||||||||||||||||||||||
| 553 | 0 | ▶ | my @io = ref ($out) !~ /GLOB/ ? (-file => $out,) : (-fh => $out,); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 554 | 0 | ▶ | my $blat_obj = Bio::SearchIO->new(%{$self->searchio}, | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/4
$params{"q"} or "dna"
$params{"t"} or "dna"
MC/DC0%0/1
$params{"q"} or "dna"
$params{"q"}
MC/DC0%0/1
$params{"t"} or "dna"
$params{"t"}
Truth table0%0/2
A
A= $params{"q"}
Truth table0%0/2
A
A= $params{"t"}
| |||||||||||||||||||||||||||||||||||
| 555 | @io, | ||||||||||||||||||||||||||||||||||
| 556 | -query_type => $params{prot} ? 'protein' : | ||||||||||||||||||||||||||||||||||
| 557 | $params{q} || 'dna', | ||||||||||||||||||||||||||||||||||
| 558 | -hit_type => $params{prot} ? 'protein' : | ||||||||||||||||||||||||||||||||||
| 559 | 0 | $params{t} || 'dna', | |||||||||||||||||||||||||||||||||
| 560 | -format => $format); | ||||||||||||||||||||||||||||||||||
| 561 | 0 | return $blat_obj; | |||||||||||||||||||||||||||||||||
| 562 | } | ||||||||||||||||||||||||||||||||||
| 563 | |||||||||||||||||||||||||||||||||||
| 564 | |||||||||||||||||||||||||||||||||||
| 565 | #=head2 _writeSeqFile | ||||||||||||||||||||||||||||||||||
| 566 | # | ||||||||||||||||||||||||||||||||||
| 567 | # Title : _writeSeqFile | ||||||||||||||||||||||||||||||||||
| 568 | # Usage : obj->_writeSeqFile($seq) | ||||||||||||||||||||||||||||||||||
| 569 | # Function: Internal (not to be used directly) | ||||||||||||||||||||||||||||||||||
| 570 | # Returns : | ||||||||||||||||||||||||||||||||||
| 571 | # Args : | ||||||||||||||||||||||||||||||||||
| 572 | # | ||||||||||||||||||||||||||||||||||
| 573 | #=cut | ||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||
| 575 | sub _writeSeqFile { | ||||||||||||||||||||||||||||||||||
| 576 | 0 | ▶ | my ($self,$seq) = @_; | ||||||||||||||||||||||||||||||||
|
Subroutine
_writeSeqFile: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||
| 577 | 0 | my ($tfh,$inputfile) = $self->io->tempfile(-dir=>$Bio::Root::IO::TEMPDIR); | |||||||||||||||||||||||||||||||||
| 578 | 0 | my $in = Bio::SeqIO->new(-fh => $tfh , '-format' => 'fasta'); | |||||||||||||||||||||||||||||||||
| 579 | 0 | $in->write_seq($seq); | |||||||||||||||||||||||||||||||||
| 580 | 0 | $in->close(); | |||||||||||||||||||||||||||||||||
| 581 | 0 | return $inputfile; | |||||||||||||||||||||||||||||||||
| 582 | } | ||||||||||||||||||||||||||||||||||
| 583 | |||||||||||||||||||||||||||||||||||
| 584 | sub _tempfile { | ||||||||||||||||||||||||||||||||||
| 585 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
_tempfile: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||
| 586 | 0 | my ($tfh,$outfile) = $self->io->tempfile(-dir=>$Bio::Root::IO::TEMPDIR); | |||||||||||||||||||||||||||||||||
| 587 | # this is because we only want a unique filename | ||||||||||||||||||||||||||||||||||
| 588 | 0 | close($tfh); | |||||||||||||||||||||||||||||||||
| 589 | 0 | return $outfile; | |||||||||||||||||||||||||||||||||
| 590 | } | ||||||||||||||||||||||||||||||||||
| 591 | |||||||||||||||||||||||||||||||||||
| 592 | sub _quiet { | ||||||||||||||||||||||||||||||||||
| 593 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
_quiet: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||
| 594 | 0 | my $q = ''; | |||||||||||||||||||||||||||||||||
| 595 | # BLAT output goes to a file, all other output is STDOUT | ||||||||||||||||||||||||||||||||||
| 596 | 0 | ▶ | if ($self->quiet) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 597 | 0 | ▶ | $q = $^O =~ /Win/i ? ' 2>&1 NUL' : ' > /dev/null 2>&1'; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 598 | } | ||||||||||||||||||||||||||||||||||
| 599 | 0 | $q; | |||||||||||||||||||||||||||||||||
| 600 | } | ||||||||||||||||||||||||||||||||||
| 601 | |||||||||||||||||||||||||||||||||||
| 602 | 1 | 1; | |||||||||||||||||||||||||||||||||