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

xlsxwriter does not accept TSV or CSV extension #14

Open
broncio123 opened this issue Feb 12, 2025 · 1 comment
Open

xlsxwriter does not accept TSV or CSV extension #14

broncio123 opened this issue Feb 12, 2025 · 1 comment

Comments

@broncio123
Copy link
Collaborator

broncio123 commented Feb 12, 2025

A similar behaviour is observed when adding a TSV extension.

Excel spreadsheets are non-human readable.
It is always easier to load a CSV or TSV file into Excel than loading a spreadsheet for downstream analysis with Python.

Can we revert to the previous behaviour?

# Command: python mutation_analysis.py --alignment data/BACT000002.aln --type n --frame 1 --output output.csv
Starting Mutation Analysis
Parsing nucleotide alignment from: data/BACT000002.aln
Alignment length: 768
Analyzing nucleotide alignment (syn/non-syn)...
Writing output to output.csv
Traceback (most recent call last):
  File "/home/broncio/oxford/genescan/caro_project/mutation_analysis.py", line 635, in <module>
    main()
  File "/home/broncio/oxford/genescan/caro_project/mutation_analysis.py", line 625, in main
    write_output(
  File "/home/broncio/oxford/genescan/caro_project/mutation_analysis.py", line 516, in write_output
    with pd.ExcelWriter(output_file, engine='xlsxwriter') as writer:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/broncio/anaconda3/lib/python3.12/site-packages/pandas/io/excel/_xlsxwriter.py", line 204, in __init__
    super().__init__(
  File "/home/broncio/anaconda3/lib/python3.12/site-packages/pandas/io/excel/_base.py", line 1221, in __init__
    self.check_extension(ext)
  File "/home/broncio/anaconda3/lib/python3.12/site-packages/pandas/io/excel/_base.py", line 1340, in check_extension
    raise ValueError(f"Invalid extension for engine '{cls.engine}': '{ext}'")
ValueError: Invalid extension for engine '<property object at 0x79f821769710>': 'csv'
@kjolley
Copy link
Contributor

kjolley commented Feb 14, 2025

I think it would be preferable to have both Excel output as well as a text format if possible.

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