Commit Graph
2769 Commits
Author SHA1 Message Date
Nicola Soranzo 452aba9ee3 Fix remaining issues reported by bugbear; add it to flake8 reqs 2021-01-16 05:58:15 +00:00
Marius van den Beek af4d041dc9 Merge pull request #10592 from hexylena/edam-tool-panel
EDAM tool panel
2021-01-08 18:56:28 +01:00
Nicola Soranzo 970c23015e Remove commented lines 2021-01-07 20:42:27 +00:00
Helena Rasche f5a3545541 Merge branch 'dev' into edam-tool-panel 2021-01-07 19:54:12 +01:00
M Bernt ea88a8a5a3 allow empty file uploads 2021-01-07 19:38:53 +01:00
John Chilton e824a9e93e Merge pull request #10862 from mvdbeek/refactor_mkstemp
Replace usage of mkstemp with NamedTemporaryFile
2020-12-18 10:07:45 -05:00
Anthony Bretaudeau a9cc68c151 Update askomics IT to 4.1.1 2020-12-09 12:41:56 +01:00
mvdbeek ccdb6c3f10 Replace usage of mkstemp with NamedTemporaryFile 2020-12-07 22:31:53 +01:00
mvdbeek 297005e534 Merge branch 'release_20.09' into dev 2020-12-07 18:31:59 +01:00
mvdbeek 53f8215d56 Fix unclosed file descriptors returned by mkstemp 2020-12-04 18:49:13 +01:00
John Chilton bb3f77b981 Implement pick_values expression tool...
... for CWL-style merging of conditional branches in native Galaxy workflows.

I have CWL conditionals working down stream - the simply attach an expression to steps of the workflow and replace all the outputs with null values if the expression does not evaluate to "true". This is the CWL way of "branching" in conditionals, the matching CWL syntax for merging branches is simply to pick non-null values from various branches to continue the workflow with. This tool would is a very natural Galaxy way of doing that.

This tool could be used to build some cool conditional logic with collections without even needing the forthcoming 'when' expressions on workflow steps. Imagine for instance, we added a "Replace Failed" (or "Replace Empty") collection operation to match "Filter Failed" (or "Filter Empty") that could replace collection elements with 'null' values or a supplied default. We could then run two different algorthims across a list (e.g. one that works well for small datasets but fails out for large ones and one that works well with large datasets) and then run "Replace Failed" with null values and then map both results over this tool. Using purely data flow constructs you've picked the right tool for each element of a list.

I haven't added this to the default tool panel yet though, might be worth waiting for either those when branching expressions or more collection operation tool support.
2020-11-17 11:46:36 +01:00
Nicola Soranzo 1e9f83b53e Add missing single-quotes in tools Cheetah 2020-11-10 19:29:22 +00:00
Helena Rasche 646b133bb3 Add EDAM topics to unannotated tools 2020-10-30 17:59:45 +01:00
mvdbeek d0ad9b624c Merge branch 'release_20.09' into dev 2020-10-14 10:10:39 +02:00
Björn Grüning 1e428e53fa remove stop_err 2020-10-13 09:55:36 +02:00
Björn Grüning eb13388ee6 Update velvetg_wrapper.py 2020-10-13 09:53:02 +02:00
Björn Grüning 98e65c5f89 some trick for velvetg 2020-10-12 13:41:57 +02:00
Björn Grüning 43943ffc6a the byte string is also needed 2020-10-12 13:24:34 +02:00
Björn Grüning 9768cbf8d2 string.join is gone in py3k 2020-10-12 12:32:23 +02:00
Nicola Soranzo 9d74bba7fb Drop support for retired Python 3.5
Upgrade syntax using `pyupgrade --py36-plus` .

