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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| #!/usr/bin/perl
use strict;
use warnings;
use Bio::Tools::Run::Primer3;
use Bio::Tools::Primer3;
use Bio::SeqIO;
# Fichier sequence consensus (Pense à remplacer les ? par des N)
my $FichierSequenceConsensus = "C:/Documents and Settings/commun/Bureau/testpierremieux.fas" ;#or die "impossible de definir notre sequence";
my $seqio = Bio::SeqIO->new( -file => $FichierSequenceConsensus,
-format => 'fasta');
my $seq = $seqio->next_seq;
my $primer3 = Bio::Tools::Run::Primer3->new(
-seq => $seq,
-outfile => "C:/Documents and Settings/commun/Mes documents/Stage Pierre VILLARD/primer.out",
-path => "C:/Documents and Settings/commun/Mes documents/Stage Pierre VILLARD/fichier dinstallation des programmes necessaires/primer3.2.3.2/bin/primer3_core",
);
# Exemple de parametres
my %parametre = (
PRIMER_OPT_SIZE => 20,
PRIMER_MIN_SIZE => 18,
PRIMER_MAX_SIZE => 27,
PRIMER_NUM_NS_ACCEPTED => 0, # default : 1
PRIMER_FILE_FLAG => 1,
PRIMER_PICK_INTERNAL_OLIGO => 1,
PRIMER_EXPLAIN_FLAG => 1,
PRIMER_PICK_INTERNAL_OLIGO => 1, # recherche sonde (bolean : default 0)
PRIMER_OPT_TM => 60, # (float, default 60.0C)
PRIMER_MIN_TM => 57, # (float, default 57.0C)
PRIMER_MAX_TM => 66, # (float, default 63.0C)
PRIMER_MAX_DIFF_TM => 2, # (float, default 100.0C)
PRIMER_MAX_POLY_X => 5, # (int, default 5)
PRIMER_SALT_CONC => 50, # (float, default 50.0 mM)
PRIMER_DNA_CONC => 330, # (float, default 50.0 nM)
PRIMER_LIBERAL_BASE => 1, # (boolean, default 0)
);
# On applique ces paramètres
foreach ( keys %parametre ) {
$primer3->add_targets( $_ => $parametre{$_}, );
}
# Lancement de primer3
my $resultats_primer3 = $primer3->run or die "impossible de lancer primer3";
# Nombre de résultat
my $NombreResultat = $resultats_primer3->number_of_results;
print "Il y a $NombreResultat resultats\n";
# Lecture des résultats
printf( "%-13s %-10s %-10s %-7s %-8s %-7s %-5s %-10s\n",
'OLIGO', 'Start', 'Longeur', 'TM', 'Any', '%GC', "3'", 'Sequence' );
for ( 0 .. $NombreResultat - 1 ) {
my $resultats = $resultats_primer3->primer_results($_);
# PRIMER_LEFT
my ( $start_left, $len_left ) = split( ',', $resultats->{PRIMER_LEFT} );
printf(
"%-13s %-10s %-10s %-7s %-8s %-7s %-5s %-10s\n",
'LEFT PRIMER', $start_left,
$len_left, $resultats->{PRIMER_LEFT_TM},
$resultats->{PRIMER_LEFT_GC_PERCENT}, $resultats->{PRIMER_LEFT_SELF_ANY},
$resultats->{PRIMER_LEFT_SELF_END}, $resultats->{PRIMER_LEFT_SEQUENCE}
);
# PRIMER_RIGHT
my ( $start_right, $len_right ) = split( ',', $resultats->{PRIMER_RIGHT} );
printf(
"%-13s %-10s %-10s %-7s %-8s %-7s %-5s %-10s\n\n",
'RIGHT PRIMER', $start_right,
$len_right, $resultats->{PRIMER_RIGHT_TM},
$resultats->{PRIMER_RIGHT_GC_PERCENT}, $resultats->{PRIMER_RIGHT_SELF_ANY},
$resultats->{PRIMER_RIGHT_SELF_END}, $resultats->{PRIMER_RIGHT_SEQUENCE}
);
} |
Partager