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

Regex does not find files. #49

Open
cwlkr opened this issue Dec 14, 2022 · 1 comment
Open

Regex does not find files. #49

cwlkr opened this issue Dec 14, 2022 · 1 comment

Comments

@cwlkr
Copy link

cwlkr commented Dec 14, 2022

Hi there,

Using premessa panel editor and selecting a file in a folder containing "PATHWITHDRIVE/FILENAME.FCS" files, we had the issue that no files were found by premessa, which resulted in an error in line 35 of file paneleditor_shinyGUI/server.R:
names(panel.table)[2] <- "Most common" as panel.table is empty.

Debugging the application I found this line (line 58 paneleditor_shinyGUI/server.R ) that did not return any files, just NULL.
files.list <- list.files(working.directory, pattern = "*.fcs$", ignore.case = T)

The pattern argument in list.files as I understand is expected to be regex and not a glob expansion.
Should the correct regex pattern then not be: pattern = ".*\.fcs$"?

I don't really know why this was an issue for us and not others, but this change resulted in the application working for us, but it might be a windows specific issue.

Checked premessa versions: 0.3.2, 0.3.4/ R version 4.1.1 / operating system windows 10

Thanks and best, cwlkr

@SamGG
Copy link

SamGG commented Dec 14, 2022

I already saw this kind of imperfect pattern in many packages. It usually returns a list of files, not an empty one as you observed.
IMHO, the correct pattern should be "\.fcs$". The beginning ".*" is useless, the "" must be escaped by itself :-)
Thanks for your feedback that @pfgherardini will take into account. BTW thanks @pfgherardini for this package.

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