GMOD / Apollo3

JBrowse 2 plugin for editing annotations on an Apollo server
Apache License 2.0
7 stars 4 forks source link

Detect file type in "Add assembly" dialog #141

Closed garrettjstevens closed 2 years ago

garrettjstevens commented 2 years ago

In this dialog, when a user uploads a file and the file type can be detected, toggle the radio button to the detected file type. File type may be detected by name and/or contents (up to the implementer).

These changes will be made in packages/jbrowse-plugin-apollo/src/components/AddAssembly.tsx, specifically in handleChangeFile.

haessar commented 2 years ago

Pushed a simple implementation that switches to the FASTA radio when a ".fa" or ".fasta" file extension is selected, and GFF3 for all else. Made use of existing "fileType" constant to assign the status. Parsing file contents might be a bit overkill (is it easy to do that before the input file is even submitted?)

garrettjstevens commented 2 years ago

@haessar Could you open a PR of your branch?