galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.4k stars 1.01k forks source link

Text editor tool #9352

Closed simonbray closed 4 years ago

simonbray commented 4 years ago

It would be useful to have a simple text editor tool in Galaxy. For example, I'm working on developing molecular dynamics tools on usegalaxy.eu; these tools use config files which often need to be modified slightly between runs. It would be really nice to be able to do this in Galaxy rather than downloading and reuploading.

The tool should work as follows: the user selects a dataset to edit, the dataset is loaded into a very simple text editor interface and the user makes some changes. Then the results are saved to a new dataset. Optionally a diff file could be saved as well.

As always I'm willing to implement this myself but would appreciate some tips where to start.

(I'm aware this is also possible using the interactive tools on usegalaxy.eu but this seems like overkill for such a simple functionality.)

simonbray commented 4 years ago

ping @anuprulez, @OlegZharkov - maybe one of you is interested in helping? I would probably need some help with JS stuff. Björn suggested this could be integrated as a visualization.

simonbray commented 4 years ago

(Though this poses the same problem that Pavan has currently, i.e. how to return an output from the visualization to the history as a dataset.)

bernt-matthias commented 4 years ago

Do you have an example of such a file. Wondering if there is an alternative...

simonbray commented 4 years ago

We've been discussing a number of alternatives. One would be to create tools based on packages like parmed or GromacsWrapper (https://github.com/ParmEd/ParmEd; https://github.com/Becksteinlab/GromacsWrapper), but I don't think this provides the required flexibility.

Another idea I had was a generic tool for manipulating text files (PR: https://github.com/bgruening/galaxytools/pull/954) but I think this is not very intuitive for the user.

OlegZharkov commented 4 years ago

@simonbray and @pavanvidem. If you just want to export (modified) visualization to history, here is how you do it. https://github.com/galaxyproject/galaxy/blob/1a60ac03e477602290ab11cf0015c18efc917c73/config/plugins/visualizations/editor/templates/editor.mako#L34-L49 Maybe I will need to make it as a separate library

simonbray commented 4 years ago

ping @pavanvidem

OlegZharkov commented 4 years ago

@simonbray @pavanvidem there is a new better way, no need to deal with encodeURI anymore https://github.com/galaxyproject/galaxy/blob/6ef0983c8af54299a1bf37c7469bb59cda7a912a/config/plugins/visualizations/editor/templates/editor.mako#L33-L58

pavanvidem commented 4 years ago

sorry, somehow I missed this thread regardless of multiple pings. This is exactly what we were also looking for our visualization. @anuprulez is the developer of this visualization. He should understand better than me how it works. From the comments I understood that there is a way which is great!