ksahlin / isONcorrect

Error correction of ONT transcript reads
GNU General Public License v3.0
58 stars 9 forks source link

FileNotFoundError when isoncorrect #17

Closed liqianqian-123 closed 2 years ago

liqianqian-123 commented 2 years ago

Hello, I encountered an error when running isoncorrect. I created the virtual environment named isoncorrect through conda, and successfully installed isonclust and isoncorrect. Through --help, it also showed that the installation was successful, but the following errors occurred in the actual operation. What do you think caused this error?

File "/share/home/songenhui/miniconda3/envs/isoncorrect/bin/run_isoncorrect", line 365, in main(args) File "/share/home/songenhui/miniconda3/envs/isoncorrect/bin/run_isoncorrect", line 281, in main for x in pool.imap_unordered(isoncorrect, instances): File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/multiprocessing/pool.py", line 870, in next raise value FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/time' creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100004 Running isoncorrect batch_id:100004... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100005 Running isoncorrect batch_id:100005... (isoncorrect)

When I try to change another server with poor configuration, the same installation method shows that it can run (but in order to run faster, I need to use the current server), Is it because I don't have permission to write tmp files in /usr/bin directory, but I won't change it, so what is the solution to this error?

I hope you can reply as soon as possible. Thank you very much!

ksahlin commented 2 years ago

Hi, I’m on vacation now so I don’t have access to a computer but let me try to help you through my phone. The offending line is the following.

“FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/time'“

I’m not sure that isONcorrect calls “time” from within the program so please check your external scripts for measuring time. Although I could be wrong as I cannot verify the code at this point. Regardless, isONcorrect doesn’t need to use the Unix “time” program to work, so you could also just remove any line that measures time Whether you called it within your scripts or whether it is isOncorrect/isONclust that issues this program.

let me know how it goes.

Best, Kristoffer

ksahlin commented 2 years ago

Correction, I guess it’s the module pool.py (pythons multiprocessing module) “ /share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/multiprocessing/pool.py” that calls the Unix “time” program. You could install time through Conda I believe or ask one of your sys admin‘s to install it for you.

It is strange that your server doesn’t have “time” as this should be one of the standard programs. So there is a slight chance that something else could be happening here.

liqianqian-123 commented 2 years ago

I'm sorry to disturb you, and thank you for your quick reply. I will try to install time with conda and see if it can run. I will tell you the result.

--------------原始邮件-------------- 发件人:"Kristoffer @.>; 发送时间:2022年7月2日(星期六) 晚上6:36 收件人:"ksahlin/isONcorrect" @.>; 抄送:"李倩倩学校 @.>;"Author @.>; 主题:Re: [ksahlin/isONcorrect] FileNotFoundError when isoncorrect (Issue #17)

Correction, I guess it’s the module pool.py (pythons multiprocessing module) “ /share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/multiprocessing/pool.py” that calls the Unix “time” program. You could install time through Conda I believe or ask one of your sys admin‘s to install it for you.

It is strange that your server doesn’t have “time” as this should be one of the standard programs. So there is a slight chance that something else could be happening here.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

liqianqian-123 commented 2 years ago

I installed time through this command: conda install -c conda-forge time but it still failed to run. The following is my script and error reports

script

# isONclust --t 12 --ont --fastq /share/home/songenhui/qqli/him/him_no_adapter_no_poly_no_rRNA.fq --outfolder /share/home/songenhui/qqli/him/him_clust # isONclust write_fastq --N 1 --clusters /share/home/songenhui/qqli/isoncorrect/him/him_clust/final_clusters.tsv --fastq /share/home/songenhui/qqli/isoncorrect/him/him_no_adapter_no_poly_no_rRNA.fq --outfolder /share/home/songenhui/qqli/isoncorrect/him/him_cluster_fastq_files # run_isoncorrect --t 10 --fastq_folder /share/home/songenhui/qqli/isoncorrect/him/him_cluster_fastq_files --outfolder /share/home/songenhui/qqli/isoncorrect/him/him_correct

log file

