File Coverage

blib/lib/Bio/MUST/Apps/TwoScalp/Seqs2Profile.pm
Criterion Covered Total %
statement 54 67 80.6
branch n/a
condition n/a
subroutine 18 19 94.7
pod 0 1 0.0
total 72 87 82.7


line stmt bran cond sub pod time code
1             package Bio::MUST::Apps::TwoScalp::Seqs2Profile;
2             # ABSTRACT: internal class for two-scalp tool
3             # CONTRIBUTOR: Amandine BERTRAND <amandine.bertrand@doct.uliege.be>
4             $Bio::MUST::Apps::TwoScalp::Seqs2Profile::VERSION = '0.201810';
5 1     1   39 use Moose;
  1         3  
  1         10  
6 1     1   7497 use namespace::autoclean;
  1         2  
  1         15  
7              
8 1     1   102 use autodie;
  1         4  
  1         10  
9 1     1   5728 use feature qw(say);
  1         3  
  1         106  
10              
11 1     1   8 use Smart::Comments '###';
  1         36  
  1         13  
12              
13 1     1   788 use List::AllUtils qw(part);
  1         2  
  1         69  
14              
15 1     1   6 use Bio::MUST::Core;
  1         2  
  1         42  
16 1     1   7 use Bio::MUST::Core::Constants qw(:gaps);
  1         3  
  1         172  
17 1     1   7 use Bio::MUST::Core::Utils qw(secure_outfile);
  1         2  
  1         66  
18              
19 1     1   7 use aliased 'Bio::MUST::Core::Ali';
  1         2  
  1         10  
20 1     1   243 use aliased 'Bio::MUST::Core::Seq';
  1         3  
  1         4  
21 1     1   204 use aliased 'Bio::MUST::Core::SeqId';
  1         3  
  1         3  
22 1     1   215 use aliased 'Bio::MUST::Core::SeqMask';
  1         3  
  1         3  
23 1     1   209 use aliased 'Bio::MUST::Drivers::Blast::Database::Temporary';
  1         3  
  1         5  
24             #use aliased 'Bio::MUST::Drivers::Blast::Query';
25 1     1   243 use aliased 'Bio::MUST::Drivers::Mafft';
  1         3  
  1         4  
26 1     1   189 use aliased 'Bio::MUST::Drivers::ClustalO';
  1         3  
  1         3  
27 1     1   196 use aliased 'Bio::MUST::Apps::SlaveAligner::Local';
  1         2  
  1         15  
28 1     1   186 use aliased 'Bio::MUST::Core::IdList';
  1         2  
  1         4  
29              
30              
31             has 'file1' => (
32             is => 'ro',
33             isa => 'Bio::MUST::Core::Ali',
34             required => 1,
35             coerce => 1,
36             );
37              
38             has 'file2' => (
39             is => 'ro',
40             isa => 'Bio::MUST::Core::Ali',
41             required => 1,
42             coerce => 1,
43             );
44              
45              
46             has 'ali' => (
47             is => 'ro',
48             isa => 'Bio::MUST::Core::Ali',
49             init_arg => undef,
50             writer => '_set_ali',
51             handles => qr{.*}xms,
52             );
53              
54             sub BUILD {
55 0     0 0   my $self = shift;
56              
57 0           my $ali1 = $self->file1;
58 0           my $ali2 = $self->file2;
59              
60 0           my ($filename1, $id_mapper1) = $ali1->temp_fasta( {id_prefix => 'file1-'} );
61 0           my ($filename2, $id_mapper2) = $ali2->temp_fasta( {id_prefix => 'file2-'} );
62              
63 0           my %mapper = ( ali1 => $id_mapper1, ali2 => $id_mapper2 );
64              
65 0           my $mafft = Mafft->new( file => $filename1 ); # add an option to use clustalo if wanted ?
66 0           my $ali_out = $mafft->seqs2profile($filename2);
67              
68 0           $ali_out->dont_guess;
69 0           $ali_out->restore_ids($mapper{ali1});
70 0           $ali_out->restore_ids($mapper{ali2});
71              
72 0           $self->_set_ali($ali_out);
73              
74 0           return;
75             }
76             __PACKAGE__->meta->make_immutable;
77             1;
78              
79             __END__
80              
81             =pod
82              
83             =head1 NAME
84              
85             Bio::MUST::Apps::TwoScalp::Seqs2Profile - internal class for two-scalp tool
86              
87             =head1 VERSION
88              
89             version 0.201810
90              
91             =head1 SYNOPSIS
92              
93             # TODO
94              
95             =head1 DESCRIPTION
96              
97             # TODO
98              
99             =head1 AUTHOR
100              
101             Denis BAURAIN <denis.baurain@uliege.be>
102              
103             =head1 CONTRIBUTOR
104              
105             =for stopwords Amandine BERTRAND
106              
107             Amandine BERTRAND <amandine.bertrand@doct.uliege.be>
108              
109             =head1 COPYRIGHT AND LICENSE
110              
111             This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN.
112              
113             This is free software; you can redistribute it and/or modify it under
114             the same terms as the Perl 5 programming language system itself.
115              
116             =cut