bonjour,

* Cela fait un moment que je bloque sur une expression régulière:
fichier départ:
bt4ctg_0001 blastx match 1153 3455 1e-132 + ID=19588;target=FG10596.1+15+877;target_description=Fg hypothetical protein

fichier résultat:
QUERY=bt4ctg_0001
HIT=FG10596.1
HIT_MATCH_LENGTH=863

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
open(SEQ,"< test.fa")or die("Impossible de lire dans le fichier final $!");
 
while ( my $seq = <SEQ> ) {
    if (my $seq =~ /^bt4ctg_0001\tblastx\tmatch\t([0-9]+)\t([0-9]+)\t(.+)\t(.+)\tID=(.+);target=(.+)+([0-9]+)+([0-9]+);target_description=(.+)$/){
 	my $hit_match_length=$9-$8+1;
	print( "QUERY=$1\nHIT=$7\nHIT_MATCH_LENGTH=$hit_match_length\n");
 
    }
}
close(SEQ);
Si vous pouvez m'aider; merci