/share/home/songenhui/miniconda3/envs/isoncorrect/bin ('/share/home/songenhui/miniconda3/envs/isoncorrect/bin', '/share/home/songenhui/qqli/isoncorrect/him/him_cluster_fastq_files/0.fastq', '/share/home/songenhui/qqli/isoncorrect/him/him_correct/0', '0', {'set_w_dynamically': False, 'exact_instance_limit': 50, 'randstrobes': False, 'k': 9, 'w': 20, 'xmin': 18, 'xmax': 80, 'T': 0.1, 'max_seqs': 2000, 'use_racon': False}) ...... <multiprocessing.context.SpawnContext object at 0x2af5a14ddde0> Environment set: <multiprocessing.context.SpawnContext object at 0x2af5a14ddde0> Using 10 cores. creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/0 Running isoncorrect batch_id:0... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/1 Running isoncorrect batch_id:1... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/10 Running isoncorrect batch_id:10... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100 Running isoncorrect batch_id:100... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/1000 Running isoncorrect batch_id:1000... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/10000 Running isoncorrect batch_id:10000... multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, kwds)) File "/share/home/songenhui/miniconda3/envs/isoncorrect/bin/run_isoncorrect", line 94, in isoncorrect subprocess.check_call([ "/usr/bin/time", isoncorrect_exec, "--fastq", read_fastq_file, "--outfolder", outfolder, File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/subprocess.py", line 364, in check_call retcode = call(*popenargs, *kwargs) File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/subprocess.py", line 345, in call with Popen(popenargs, kwargs) as p: File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/subprocess.py", line 969, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/subprocess.py", line 1845, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/time' """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/share/home/songenhui/miniconda3/envs/isoncorrect/bin/run_isoncorrect", line 365, in main(args) File "/share/home/songenhui/miniconda3/envs/isoncorrect/bin/run_isoncorrect", line 281, in main for x in pool.imap_unordered(isoncorrect, instances): creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100000 Running isoncorrect batch_id:100000... File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/multiprocessing/pool.py", line 870, in next creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100001 Running isoncorrect batch_id:100001... raise value FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/time' creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100002 Running isoncorrect batch_id:100002... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100003 Running isoncorrect batch_id:100003... creating /share/home/songenhui/qqli/isoncorrect/him/him_correct/100004 Running isoncorrect batch_id:100004...

The result correct file contains the following folders:

drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 0 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 1 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 10 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 100 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 1000 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 10000 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 100000 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 100001 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 100002 drwxrwxr-x 2 songenhui songenhui 54 Jul 2 20:52 100003 drwxrwxr-x 2 songenhui songenhui 32 Jul 2 20:52 100004

Except for the last one, all other directories are: -rw-rw-r-- 1 songenhui songenhui 0 Jul 2 20:52 stderr.txt -rw-rw-r-- 1 songenhui songenhui 0 Jul 2 20:52 stdout.txt

The last one is: -rw-rw-r-- 1 songenhui songenhui 0 Jul 2 20:52 stderr.txt

Actually, the first two steps are normal, and only the correct step has an error. What do you think may be the reason? Is it the wrong way I installed it? Or do you need an administrator to install it?

ksahlin commented 2 years ago

I see. Please remove "/usr/bin/time",

In file File "/share/home/songenhui/miniconda3/envs/isoncorrect/bin/run_isoncorrect",

At line line 94: subprocess.check_call([ "/usr/bin/time", isoncorrect_exec, "--fastq", read_fastq_file, "--outfolder", outfolder, File "/share/home/songenhui/miniconda3/envs/isoncorrect/lib/python3.10/subprocess.py", line 364, in check_call retcode = call(*popenargs, **kwargs)”

The above is a quick hack. It is noteworthy that the “time” program in Unix should really be found on all servers, so you could send an email to the sys Admins to install this program.

ksahlin commented 2 years ago

It's possible that time is simply not found in /usr/bin/time on your server. Therefore, I have updated the wrapper script run_isoncorrect to call time (removing the full path) in commit 843b12d9.

You can replace your run_isoncorrect found in /share/home/songenhui/miniconda3/envs/isoncorrect/bin/run_isoncorrect with this version. Let me know if it works.

liqianqian-123 commented 2 years ago

Thank you very much for your modification. I have replaced the run_isoncorrect you modified, and now it can run normally, because I have a lot of sequences and need more time. The final file has not been generated yet, but there is no error at present.