Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--output_file does not work properly #2

Open
marade opened this issue Apr 4, 2023 · 5 comments
Open

--output_file does not work properly #2

marade opened this issue Apr 4, 2023 · 5 comments
Assignees

Comments

@marade
Copy link

marade commented Apr 4, 2023

Specifying an output directory with a relative path causes errors, e.g. this fails:

$ mkdir genovi
$ genovi -o genovi/blah ...

Parsing path input with Pathlib Path(args.outfile).absolute() or os.path.abspath(args.outfile) would fix this.

@arodel21
Copy link
Collaborator

Hello @marade.

Thanks for pointing this out.

Could you please share the error log with me to have a better idea of how to fix this?

@arodel21 arodel21 self-assigned this Apr 13, 2023
@marade
Copy link
Author

marade commented Apr 13, 2023

sequence.gb is a file downloaded from GenBank today:

$ genovi -o genovi/blah -i sequence.gb -s complete
[Errno 2] No such file or directory: 'genovi/blah-temp/contig_1-genovi/blah.faa'
Error when transforming gbk to faa.
/home/ubuntu/miniconda3/envs/genovi/lib/python3.7/site-packages/Bio/GenBank/Scanner.py:1219: BiopythonParserWarning: Premature end of file in sequence data
"Premature end of file in sequence data", BiopythonParserWarning
Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/genovi/bin/genovi", line 8, in
sys.exit(main())
File "/home/ubuntu/miniconda3/envs/genovi/lib/python3.7/site-packages/scripts/GenoVi.py", line 685, in main
visualiseGenome(*get_args())
File "/home/ubuntu/miniconda3/envs/genovi/lib/python3.7/site-packages/scripts/GenoVi.py", line 341, in visualiseGenome
sizes, cogs_p, cogs_n, lengths, chrms, hist, wanted_cogs = base(file, temp_folder + "/" + output_file_part, output_file + "/" + output_file, True, True, cogs_classified, cogs_classified, False, True, deepnog_confidence_threshold, verbose, wanted_cogs=wanted_cogs)
File "/home/ubuntu/miniconda3/envs/genovi/lib/python3.7/site-packages/scripts/create_raw.py", line 494, in base
sizes, _, _, lengths = create_kar(gbk_file, tmp, output, complete)
File "/home/ubuntu/miniconda3/envs/genovi/lib/python3.7/site-packages/scripts/create_raw.py", line 139, in create_kar
with open(output_file, 'w') as output:
FileNotFoundError: [Errno 2] No such file or directory: 'genovi/blah-temp/contig_1-genovi/blah_bands.kar'

@arodel21
Copy link
Collaborator

Hi @marade. I apologize for the delay in replying.

I have committed an update related to the handling of relative paths. It is not yet included in the installable version of GenoVi, but you can find it in the Github repo. It will soon be added to a new version which will include other improvements.

Please do let us know if you have further quesitons.

@marade
Copy link
Author

marade commented May 16, 2023

Sounds good @arodel21. Thanks!

@marade
Copy link
Author

marade commented Sep 19, 2023

I tried using GenoVi again and found that relative paths still don't work. I see there's a commit related to this here:

fdd3c5d

The code for this commit is not nearly sufficient to address the problem. I'd like to emphasize that GenoVi is fundamentally broken when it comes to handling paths. I'll recommend again extensive use of Pathlib Path().absolute() or os.path.abspath() so that you can handle relative paths correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants