1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| #!/usr/local/bin/perl
#---------------------------- RunClustalW.pl -----------------------------#
# Prend en entrée des séquences en forma FASTA et donne en retour
# l'alignement effectué par ClustalW dans un nouveau fichier FASTA
#---------------------------- RunClustalW.pl -----------------------------#
use strict;
use warnings;
use Time::localtime;
# Paramètre de temps
#---------------------
my $Date = ctime();
BEGIN { $ENV{CLUSTALDIR} = 'C:/Clustalw/' }
use Bio::Tools::Run::Alignment::Clustalw;
my $File = "NomFichier";
my @params = ('ktuple' => 4, 'type' => 'dna', 'outfile' => "P:/Perl/scripts/Files/$File.msf");
my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
my $str = Bio::SeqIO->new(-file=> "P:/Perl/scripts/Files/$File.txt", -format => 'Fasta');
my @seq_array =();
while ( my $seq = $str->next_seq() )
{
push (@seq_array, $seq) ;
}
my $seq_array_ref = \@seq_array;
my $aln = $factory->align($seq_array_ref);
#BILAN
#------
print "\n\n\$aln de type\t$aln\n\n";
print "\n\n\n----------------------------\n------- DESCRIPTEURS -------\n----------------------------\n";
print "Longueur\t". $aln->length, "\n";
print "Nbr de résidus\t". $aln->no_residues, "\n";
print "Flush\t". $aln->is_flush, "\n";
print "Nbr de séquences\t". $aln->no_sequences, "\n";
print "Pourcentage d'identité\t". $aln->percentage_identity, "\n";
print "\n\n\n-------------\n--- TEMPS ---\n-------------\n";
my $Fin = ctime();
print "\nDépart\t=>".$Date."\nFin\t=>".$Fin."\n";
close; |