Skip to content

PermissionError in phold plot #36

@Ulthran

Description

@Ulthran
  • phold version: 0.1.4
  • Python version: 3.10.14
  • Operating System: Windows (WSL2, Ubuntu)

Description

Trying to run phold plot and I'm getting this error:

2024-04-12 16:30:33.499 | INFO     | phold.utils.validation:instantiate_dirs:70 - Checking the output directory /home/ctbus/Penn/sunbeam/projects/virus/sunbeam_output/virus/phold/LONG_plot
2024-04-12 16:30:33.499 | INFO     | phold.utils.validation:instantiate_dirs:73 - Removing /home/ctbus/Penn/sunbeam/projects/virus/sunbeam_output/virus/phold/LONG_plot because --force was specified
Traceback (most recent call last):
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/bin/phold", line 10, in <module>
    sys.exit(main())
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/phold/__init__.py", line 1355, in main
    main_cli()
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/phold/__init__.py", line 1236, in plot
    instantiate_dirs(output, force)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/site-packages/phold/utils/validation.py", line 74, in instantiate_dirs
    shutil.rmtree(output_dir)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/shutil.py", line 725, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/shutil.py", line 681, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/home/ctbus/Penn/sunbeam/.snakemake/160f8892b5f849b64b315e3ee4674746_/lib/python3.10/shutil.py", line 679, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'phold_plot_1712951468.829077.log'

I'm running this locally on a computer where I'm the only user. Permissions for the output of phold compare:

drwxr-xr-x 4 ctbus ctbus 4096 Apr 12 15:47 ./
drwxr-xr-x 8 ctbus ctbus 4096 Apr 12 16:29 ../
drwxr-xr-x 2 ctbus ctbus 4096 Apr 12 15:47 logs/
-rw-r--r-- 1 ctbus ctbus 6324 Apr 12 15:47 phold.gbk
-rw-r--r-- 1 ctbus ctbus  624 Apr 12 15:47 phold_3di.fasta
-rw-r--r-- 1 ctbus ctbus  624 Apr 12 15:47 phold_aa.fasta
-rw-r--r-- 1 ctbus ctbus 1945 Apr 12 15:47 phold_all_cds_functions.tsv
-rw-r--r-- 1 ctbus ctbus 9244 Apr 12 15:47 phold_compare_1712951223.3917286.log
-rw-r--r-- 1 ctbus ctbus 1596 Apr 12 15:47 phold_per_cds_predictions.tsv
drwxr-xr-x 2 ctbus ctbus 4096 Apr 12 15:47 sub_db_tophits/

What I Did

Ran install, predict, compare with minimal options, just specifying inputs, outputs, db path, and --force. Plot command:

phold plot -i {input.gbk} -o $(dirname {output.png}) --force

Getting this using a conda install and a docker install. I suspect it's just a matter of earlier steps writing with overly restrictive permissions for what plot is trying to do. Let me know if there's any more information/help I can give.

Thanks,
Charlie

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions