我是 Perl 正则表达式的新手,所以我很感激任何帮助。我正在解析 BLAST 输出。现在,我只能解释 e 值仅包含整数和小数的命中。如何在电子值采用科学计数法的情况下包含命中?
爆炸输出.txt
Score E
Sequences producing significant alignments: (Bits) Value
ref|WP_001577367.1| hypothetical protein [Escherichia coli] >... 75.9 4e-15
ref|WP_001533923.1| cytotoxic necrotizing factor 1 [Escherich... 75.9 7e-15
ref|WP_001682680.1| cytotoxic necrotizing factor 1 [Escherich... 75.9 7e-15
ref|ZP_15044188.1| cytotoxic necrotizing factor 1 domain prot... 40.0 0.002
ref|YP_650655.1| hypothetical protein YPA_0742 [Yersinia pest... 40.0 0.002
ALIGNMENTS
>ref|WP_001577367.1| hypothetical protein [Escherichia coli]
解析.pl
open (FILE, './blastoutput.txt');
my $marker = 0;
my @one;
my @acc;
my @desc;
my @score;
my @evalue;
my $counter=0;
while(<FILE>){
chomp;
if($marker==1){
if(/^(\D+)\|(.+?)\|\s(.*?)\s(\d+)(\.\d+)? +(\d+)([\.\d+]?) *$/) {
#if(/^(\D+)\|(.+?)\|\s(.*?)\s(\d+)(\.\d+)? +(\d+)((\.\d+)?(e.*?)?) *$/)
$one[$counter] = $1;
$acc[$counter] = $2;
$desc[$counter] = $3;
$score[$counter] = $4+$5;
if(! $7){
$evalue[$counter] = $6;
}else{
$evalue[$counter] = $6+$7;
}
$counter++;
}
}
if(/Sequences producing significant alignments/){
$marker = 1;
}elsif(/ALIGNMENTS/){
$marker = 0;
}elsif(/No significant similarity found/){
last;
}
}
for(my $i=0; $i < scalar(@one); $i++){
print "$one[$i] | $acc[$i] | $desc[$i] | $score[$i] | $evalue[$i]\n";
}
close FILE;