Skip to content

266 file picker in forms#321

Merged
Elena-kal merged 4 commits intodevfrom
266-file-picker-in-forms
Mar 29, 2026
Merged

266 file picker in forms#321
Elena-kal merged 4 commits intodevfrom
266-file-picker-in-forms

Conversation

@Elena-kal
Copy link
Copy Markdown
Collaborator

@Elena-kal Elena-kal commented Mar 27, 2026

Description

fixes #266
Before the user could choose any file for the file import although we had a file picker implemented for the frontend but did not use it in the backend. The user should now only be able to import the file types we want them to. (Well not really, there is a way around it - but at least it is visible which file types are expected.)

Changes

One little line in forms.py and everywhere where we use the File Import Field.

Testing

Create a run and check out any step that requires you to upload a file.

PR checklist

Development

  • If necessary, I have updated the documentation (README, docstrings, etc.)
  • If necessary, I have created / updated tests.

Mergeability

  • main-branch has been merged into local branch to resolve conflicts
  • The tests and linter have passed AFTER local merge
  • The backend code has been formatted with black
  • The frontend code has been formatted with pnpm format and checked with pnpm lint

Code review

  • I have self-reviewed my code.
  • At least one other developer reviewed and approved the changes

@Elena-kal Elena-kal requested review from AnnaPolensky and tE3m March 27, 2026 06:55
@github-actions
Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  backend/protzilla
  form.py
Project Total  

This report was generated by python-coverage-comment-action

Copy link
Copy Markdown
Collaborator

@tE3m tE3m left a comment

Choose a reason for hiding this comment

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

Good changes! Not sure about all allowed suffixes though - take a look :)

name="file_path",
label="MaxQuant intensities file (proteinGroups.txt)",
value=None,
accept=".txt,.tsv,.csv",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a tricky one. While any of csv, tsv, txt are possible, only txt makes sense, right? MQ will always output the file as proteingroups.txt, so does it make sense to allow the other ones?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same goes for all the other tool-specific imports (DIA-NN, MSFragger, MQ peptides/evidence)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

While you are correct, I wouldn't be overly strict here. Rather allow more file types that could be parsed and not unnecessarily restrict the user.
I could imagine there's at least one biologist out there who has MaxQuant-like protein data in a file that doesn't end in .txt.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I get that and I wouldn't suggest restricting it further if this implementation actually didn't allow selecting files that don't adhere to the accept specification. At least on all machines I tested, the file picker allows ignoring the accept spec. I'm also fine with leaving as is.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah sorry, I didn't phrase it properly. I know that it also allows other file types, but at least on my OS, it requires an extra click. This is at most a minor inconvenience, so it wouldn't be a big deal to implement your proposal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I made it a bit stricter. Some definitely take and expects tsv, here I only took out the csv because txt seems to be some kind of standard everywhere. For peptide, MaxQuant and Evidence I restricted it to only txt. What do you think?

@Elena-kal Elena-kal removed the request for review from AnnaPolensky March 28, 2026 08:35
Copy link
Copy Markdown
Collaborator

@tE3m tE3m left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@Elena-kal Elena-kal merged commit c5b3dc7 into dev Mar 29, 2026
1 check passed
@Elena-kal Elena-kal deleted the 266-file-picker-in-forms branch March 29, 2026 01:17
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.

3 participants