wrpearson / fasta36

Git repository for FASTA36 sequence comparison software
Apache License 2.0
117 stars 17 forks source link

Parseable output format (-m 10): wrong scores printed for subsequent hit #30

Closed flange-ipb closed 3 years ago

flange-ipb commented 3 years ago

Hello,

in case a library sequence produces more than one alignment hit, the scoring printed for the subsequent hit (alignment starts with ">--") is the one of the first hit, which is incorrect. I observe this for output format 10, but not for the standard format 0.

Files for reproduction: library and query

Result examples: output format 10: compare lines 116-118 (first hit) with lines 150-152 (second hit, incorrect scores) output format 0: compare line 61 (first hit) with line 77 (second hit, correct scores)

Best regards, Frank

wrpearson commented 3 years ago

Frank --

I have found and fixed the problem, and hopefully will be able to upload the changes to GitHub in the next day or so (unfortunately I will have much less internet connectivity for the next month).

Here is the required change:

diff --git a/src/mshowalign2.c b/src/mshowalign2.c index 513424f..1e5b20a 100644 --- a/src/mshowalign2.c +++ b/src/mshowalign2.c @@ -748,9 +748,9 @@ void showalign (FILE *fp, unsigned char *aa0, unsigned char aa1save, int maxn, if (info_str[0]) fprintf(fp,"; %s_info: %s\n",m_msp->f_id0,info_str); if (ppst->zsflag>=0) fprintf (fp,"; %s_z-score: %4.1f\n; %s_bits: %3.1f\n; %s_expect: %6.2g\n",

Bill Pearson

flange-ipb commented 3 years ago

Hello Bill,

excellent! This patch solves the issue.

Thanks for your quick support! Frank

wrpearson commented 3 years ago

Corrected in latest v36.3.8 version