3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
20 package XrefMapper::Methods::LocalExonerateGappedBest1;
31 our $exonerate_path =
'exonerate'; # Make sure exonerate binary is in
36 return (
'--model',
'affine:local',
'--subopt',
'no',
'--bestn',
'1');
40 sub query_identity_threshold {
46 sub target_identity_threshold {
53 my ($self, $query, $target, $root_dir, @options) = @_;
55 # Exonerate can run individual chunks of a large job.
56 # Determine the number of chunks that will be used, and add to total
59 $self->jobcount($self->jobcount()+$num_jobs);
61 # Determine the output filename
62 my $queryfile = basename($query);
63 my $targetfile = basename($target);
64 my $query_alphabet = $queryfile =~ /peptide/ ?
'peptide' :
'dna';
65 my $outfile = join(
'_',
66 $self->get_class_name() ,
68 q[%s.map] # Substitute the chunk ID
71 # Build a template representing the exonerate command
72 my $options_str = join(
" ", @options);
73 my $exonerate_command = join
78 qq[--querychunktotal $num_jobs],
79 q [--querychunkid %s], # Substitute the chunk ID
80 q [--showvulgar
false],
81 q [--showalignment FALSE],
84 my $ryo_format =
'xref:%qi:%ti:%ei:%ql:%tl:%qab:%qae:%tab:%tae:%C:%s\n';
85 my $shell_command = qq[%s \\\n| grep
'^xref' \\\n> %s/%s];
87 # Run exonerate for each job chunk
88 foreach( my $i=1; $i<=$num_jobs; $i++ ){
89 my $command = sprintf( $shell_command,
90 sprintf($exonerate_command, $i, $ryo_format),
92 sprintf($outfile, $i) );
93 my $status = system( $command );
94 unless( $status == 0 ){ warn(
"Bad exit status ($?) from:\n $command" )}
98 sub submit_depend_job{