diff --git a/membrane_tools/alignblast.pl b/membrane_tools/alignblast.pl index b17ab4e..24f5f4c 100755 --- a/membrane_tools/alignblast.pl +++ b/membrane_tools/alignblast.pl @@ -140,6 +140,7 @@ $line_number++; while ($line=) { if ($line =~ /^\s*\((\d+)\s+letters\)/) {$query_length = $1; last;} + if ($line =~ /letters$/) {last;} $line_number++; } @@ -238,13 +239,15 @@ for ($i=1; $i<=9; $i++) while ($line = ) #scan through PsiBlast-output line by line { + if ($line =~ /^Length=(\d+)/) {$query_length = $1} + # New nameline found? if ($line=~s/^>//) { $line=~s/\s+/ /g; chomp($line); $nameline=$line; while ($line=) { - if ($line=~/^\s+Length =/) {last;} + if ($line=~/^\s*Length\s*=/) {last;} chomp($line); $nameline.=$line; } @@ -283,16 +286,16 @@ while ($line = ) #scan through PsiBlast-output line by line # Read pairwise alignment $query_res=""; $template_res=""; - if ($line!~/^Query:\s*(\d+)\s+\S+/) {die("Error 2: wrong format of blast output in $infile, line $.\n");} - $line=~/^Query:\s*(\d+)\s+\S+/; + if ($line!~/^Query:?\s*(\d+)\s+\S+/) {die("Error 2: wrong format of blast output in $infile, line $.\n");} + $line=~/^Query:?\s*(\d+)\s+\S+/; $first_res=$1; - while ($line=~/Query:\s*\d+\s+(\S+)\s+(\d+)/) # Cycle in this loop until no new "Query:" lines are found + while ($line=~/Query:?\s*\d+\s+(\S+)\s+(\d+)/) # Cycle in this loop until no new "Query:" lines are found { $query_res .= $1; $last_res=$2; $line=; $line=; - if ($line!~/^Sbjct:\s*\d+\s+(\S+)/) {die("Error 3: wrong format of blast output in $infile, line $.\n");} + if ($line!~/^Sbjct:?\s*\d+\s+(\S+)/) {die("Error 3: wrong format of blast output in $infile, line $.\n");} $template_res .= $1; $line=; $line=;