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

Handle spcaes in raw/mzML file names #22

Merged
merged 3 commits into from
Sep 25, 2024
Merged

Conversation

ajmaurais
Copy link
Contributor

@ajmaurais ajmaurais commented Sep 25, 2024

  • Make sure we are able to handle mzML and raw files with spaces or other crazy characters in the file name
  • Fix a small bug in workflows/get_mzmls.nf where error messages weren't being printed properly in some cases

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you removed the quotes around all the files being created, except for the .dia one? Aren't those quotes necessary to support mzML files with spaces in the name?

Copy link
Contributor Author

@ajmaurais ajmaurais Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nextflow will automatically escapes spaces when it is expanding file variables but not the methods for file variables. So ${mzml_file} would expand to file\ with_space.mzML , but ${mzml_file.baseName} would expand to file with_space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep the quotes, when it expands "${mzml_file}.elib" it will create a file name with a literal \ character in the file name

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious about this. Why was adding the -d option necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-d'\n' tells xargs to use new lines as the delimiter instead of all white space, which is the default. Each file is on it's own line in all_files.txt so xargs will parse each line as an argument regardless of whether the file name has spaces

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thought new lines were the default, makes sense, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So did I until I was getting an error on this step

@mriffle mriffle merged commit a24ced5 into mriffle:main Sep 25, 2024
6 checks passed
@ajmaurais ajmaurais deleted the handle_spcaes branch September 25, 2024 17:43
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

Successfully merging this pull request may close these issues.

2 participants