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
| #!/usr/bin/perl/
use strict;
use warnings;
use Bio::SeqIO;
my @liste_file = ("../resultats/jeu_test_c-jun_human.fa", "../resultats/jeu_test_c-jun_mouse.fa", "../resultats/jeu_test_sp1_human.fa", "../resultats/jeu_test_sp1_mouse.fa");
my $rx_sp1_att = "[GAT][GA]G[GT][CAT][GTC][GC][GAC]";
my $rx_sp1_find = "[GA]GG[ACT][GT]GG";
my $rx_c_jun_att = "TGA[CGA][TGC][CTA][AC]";
my $rx_c_jun_find = "[GTA][GA][TGC]GAC[GTA]";
foreach my $file (@liste_file)
{
my ($FT, $esp) = ($file =~ m/jeu_test_(.+)_(human|mouse)\.fa/);
my $file_res = "../resultats/jeu_test_$FT"."_$esp"."_annote.txt";
open(RES, '>', $file_res) or die("Impossible d'ouvrir $file_res\n");
my $seqio = Bio::SeqIO->new( '-format' => 'fasta' , -file => $file, -alphabet => 'dna');
while(my $seqobj = $seqio->next_seq())
{
my $seq = $seqobj->seq();
my $name = $seqobj->display_name();
print(RES "\n>$name\n$seq\n");
if($FT eq "c-jun")
{
&rech_motif($rx_c_jun_att, $rx_c_jun_find, $seq);
}
elsif($FT eq "sp1")
{
&rech_motif($rx_sp1_att, $rx_sp1_find, $seq);
}
}
close(RES);
}
sub rech_motif
{
my ($motif_att, $motif_find, $seq) = @_;
print(RES "\nRecherche du motif 'connu' :\n\tmotif trouve\tposition\n");
while ($seq =~ m/($motif_att)/gi)
{
print(RES "\t$1\t$-[1]\n");
}
print(RES "\nRecherche du motif trouve par PhyME :\n\tmotif trouve\tposition\n");
while ($seq =~ m/($motif_find)/gi)
{
print(RES "\t$1\t$-[1]\n");
}
} |
Partager