I am trying to run Kchooser but seem to hit a snag. The error is the following:
Reading the input file...
There are 21 genomes.
Used 2 seconds so far.
Determining the optimum k...
Failed to open input file 'output_0'
system jellyfish dump output_0 -c > jellyout.txt failed: Inappropriate ioctl for device at Kchooser.pl line 242.
I am running the latest kSNP3 build on Red Hat Enterprise Linux 7. I have run the kSNP3 directly on the dataset, by setting K=13 arbitrarily. And, it works great.
MakeFasta seems to have worked with no problem, producing a suitably large FASTA file, with the approapriate number of genomes.
Any help, would be appreciated. Thank you.
Anders.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am the one who wrote both Kchooser and MakeFasta, and I am completely baffled by your problem.
You certainly helped by providing all of the relevant information, and that information is what baffles me.
I thought there might be a problem with jellyfish, but kSNP itself ran for you so that can’t be the issue.
I thought the problem might be with Red Hat Linux, but MakeFasta and kANP run, so that seems unlikely.
I thought that perhaps I screwed up and compiled Kchooser for 32-bit instead of 64 bit Linux, but many Linux users have downloaded the kSNP package, and most of them must surely have used Kchooser without reporting your problem
The only thing that I can imagine is that somehow during the download Kchooser got corrupted. I have attached the Linus Kchooser executable for you. I certainly hope that fixes your problem.
Meanwhile, I have a big favor to ask of you. It has to do with the ksnp:discussion to which you addressed your question. I didn’t know that a kSNP discusssion group even existed, much less that I am subscribed to it. I assume that either this was somehow set up automatically by SourceForge or that Shea Gardner set it up when she put pSNP onto SourceForge.
You may or may not be aware that Shea Gardner, who wrote kSNP, is terminally ill, no longer working, and unable to provide any support for kSNP. That puts support squarely onto me, and I am mostly unqualified for the job. I wrote Kchooser, MakeFasta and most of the little utilities that come with kSNP3, but I am not a very sophisticated programmer. I am a Mac user, and while OS X is much like Linux, I am not really at all expert in Linux - certainly not in any sophisticated sense. As a result I am often unable to identify the source of problems with Linux installations.
As the number of kSNP users is growing I am finding myself using more and more time providing kSNP support - time that I really don’t have. I would LOVE to see an active kSNP discussion group to which new users could pose questions and get help from other users (in addition to me, of course).
If you could send me clear instructions on how to sign p for/access the kSNP discussion group I thought I might post a document to the kSNP SourceForge page with a title something like “URGENT! kSNP support” in which I would tell users how to sign up and how to post support questions to that page. I would also plead with kSNP users to monitor the site and to contribute solutions whenever they have them.
Any help you can be would be much appreciated.
Good luck solving the Kchooser issue.
Best wishes,
Barry
Barry G. Hall
Director, Bellingham Research Institute
I am trying to run Kchooser but seem to hit a snag. The error is the following:
Reading the input file...
There are 21 genomes.
Used 2 seconds so far.
Determining the optimum k...
Failed to open input file 'output_0'
system jellyfish dump output_0 -c > jellyout.txt failed: Inappropriate ioctl for device at Kchooser.pl line 242.
I am running the latest kSNP3 build on Red Hat Enterprise Linux 7. I have run the kSNP3 directly on the dataset, by setting K=13 arbitrarily. And, it works great.
MakeFasta seems to have worked with no problem, producing a suitably large FASTA file, with the approapriate number of genomes.
The ioctl error is very vaguely saying that there is an issue with the pipe redirection (again, this could be due to the specific perl version (see below)). In order to use a pipe redirect via a system call, the command must be passed as a string, so the following would also work:
Another note: I remember having similar issues the first time I set up kSNP3, but unfortunately, I can't recall how they were fixed--it's possible that the Linux perl doesn't complain about the current version. The server I typically use died a horrible death, and I cannot test it.
Anyways, I was setting up a new mac and installed jellyfish from homebrew rather than using the included binary (again, due to remembering the previous issues), and I uncovered another problem. The latest version of jellyfish does not use the name naming scheme! (namely adding _0 to the end of the file). The following fixes that issue:
~line 240
# NOTE: In newer jellyfish versions, the output file will NOT have# the '_s' suffix, but will instead write directly to the file@args=('jellyfish dump output_0 -c > jellyout.txt');my$retcode=system(@args);# == 0 or die "system @args failed: $!";if($retcode!=0){my$cmd='jellyfish dump output -c > jellyout.txt';system($cmd)==0ordie"system @args failed: $!";}
~ line 169
#remove the leftover files@args=('rm','output_0');my$retcode=system(@args);if($retcode!=0){$args[1]='output';system(@args)==0ordie"system @args failed: $!";}
One thing to note--jellyfish with complain to stdout (stderr?) that Failed to open input file 'output_0', but you shouldn't need to worry.
I'll be working with Barry to update kSNP3 with these fixes.
Version information:
[18.02.2016 17:40:26 282] $ perl --version
This is perl 5, version 18, subversion 2(v5.18.2) built for darwin-thread-multi-2level
[18.02.2016 17:44:17 283] $ jellyfish --version
jellyfish 2.1.4
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried all the above fixes; however, I had no success with Kchooser. I am still getting the same error as reported above.
Failed to open input file 'output_0'
system jellyfish count -C -o output -s 1000000 -t 3 medSeq.fasta -m 13 failed: Inappropriate ioctl for device at ./Kchooser line 242.
Please advise
Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I ran into the same problem. After spending a bit of time, I managed to get the Kchooser to work.
First download the kSNP source. Open Kchooser in a text editor.
Go to line 238. Where it says 'output', change it to 'output_0'. Save the script, then execute the command by typing "perl ./Kchooser genomes.fasta". This seemed to have worked for me (the script finishes). I attached the modified script too.
The ‘output' doesn’t seem to cause a problem in either the Mac OS or the Ubuntu 14.04 Linux OS, so I am curious what OS you are using.
I’ll incorporate your modification and test it out on Mac and Ubuntu Linux OSs. If it doesn’t screw those operating systems up I’ll make new Kchooser executables and upload.
Barry G. Hall
Director, Bellingham Research Institute
I ran into the same problem. After spending a bit of time, I managed to get the Kchooser to work.
First download the kSNP source. Open Kchooser in a text editor.
Go to line 238. Where it says 'output', change it to 'output_0'. Save the script, then execute the command by typing "perl ./Kchooser genomes.fasta". This seemed to have worked for me (the script finishes). I attached the modified script too.
The suggested modification causes Kchooser to fail in Mac OX and Ubuntu linux.
Apparently in both those OSs, and whatever linux version Shea Gardner used, _0 is automatically appended to the ‘output’ in line 238. As a result, under the suggested modification in the next line where Kchooser looks for ‘output_0’ it can’t find it because the file is named ‘output_0_0’.
Anyone who needs this modification but prefers to use the Kchooser executable can contact me directly at barryghall@gmail.com.
Barry G. Hall
Director, Bellingham Research Institute
I ran into the same problem. After spending a bit of time, I managed to get the Kchooser to work.
First download the kSNP source. Open Kchooser in a text editor.
Go to line 238. Where it says 'output', change it to 'output_0'. Save the script, then execute the command by typing "perl ./Kchooser genomes.fasta". This seemed to have worked for me (the script finishes). I attached the modified script too.
I was running Kchooser on Mac OS X 10.11.4 on my local machine and also on our server which has CentOS release 6.7. Might it have something to do with jellyfish and how it's configured on the system? Maybe the script is using the system's jellyfish instead of the one included with kSNP? On my Mac, I installed jellyfish 2.2.4 through homebrew (I used the command "brew install jellyfish"). Our server has jellyfish 2.0.0 installed. The jellyfish included with kSNP is version 1.1.6.
Hai
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suspect that you are correct. I can’t speak to what the new version of jellyfish does, but I know that kSNP expects to use the version of jellyfish that is included in the kSNP3 package.
I would guess that if there are two versions of jellyfish on your system that when jellyfish is called by Kchooser it will use whichever jellyfish comes first in your path.
This may turn out to be a problem for anyone who has a newer version of jellyfish installed, but the only solution I can see is to either run Kchooser from the modified source code, as you suggested, or to individually ask me for a Kchooser executable compiled from that modified source code.
Barry G. Hall
Director, Bellingham Research Institute
I was running Kchooser on Mac OS X 10.11.4 on my local machine and also on our server which has CentOS release 6.7. Might it have something to do with jellyfish and how it's configured on the system? Maybe the script is using the system's jellyfish instead of the one included with kSNP? On my Mac, I installed jellyfish 2.2.4 through homebrew (I used the command "brew install jellyfish"). Our server has jellyfish 2.0.0 installed. The jellyfish included with kSNP is version 1.1.6.
I had the same issue and resolved it by forcing the kSNP bin folder to the front of the PATH variable. export PATH=/path/to/your/kSNP3:$PATH should work for people who have this reference/version issue, and is a simple fix. Worked with v.3.1, hope it's more widely applicable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
I am trying to run Kchooser but seem to hit a snag. The error is the following:
I am running the latest kSNP3 build on Red Hat Enterprise Linux 7. I have run the kSNP3 directly on the dataset, by setting K=13 arbitrarily. And, it works great.
MakeFasta seems to have worked with no problem, producing a suitably large FASTA file, with the approapriate number of genomes.
Any help, would be appreciated. Thank you.
Anders.
Hello Anders,
I am the one who wrote both Kchooser and MakeFasta, and I am completely baffled by your problem.
You certainly helped by providing all of the relevant information, and that information is what baffles me.
I thought there might be a problem with jellyfish, but kSNP itself ran for you so that can’t be the issue.
I thought the problem might be with Red Hat Linux, but MakeFasta and kANP run, so that seems unlikely.
I thought that perhaps I screwed up and compiled Kchooser for 32-bit instead of 64 bit Linux, but many Linux users have downloaded the kSNP package, and most of them must surely have used Kchooser without reporting your problem
The only thing that I can imagine is that somehow during the download Kchooser got corrupted. I have attached the Linus Kchooser executable for you. I certainly hope that fixes your problem.
Meanwhile, I have a big favor to ask of you. It has to do with the ksnp:discussion to which you addressed your question. I didn’t know that a kSNP discusssion group even existed, much less that I am subscribed to it. I assume that either this was somehow set up automatically by SourceForge or that Shea Gardner set it up when she put pSNP onto SourceForge.
You may or may not be aware that Shea Gardner, who wrote kSNP, is terminally ill, no longer working, and unable to provide any support for kSNP. That puts support squarely onto me, and I am mostly unqualified for the job. I wrote Kchooser, MakeFasta and most of the little utilities that come with kSNP3, but I am not a very sophisticated programmer. I am a Mac user, and while OS X is much like Linux, I am not really at all expert in Linux - certainly not in any sophisticated sense. As a result I am often unable to identify the source of problems with Linux installations.
As the number of kSNP users is growing I am finding myself using more and more time providing kSNP support - time that I really don’t have. I would LOVE to see an active kSNP discussion group to which new users could pose questions and get help from other users (in addition to me, of course).
If you could send me clear instructions on how to sign p for/access the kSNP discussion group I thought I might post a document to the kSNP SourceForge page with a title something like “URGENT! kSNP support” in which I would tell users how to sign up and how to post support questions to that page. I would also plead with kSNP users to monitor the site and to contribute solutions whenever they have them.
Any help you can be would be much appreciated.
Good luck solving the Kchooser issue.
Best wishes,
Barry
Barry G. Hall
Director, Bellingham Research Institute
On Sep 23, 2015, at 9:22 PM, andersgs andersgs@users.sf.net wrote:
I think I (partially) found the issue. I have not fully tested, so there may be some discrepancies due to software versions (perl, etc.).
The problem is with this line (Kchooser.pl@240):
simply change
@args
to$args[0]
as shown:The
ioctl
error is very vaguely saying that there is an issue with the pipe redirection (again, this could be due to the specific perl version (see below)). In order to use a pipe redirect via asystem
call, the command must be passed as a string, so the following would also work:Another note: I remember having similar issues the first time I set up kSNP3, but unfortunately, I can't recall how they were fixed--it's possible that the Linux perl doesn't complain about the current version. The server I typically use died a horrible death, and I cannot test it.
Anyways, I was setting up a new mac and installed jellyfish from homebrew rather than using the included binary (again, due to remembering the previous issues), and I uncovered another problem. The latest version of jellyfish does not use the name naming scheme! (namely adding
_0
to the end of the file). The following fixes that issue:~line 240
~ line 169
One thing to note--jellyfish with complain to stdout (stderr?) that
Failed to open input file 'output_0'
, but you shouldn't need to worry.I'll be working with Barry to update kSNP3 with these fixes.
Version information:
Hello Stephen,
I have tried all the above fixes; however, I had no success with Kchooser. I am still getting the same error as reported above.
Please advise
Thank you!
Hi,
I ran into the same problem. After spending a bit of time, I managed to get the Kchooser to work.
First download the kSNP source. Open Kchooser in a text editor.
Go to line 238. Where it says 'output', change it to 'output_0'. Save the script, then execute the command by typing "perl ./Kchooser genomes.fasta". This seemed to have worked for me (the script finishes). I attached the modified script too.
Dear Hal Nguyen,
Thanks for finding a solution.
The ‘output' doesn’t seem to cause a problem in either the Mac OS or the Ubuntu 14.04 Linux OS, so I am curious what OS you are using.
I’ll incorporate your modification and test it out on Mac and Ubuntu Linux OSs. If it doesn’t screw those operating systems up I’ll make new Kchooser executables and upload.
Barry G. Hall
Director, Bellingham Research Institute
The suggested modification causes Kchooser to fail in Mac OX and Ubuntu linux.
Apparently in both those OSs, and whatever linux version Shea Gardner used, _0 is automatically appended to the ‘output’ in line 238. As a result, under the suggested modification in the next line where Kchooser looks for ‘output_0’ it can’t find it because the file is named ‘output_0_0’.
Anyone who needs this modification but prefers to use the Kchooser executable can contact me directly at barryghall@gmail.com.
Barry G. Hall
Director, Bellingham Research Institute
Hi Barry,
I was running Kchooser on Mac OS X 10.11.4 on my local machine and also on our server which has CentOS release 6.7. Might it have something to do with jellyfish and how it's configured on the system? Maybe the script is using the system's jellyfish instead of the one included with kSNP? On my Mac, I installed jellyfish 2.2.4 through homebrew (I used the command "brew install jellyfish"). Our server has jellyfish 2.0.0 installed. The jellyfish included with kSNP is version 1.1.6.
Hai
I suspect that you are correct. I can’t speak to what the new version of jellyfish does, but I know that kSNP expects to use the version of jellyfish that is included in the kSNP3 package.
I would guess that if there are two versions of jellyfish on your system that when jellyfish is called by Kchooser it will use whichever jellyfish comes first in your path.
This may turn out to be a problem for anyone who has a newer version of jellyfish installed, but the only solution I can see is to either run Kchooser from the modified source code, as you suggested, or to individually ask me for a Kchooser executable compiled from that modified source code.
Barry G. Hall
Director, Bellingham Research Institute
I had the same issue and resolved it by forcing the kSNP bin folder to the front of the PATH variable. export PATH=/path/to/your/kSNP3:$PATH should work for people who have this reference/version issue, and is a simple fix. Worked with v.3.1, hope it's more widely applicable.
This helped me, thank you for posting attaching the script.