[Biopython-dev] PAML yn00 under Windows
Brandon Invergo
b.invergo at gmail.com
Wed Aug 17 21:28:32 UTC 2011
Ok, I just sent a pull request. It turns out that either due to the way
C works in Windows or due to the way PAML was coded, what was a nice
"-nan" in Linux is printed as "-1.#IND" in Windows, which messed up
everything. Rather than parsing it in an algorithmic manner, I got angry
and threw some regex fu at it, which works a lot nicer than what I had
before.
Tested successfully in Linux and Windows 7, Python 2.7.2
-brandon
On Wed, 2011-08-17 at 16:39 +0100, Peter Cock wrote:
> 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