Manually drop several `six` imports.

Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
2020-10-07 11:52:13 +01:00
Dannon Baker b99f14eda3 Merge remote-tracking branch 'upstream/release_20.05' into release_20.09 2020-09-23 21:29:26 -04:00
Dannon Baker f27a6fa081 Merge remote-tracking branch 'upstream/release_20.01' into release_20.05 2020-09-23 21:07:42 -04:00
Alexandru Mahmoud 7944706467 filtering.py check_expression adding 'Constant' 2020-09-23 16:57:26 -04:00
Alexandru Mahmoud da860b09c8 filtering.py check_expression adding 'Constant' 2020-09-22 17:04:52 -04:00
Marius van den Beek bae72b948a Merge pull request #9915 from xgaia/release_20.05_askomics_it_4.0.0
Update AskOmics IT to askomics 4.0.0
2020-09-22 12:24:18 +02:00
Dannon b77135ad1f Merge pull request #9805 from astrovsky01/higlass_it_update
Higlass InteractiveTool update
2020-09-17 12:56:02 -04:00
Alexander OSTROVSKY 6308f16e98 Typo 2020-09-17 09:44:07 -07:00
Alexander OSTROVSKY e5649a94b7 Alpha comment in help 2020-09-17 09:37:03 -07:00
Anthony Bretaudeau 15609ca856 tabs 2020-09-15 12:04:41 +02:00
Anthony Bretaudeau 20e0be241a fix crash when no input selected 2020-09-15 12:02:02 +02:00
Marius van den Beek cbbcf15c1d Merge pull request #10145 from wm75/trimmer-simplify
Fix and simplify built-in trim tool
2020-09-08 15:42:16 +02:00
Wolfgang Maier 41c547999b Bump tool wrapper version 2020-08-26 15:59:44 +02:00
Wolfgang Maier e003fbc081 Add doctests for additional allowed types 2020-08-26 14:17:43 +02:00
Wolfgang Maier 8639de2dee Allow unary plus and minus in filtering 2020-08-26 14:06:40 +02:00
Wolfgang Maier d89f0af178 Fix and simplify built-in trim tool
In the previous version, specifying a negative end position would cause
a "rotating" behavior of the slice when the reverse index was larger
than the length of the string.
The fixed version also detects out of range column specifications
correctly and should be faster since it uses a set instead of a list
lookup and does int conversions up front instead of inside the loop.
2020-08-24 17:38:25 +02:00
Björn Grüning f0179efb6a Merge pull request #9888 from jmchilton/galaxy_files_2
Pluggable URI handling across upload components.
2020-07-27 23:08:20 +02:00
John Chilton 67ef0a4a75 Enable uploading extra files via the data fetch API endpoint.
Implement both datatype driven composite files and free-style extra files - both implemented in much more hacky ways in current upload.xml API driven endpoint.
2020-07-22 11:10:39 -04:00
John Chilton f93cc11e66 Pluggable URI handling across upload components.
*Overview*

This work defines an interface for interacting with "filesystem"-like entities during "upload". In addition to being a pluggable framework adding important new capabilities to Galaxy, this is a generalization and formalization of existing file sources (e.g. the directories described by `library_import_dir`, `user_library_dir`, and `ftp_upload_dir`).

*Plugin Infrastructure*

This introduces a new plugin `FilesSource` to represent sources of directories and files during "upload". A `FilesSource` plugin should be able to index directories and download (called 'realize' to be generic) files to local posix directories. Indexing is used by the remote_files API to provide the client with hierarchies to navigate and to build URIs for the files. The 'realize' operation is used by the 'upload1' and '__DATA_FETCH__' and tools during upload to bring the files into Galaxy as datasets.

An instance of the `ConfiguredFileSources` class is responsible for managing individual instances of `FilesSource` plugins. It has methods to map URIs to the appropriate plugin instance.

The `ConfiguredFileSources` class tracks the loaded plugins and reuses the go to `galaxy.util.plugin_config` module for loading YAML (or XML) definitions of plugins (the same dependency resolvers, job metrics, auth backends, etc. do). A `ConfiguredFileSources` object can serialize itself to a file and re-materialize it during job execution to allow using this abstraction during uploads.

When operating within the Galaxy app, the `ConfiguredFileSources` uses an adapter pattern to parse user-level information from Galaxy's `trans` object. During serialization, the `ConfiguredFileSources` object is expected to encode all the required information about the user that is needed into the output JSON description of the file sources. This is because the web transaction won't be available remotely during the upload job. These objects working in such different ways between the Galaxy process and in the remote job is mildly jarring - so unit tests have been written to ensure this all functions properly.

*Plugin Implementations*

The `FilesSource` interface has a helper implementation base class `BaseFilesSource` that provides some assistance for plugin development. Additionally, the base class `PyFilesystem2FilesSource` extends `BaseFilesSource` but assumes a PyFilesystem2 implementation exists to target the file source of interest - so the plugin author need only provide a PyFilesystem `FS` object describing the target. This commit includes three concrete implementations - posix, webdav, and dropbox. `posix` extends `BaseFilesSource` while the others are light-weight extensions of `PyFilesystem2FilesSource`.

**posix**

While one could imagine a very lightweight implementation based on `PyFilesystem2FilesSource` this fully worked through plugin is implemented directly to ensure we respect Galaxy's strong security checks on paths containing symlinks and preserve the semantics `user_library_import_symlink_allowlist`.

**webdav**

Galaxy tools for integrating OwnCloud exist - see https://github.com/shiltemann/Galaxy-Owncloud-Integration, part of the driver for this work was extending that idea to provide more integrated UX for uploading that data. So this work includes a WebDav plugin (and associated test cases) that could potentially target OwnCloud.

This plugin was a good exercise in flushing and testing the PyFilesystem2 interface but the PyFilesystem2 WebDAV implementation seems a bit fragile... we might want to replace it with more direct APIs but we can take a wait and see approach.

The config YAML for a webdav plugin that lets user's target their own OwnCloud servers configured via user preferences might look something like:

