Bio-MUST-Drivers
view release on metacpan or search on metacpan
lib/Bio/MUST/Drivers/ClustalO.pm view on Meta::CPAN
package Bio::MUST::Drivers::ClustalO;
# ABSTRACT: Bio::MUST driver for running the Clustal Omega program
# CONTRIBUTOR: Amandine BERTRAND <amandine.bertrand@doct.uliege.be>
$Bio::MUST::Drivers::ClustalO::VERSION = '0.252830';
use Moose;
use namespace::autoclean;
use autodie;
use feature qw(say);
# use Smart::Comments;
use Carp;
use IPC::System::Simple qw(system);
use Module::Runtime qw(use_module);
use Path::Class qw(file);
use Bio::MUST::Core;
extends 'Bio::FastParsers::Base';
use Bio::MUST::Drivers::Utils qw(stringify_args);
use aliased 'Bio::MUST::Core::Ali';
sub align_all { ## no critic (RequireArgUnpacking)
#### in align_all
return shift->_clustalo('align_all', @_);
}
sub seqs2profile { ## no critic (RequireArgUnpacking)
#### in seqs2profile
my $self = shift;
carp '[BMD] Warning: align seqs before aligning on profile!'
unless Ali->load( $self->file )->is_aligned;
return $self->_clustalo('seqs2profile', @_);
}
sub profile2profile { ## no critic (RequireArgUnpacking)
#### in profile2profile
return shift->_clustalo('profile2profile', @_);
}
sub _clustalo {
#### in _clustalo
my $self = shift;
my $mode = shift;
my $profile; # conditional declaring is bad...
$profile = shift unless $mode eq 'align_all';
my $args = shift // {};
# provision executable
my $app = use_module('Bio::MUST::Provision::ClustalO')->new;
$app->meet();
# setup input/output files
my $infile = $self->filename;
my $outfile = $infile . '.clustalo';
$args->{-o} = $outfile;
$args->{ $mode eq 'profile2profile' ? '--p1' : '-i' } = $infile;
$args->{ $mode eq 'profile2profile' ? '--p2' : '--p1' } = $profile
if $profile;
my $args_str = stringify_args($args);
( run in 0.622 second using v1.01-cache-2.11-cpan-39bf76dae61 )