Populations (and more generally Stacks when opening a gzipped fasta file) simply does this:
1. Try to the file (if it fails abort)
2. Peek at the first character in the file, check that it is
'>' (if it's not, abort with the error you saw)
However at the moment it doesn't explicitly check that peeking at the first character succeeded (peeking may return -1 instead of 60/'>'). That is apparently the case you are in; ZLIB fails to read from the (open) file.
My guess would be that several versions of ZLIB coexist on your system and that your $LD_LIBRARY_PATH environment variable does not account for it.
Best,
Nicolas
--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/56d43f85-0b64-4b66-978b-71acf63f7355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Populations (and more generally Stacks when opening a gzipped fasta file) simply does this:
1. Open the file (if it fails abort)
2. Peek at the first character in the file, check that it is
'>' (if it's not, abort with the error you saw)
However at the moment it doesn't explicitly check that peeking at the first character succeeded (peeking may return -1 instead of 60/'>'). That is apparently the case you are in; ZLIB fails to read from the (open) file.
My guess would be that several versions of ZLIB coexist on your system and that your $LD_LIBRARY_PATH environment variable does not account for it.
Best,
Nicolas
However, Stacks succeeds in opening the file with ZLIB but not in reading anything from it, do it doesn't get to see that >
On OSX use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH. You can
check whether gzip and stacks are using the same ZLIB version
with:
otool -L $(command -v gzip)
otool -L $(command -v populations)
Best,
Nicolas
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/6a6d8e11-756d-4ceb-bfd3-8e5e98ea29d6%40googlegroups.com.
Before anything else, let's confirm that my guess about the
failing reading is right. Could you replace Stacks v2.1 after
replacing the stacks-2.1/src/gzFasta.cc file with the attached
one? And retry the same populations command, see if the error
message changed?
Nicolas
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/a99e747e-9399-43f4-b8f4-83073b622985%40googlegroups.com.
Hi Brian,
Could you try again with this file, please? I've also enriched the error message itself, i.e. even if the same error happen it will print more info than it did before.
Best,
Nicolas
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/21d1ced6-8473-4489-bb74-9e5179176f2f%40googlegroups.com.
Hi Brian,
Thanks for coming back to us again. I'm glad we could pin down the origin for certain. This is really puzzling though.
The error happens immediately after the file is opened—then the gz-FASTA reader peeks at the first character to check if it is a '>'. This part of the code is really simple, trackable, all it does is:
gzFile gzf = gzopen(path, "rb");
if(!gzf) { ... (error: failed to open file) }
int first = gzgetc(gz_fh);
if(first != '>') { ... (error: not in fasta format) }
I'll see if I can come up with an idea for the cause. It works elsewhere so it somehow must be a system-specific issue, but I can't think of a specific one for the moment.
Best,
Nicolas
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/1fa33dd4-7632-4930-9ec8-54b63f9dad4b%40googlegroups.com.
(p.s.—in the snippet 'gz_fh' should read 'gzf'; naming in
the actual code is consistent.)
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/4232d2e0-e04e-1f87-e422-3e95efac0244%40illinois.edu.
Hi Brian,
?!? very surprising...
But definitely helpful. I think it explains it and that we should
be able to track down the issue. I keep you updated.
Cheers,
Nicolas
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/0ed18548-636b-4b79-8b7c-fdc16d794027%40googlegroups.com.
Hi Cinnamon.
v2.4 will print additional details when this error occurs.
As far as we know, the error comes from a problem in your system's configuration, particularly the fact that the immediately accessible Z library (zlib, the standard for reading .gz files) is older than the one that was used for compiling Stacks. Typically you will want to fix your LD_LIBRARY_PATH (e.g. by hand or by loading modules)
Best,
Nicolas
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/46420cb1-082e-409d-9145-d1c48916bf5c%40googlegroups.com.