[Biopython-dev] PAML yn00 under Windows

Peter Cock p.j.a.cock at googlemail.com
Wed Aug 17 15:39:41 UTC 2011


On Wed, Aug 17, 2011 at 4:28 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> Hi Brandon,
>
> It looks like the stats line parsing in yn00 needs a little adjustment
> for this platform,
> ...
>    value = stats_split[i+2].strip("()")
> IndexError: list index out of range
>
>
> ...
>    raise ValueError("Problem with stats line: %r" % line)
> ValueError: Problem with stats line: 'LWL85m: dS = -1.#IND dN =
> -1.#IND w =-1.#IND S =   -1.$ N =   -1.$ (rho = -1.#IO)\n'

I think you need to adjustment to the bounds on i given you want to use
stats_split[i] and stats_split[i+2]. Note sure if want a -3 or -2 on the upper
bound...

C:\repositories\biopython\Tests>git diff
diff --git a/Bio/Phylo/PAML/_parse_yn00.py b/Bio/Phylo/PAML/_parse_yn00.py
index 221b6de..e4967fb 100644
--- a/Bio/Phylo/PAML/_parse_yn00.py
+++ b/Bio/Phylo/PAML/_parse_yn00.py
@@ -103,7 +103,7 @@ def parse_others(lines, results, sequences):
                 stats = {}
                 line_stats = line.split(":")[1].strip()
                 stats_split = line_stats.split()
-                for i in range(0, len(stats_split), 3):
+                for i in range(0, len(stats_split)-3, 3):
                     stat = stats_split[i].strip("()")
                     if stat == "w":
                         stat = "omega"


I don't know why this didn't come up under Linux, something subtle
going on between the PAML versions maybe?

Regards,

Peter




More information about the Biopython-dev mailing list