```
- type: webdav
  id: owncloud1
  label: OwnCloud
  doc: User-configured OwnCloud files
  url: ${user.preferences['owncloud|url']}
  login: ${user.preferences['owncloud|username']}
  password: ${user.preferences['webdav|password']}
```

The configuration would provide a user's OwnCloud files at `gxfiles://owncloud1/`.

If instead, a big centralized WebDav server is made available with public data for all users (mirroring use cases of `library_import_dir`) - a simpler configuration not requiring user preferences might be something like:

```
- type: webdav
  id: lab
  label: Lab WebDAV server
  doc: Our lab's research files managed at ourlab.org.
  url: http://ourlab.org:7083
  login: ${environ.get('WEBDAV_LOGIN')}
  password: ${environ.get('WEBDAV_PASSWORD')}
```

The configuration would provide a these WebDAV files at `gxfiles://lab/`.

These two examples demonstrate basic templating is allowed inside the YAML configuration. These are Cheetah templates exposing very specific views of the 'user', 'config', and the whole 'environ' available to the Galaxy server.

**dropbox**

The Dropbox PyFilesystem2 plugin is even easier to configure, all that is needed is a Dropbox access token (this can be configured from the settings menu and may be isolated to a specific app specific folder for added security on the user's part).

An example of such a plugin might be:

```
- type: dropbox
  id: dropbox1
  label: Dropbox Files
  doc: Your Dropbox files - configure an access token via the user preferences
  accessToken: ${user.preferences['dropbox|access_token']}
```

The configuration would provide a user's Dropbox files at `gxfiles://dropbox1/`.

**gxftp**

This is an automatically populated plugin (if `ftp_upload_dir` is configured in Galaxy) that provides the user's FTP files at `gxftp://`.

**gximport**

This is an automatically populated plugin (if `library_import_dir` is configured in Galaxy) that provides Galaxy's library import files at `gximport://`.

**gxuserimport**

This is an automatically populated plugin (if `user_library_import_dir` is configured in Galaxy) that provides the requesting user's Galaxy's user library import files at `gximportfiles://`.

*Why not a tool?*

One could imagine a tool - but the upload dialog has many advanced options for selecting how to ingest files (convert tabs and newlines, select format vs. detect, select dbkey, organize into collections, organize via rules, etc...). It would be next to impossible to provide all these same options via a normal tool and the user experience would be very different than using the upload components in Galaxy - which have been optimized and designed for this task.

That said - one future direction I would like to take this is to be able to mark plugins as writable and implement a new tool form input type "export_directory" or something like that. This could then be used to write data export tools. This could be used to write generalizations of the the cloud send tool.

*`ObjectStore` vs `FilesSource`*

ObjectStores provide datasets not files, the files are organized logically in a very flat way around a dataset. `FilesSource` s instead provide files and directories, not datasets. A `FilesSource` is meant to be browsed in hierarchical fashion - and also has no concept of extra files, etc..

*Future Work*

- This is hopefully going to serve as the basis of a first pass at Terra integration with Galaxy using the FISS lib. Having an implementation based on `PyFilesytem2` means we could potentially integrate support for S3, Basespace, Google Drive, OneDrive, etc..
- Tool form support for selecting files for import and directories for export.
- Allow writing collection archives, history export, etc.. to the `FilesSource` - this would really enhance the UI around getting big stuff out of Galaxy potentially I think.

Rebase into galaxy.files...
2020-07-14 10:09:50 -04:00
John Chilton 62fe61abdc Fix sniffing composite files to reuse existing abstractions. 2020-07-14 10:09:19 -04:00
Xavier Garnier 7d4f0f13ad add extension of rdf bed and gff files 2020-07-01 17:34:04 +02:00
Alexander OSTROVSKY e4775b3f96 add folders, new image 2020-06-30 09:58:34 -07:00
xgaia 91d53e9274 add rdf file format 2020-06-30 11:00:25 +02:00
xgarnier 8531f20cbc pin version 2020-06-25 15:58:07 +02:00
xgarnier c2bd16bdba update tool to askomics 4.0.0 2020-06-25 15:47:17 +02:00
Dannon 580c36af87 Merge pull request #9892 from mvdbeek/tsv_sra_manifest
[20.05] Output SRA manifest as tabular dataset
2020-06-23 11:45:26 -04:00
mvdbeek 278a033372 Add SraManifest datatype
This datatype auto-generates its column_names from the first line of the
dataset, since the user can choose which columns to include.
2020-06-22 17:03:26 +02:00
mvdbeek ee8d9f0877 Update sra_source tool to outut sra_manifest.tabular 2020-06-22 17:01:36 +02:00
Nicola Soranzo 41af684cc2 Fixes for flake8 3.8 and bugbear 2020-06-20 18:10:54 +01:00
Alexander OSTROVSKY b252577bfb added environmental variables 2020-06-17 16:48:30 -07:00
Alexander OSTROVSKY 82c04af9bd names fixed 2020-05-21 11:29:00 -07:00