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
| #!/usr/local/bin/perl
use strict;
use warnings;
my $amorce = 'ATGGTMCAGATTCRCHTTC ';
my @a_amorces = split ('', $amorce);
my %h_amorces;
my %correspondances =
(
'R' => ['A', 'G'],
'K' => ['G', 'T'],
'S' => ['C', 'G'],
'W' => ['A', 'T'],
'M' => ['A', 'C'],
'Y' => ['C', 'T'],
'D' => ['A', 'G', 'T'],
'V' => ['A', 'C', 'G'],
'B' => ['C', 'G', 'T'],
'H' => ['A', 'C', 'T'],
'N' => ['A', 'C', 'G', 'T'],
);
my $amorce_cle;
foreach my $nucleotide (@a_amorces){
if (exists $correspondances{$nucleotide}){
my @a_degenerescence = $correspondances{$nucleotide};
foreach my $deg (@a_degenerescence){
push (@a_amorces_cles, $amorce_cle.$deg);
}
}
else{
$amorce_cle .= $nucleotide;
}
} |
Partager