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

Gzip flag overrides output file flag #148

Closed
lazear opened this issue Nov 30, 2022 · 7 comments
Closed

Gzip flag overrides output file flag #148

lazear opened this issue Nov 30, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@lazear
Copy link
Contributor

lazear commented Nov 30, 2022

Hi,

Using a combination of -g and -b flags produces an unexpected result.

.\ThermoRawFileParser.exe -N -f 1 -g -i="test.raw" -b="test.mzML.gz" creates a file named "test.mzML.gz.gzip"

I would also like to request, perhaps, that the default extension for using the -g flag be changed to .gz, which is the standard extension from gzipped files (for instance, gunzip doesn't recognize .gzip....)

@caetera caetera added the bug Something isn't working label Nov 30, 2022
@caetera
Copy link
Collaborator

caetera commented Nov 30, 2022

Hi @lazear,

thank you for reporting this issue. Do I understand correctly, that "less surprising" result will be to use provided filename as it is (in layman terms - "user knows better")?
For example, .\ThermoRawFileParser.exe -g -i="test.raw" -b="test.mzML" should generate test.mzML that is in fact a gzipped one.

@edeutsch
Copy link
Collaborator

Sorry to barge in on the convo, but I think the least surprising is if:
.\ThermoRawFileParser.exe -g -i="test.raw" -b="test.mzML"
generates test.mzML.gz

and:
.\ThermoRawFileParser.exe -g -i="test.raw" -b="test.mzML.gz"
generates test.mzML.gz

(like "Save As...." applications with format selection do)

@lazear
Copy link
Contributor Author

lazear commented Nov 30, 2022

thank you for reporting this issue. Do I understand correctly, that "less surprising" result will be to use provided filename as it is (in layman terms - "user knows better")? For example, .\ThermoRawFileParser.exe -g -i="test.raw" -b="test.mzML" should generate test.mzML that is in fact a gzipped one.

I would expect the generated mzML file name to exactly match the file name passed by the -b file ("user knows better"), but I think @edeutsch's suggestion (where the gz file extension is appended if not present) is probably the better approach for most users/applications (which generally rely on file extensions)

@caetera
Copy link
Collaborator

caetera commented Dec 1, 2022

Thank you both for your input. I will stick to "add the extension, if it is not present". I guess, for unification, the same behavior should be added to other file formats, i.e. add .mzML to all mzML files, if it is not present and so on.

@caetera
Copy link
Collaborator

caetera commented Dec 13, 2022

I have implemented the changes and added a test with the following table of test cases (with as strange user inputs as I can come with). Please, let me know, if there is any case that I might forgot to include. (I guess the table is rather self-explanatory)

Format Gzip UserInput FileOutput
MGF FALSE rawfile rawfile.mgf
MGF FALSE rawfile. rawfile.mgf
MGF FALSE rawfile.mgf rawfile.mgf
MGF FALSE rawfile.MGF rawfile.mgf
MGF FALSE rawfile.. rawfile.mgf
MGF TRUE rawfile.mgf.gz rawfile.mgf.gz
MGF TRUE rawfile rawfile.mgf.gz
MGF TRUE rawfile.. rawfile.mgf.gz
MGF TRUE rawfile.mgf.GZ rawfile.mgf.gz
MGF TRUE rawfile.mgf rawfile.mgf.gz
MGF TRUE rawfile.MGF. rawfile.mgf.gz
mzML FALSE rawfile rawfile.mzML
mzML FALSE rawfile. rawfile.mzML
mzML FALSE rawfile.mgf rawfile.mgf.mzML
mzML FALSE rawfile.MzML rawfile.mzML
mzML FALSE rawfile.. rawfile.mzML
mzML TRUE rawfile.mzML.gz rawfile.mzML.gz
mzML TRUE rawfile rawfile.mzML.gz
mzML TRUE rawfile.. rawfile.mzML.gz
mzML TRUE rawfile.mzml.GZ rawfile.mzML.gz
mzML TRUE rawfile.mzML rawfile.mzML.gz
mzML TRUE rawfile.MZml. rawfile.mzML.gz

@lazear
Copy link
Contributor Author

lazear commented Dec 13, 2022

That looks good to me, thank you for tackling this @caetera! I think it would also be good to update the documentation & CLI flag help to clarify that the flag only effects the filename, and not the full file path.

@caetera
Copy link
Collaborator

caetera commented Feb 11, 2023

Closed in version 1.4.2

@caetera caetera closed this as completed Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants