Commit Graph
172 Commits
Author SHA1 Message Date
John Chilton 4a345b99c3 Fix security problems when extracting untrusted tar files.
Fixes GX-2018-0006.
2018-10-04 11:32:52 -04:00
John Chilton 09fcf13aaf Merge pull request #5872 from abretaud/filter_sanitize
Filter tool: fix too strict sanitizing
2018-04-20 07:17:55 -04:00
Anthony Bretaudeau dc4902353f add test case for fixed bug 2018-04-20 09:44:27 +02:00
John Chilton 145903eae3 Merge remote-tracking branch 'jmchilton/dev' into sort_header 2018-04-19 12:57:18 -04:00
John Chilton b3f589cc93 For rule builder, use Python-like regular expressions in-browser.
Leverages the [pyre-to-regexp](https://github.com/jmchilton/pyre-to-regexp) that I recently published for this purpose.
2018-04-07 09:17:37 -04:00
John Chilton 083bdcbdd8 Rule-based Collection Builder
Vue-based component for defining collections by applying rules to a list of files or more general spreadsheet style information (e.g. sample sheets or tabular data from data sources containing URL or FTP file paths for files along with metadata). The widget is fairly complex but very broadly is broken into two panes - one to preview how rules are applied to build up tabular data defining collections (each row corresponding to a file with columns for metadata and such) and one that displays defined rules and allows for editing of these rules and creation of new ones.

The goal behind defining rules this way instead of allowing the user to interact with the spreadsheet display directly is to enable scaling up collection creation. If a user wishes to upload hundreds of datasets - interacting with a widget directly for each input doesn't scale well and would be error prone. If a user wishes to upload hundreds of thousands of datasets - even loading this information in the GUI may not scale (though I've been impressed with the performance so far of this approach) and so we can potentially just display a preview of some of the rows and process the final set of rules on the backend.

Since we can handle an arbitrary number of columns this way, we can define multiple list identifiers per file and so we can easily construct nested lists. Hence this allows creation of not just potentially larger collections but arbitrarily complex lists as well. Paired identifiers via indicator columns are also implemented.

In order to operate over lists of datasets directly - the multi-select history widget now has a new option "Build Collection from Rules" along side the other collection builders. This mode uses the well established dataset collection API to build collections from HDAs.

In order to operate on lists of FTP files or URLs - the upload widget has a new tab "Rule-based" tab that allows users to paste in tabular data or select a history dataset and then send this tabular data to the new builder widget. This will be extended to include FTP directories for instance over time. This mode uses the new data fetch API to build collections and handle uploads of arbitrary collections of files.

The preview of the tabular data generated via rules is done via [Handsontable](https://handsontable.com/) - a JavaScript spreadsheet widget with a VueJS [wrapper component](https://github.com/handsontable/vue-handsontable-official). This turns out to be a fairly nice application for reactive components - as rules are added or modified the spreadsheet just naturally updates. In my hands the widget scales very nicely - I've uploaded files with tens of thousands of rows and rules modifying the data and changing the spreadsheet do not seem to cause siignificant delays in the web browser.
2018-03-29 11:07:06 -04:00
John Chilton d651348da6 More upload tests and fixes. 2018-03-08 10:33:42 -05:00
John Chilton 1c6cc02415 Hierarchical upload API optimized for folders & collections.
Allows describing hierarchical data in JSON or inferring structure from archives or directories.

Datasets or archive sources can be specified via uploads, URLs, paths (if admin && allow_path_paste), library_import_dir/user_library_import_dir, and/or FTP imports. Unlike existing API endpoints, a mix of these on a per file basis is allowed and they work seemlessly between libraries and histories.

Supported "archives" include gzip, zip, bagit directories, bagit achives (with fetching and validations of downloads).

The existing upload API endpoint is quite rough to work with both in terms of adding parameters (e.g. the file type and dbkey hanlding in 4563 was difficult to implement, terribly hacky, and should seemingly have been trivial) and in terms of building requests (one needs to build a tool form - not describe sensible inputs in JSON). This API is built to be intelligable from an API standpoint instead of being constrained to the older style tool form. Additionally it built with hierarchical data in mind in a way that would not be easy at all enhancing the tool form components we don't even render.

This implements 5159 though much simpler YAML descriptions of data libraries should be possible basically as the API descriptions. We can replace the data library script in Ephemeris https://github.com/galaxyproject/ephemeris/blob/master/ephemeris/setup_data_libraries.py with one that converts a simple YAML file into an API call and allows many new options for free.

In future PRs I'll add filtering options to this and it will serve as the backend to 4733.
2018-03-08 10:33:36 -05:00
Nicola Soranzo 1118e6f1be Merge branch 'release_18.01' into dev
Conflicts:
	lib/galaxy/datatypes/binary.py
2018-03-05 19:03:30 +00:00
mvdbeek bb19c7e448 Add queryname sorted and input sorted datatypes
The queryname sorted datatype (BamQuerynameSorted) ensures that the file is
queryname ordered.  The BamInputSorted datatype can be used to describe the
output of aligners, which usually keep mate pairs adjacent. The BamInputSorted
datatype allows using tools that require mates to be adjacent, without
requiring an explicit sorting step.  This can reduce the time and space
required for duplicate marking tools, HiC tools and structural variant
detection tools that require mates to be grouped together in an alignment file.

The BamQuerynameSorted has a converter that works for all datatypes that can be
consumed by samtools. There is no converter for BamInputSorted, since
BamQuerynameSorted is valid input for tools requiring BamInputSorted
input.

I'm targeting 18.01 since I think it would be very unfortunate if we start
annotating aligners with the very loose BamNative datatype, since this datatype
does not make any promises about sort order at all.

This closes https://github.com/galaxyproject/galaxy/issues/5497, goes
a long way towards the problems mentioned in https://github.com/galaxyproject/galaxy/issues/5496
and would make https://github.com/galaxyproject/tools-iuc/pull/1732 and https://github.com/galaxyproject/tools-iuc/pull/1591 better
2018-02-22 19:59:55 +01:00
mvdbeek d14bae73f7 Flush once per tag
Not sure this is the right thing to do (maybe there is a better way to get an ID?), but it avoids
```
IntegrityError: (psycopg2.IntegrityError) duplicate key value violates unique constraint "tag_name_key"
DETAIL:  Key (name)=(group) already exists.
 [SQL: 'INSERT INTO tag (type, parent_id, name) VALUES (%(type)s, %(parent_id)s, %(name)s) RETURNING tag.id'] [parameters: {'parent_id': None, 'type': 0, 'name': u'group'}]
galaxy.tools.execute WARNING 2018-02-06 15:22:38,808 [p:2122,w:1,m:0] [uWSGIWorker1Core1] There was a failure executing a job for tool [__TAG_FROM_FILE__] - Error executing tool: (psycopg2.IntegrityError) duplicate key value violates unique constraint "tag_name_key"
```
2018-02-07 10:58:58 +01:00
mvdbeek b114f3f7b9 Add tool that tags collection elements from a file
This tags collection elements (but not collections).
2018-02-06 16:39:03 +01:00
Björn Grüning ae0c3524b8 Merge branch 'dev' into bam_unsorted 2018-01-15 12:57:56 +01:00
John Chilton 60e0b3af62 Merge pull request #5273 from mvdbeek/sort_collection_from_file
Allow sorting collection elements based on file
2018-01-08 09:03:30 -05:00
mvdbeek 264b8680f3 Allow sorting collection elements based on file
Given a collection with element_identifiers:

```yml
element_1
element_2
```

we can arbitrarily re-order collection elements using a dataset
that specifies the new order, e.g

```
element_2
element_1
```

I think this nicely complements numeric and alphanumeric sorts that are
already possible with this tool.
2018-01-08 08:49:26 +01:00
John Chilton dc67206b21 Merge remote-tracking branch 'jmchilton/dev' into neo_datatype 2017-12-12 10:23:41 -05:00
Bjoern Gruening 2569851498 use unsorted sam file for tests 2017-12-10 15:23:26 +01:00
Bjoern Gruening 017dad025d add new test file 2017-12-10 15:23:26 +01:00
Nicola Soranzo 4a19bf62e3 Add missing newline at end of some test files
It gets added anyway when the file is uploaded to Galaxy due to the
default "Use POSIX standard" (to_posix_lines) option. Many tests which
simply copy them with cat and compare them would fail a strict diff test.
2017-11-28 17:13:18 +00:00
John Chilton cc3c3a9b92 Implement outline of Jupyter testing. 2017-10-02 09:50:37 -04:00
Dannon Baker d887cb17f0 Merge join_header into dev. 2017-09-06 20:35:33 -04:00
John Chilton 06ca789f92 Configuration tests for the last few upload enhancements. 2017-08-12 07:13:05 -04:00
pjvan_thof 99703469c0 Added test file 2017-07-07 18:29:05 +03:00
lecorguille 47437d0540 sort with header: done 2017-06-26 19:07:14 +02:00
lecorguille de9a5a526b sort with header: add test-data for the state of art 2017-06-26 17:00:13 +02:00
lecorguille f8bc407617 join with header: add a use case with a fill value 2017-06-26 15:12:21 +02:00
lecorguille 712a7045e5 join with header: add a regression test 2017-06-26 15:12:15 +02:00
lecorguille 5cf405902b join with header: add test 2017-06-26 15:11:51 +02:00
lecorguille 13ab2fd1a4 join with header: add test-data output files 2017-06-26 15:11:39 +02:00
peterjc c87e0eedb7 Cope with GFF3 as well as legacy GFF.
In GFF3 have key=value rather than space separated
as in legacy GFF and GTF format. Closes #3068.
2017-06-26 11:16:06 +01:00
Zipho Mashologu 791a746934 added tests 2017-06-13 16:09:00 +02:00
John Chilton 49abfced09 Implement collection operation for filtering lists from a file. 2017-04-17 17:08:25 -04:00
John Chilton 2288a88ab7 Fix relabel_from_file collection operation error handling if duplicate identifiers. 2017-04-17 13:12:57 -04:00
John Chilton 09bcdd9185 Various improvements to relabel from file collection operation.
- Better error handling (check for bad characters when creating collections).
- Implement a strict mode parameter to do even more validation.
- Rework tabular vs txt mode to be explicit user choice.
- Mirror fix in release_17.01 for datasets not having a history,
2017-04-13 23:15:56 -04:00
mvdbeek d21c14f009 Add possibility to rename collection items from a tabular file 2017-04-13 23:11:49 -04:00
John Chilton 9b6a9dc0c7 Start work on a relabelling collection operation.
I think it needs to be touched up but the basic operation seems to work so far. I think what remains to be done is:

 - Validate uniqueness of identifiers and provide nice messages if they are not unique.
 - Validate that at least the required number of lines are present in the file and provide a nice message if not.
 - Add strict mode to ensure exactly the correct number of lines is added.
 - Find where validation of identifiers happens in the API and apply same validation here - try not to let unsafe identifiers be created.
 - Consider more advanced modes - selecting a column, apply a regex replace, pick two columns for nested lists, etc.... None of this may need to be needed in the first iteration.
 - Consider another mode where a collection is labelled against an existing collection - should that be a separate tool of the same tool.
2017-04-13 23:11:49 -04:00
jvolkening 105557ba35 added functional test for <is_valid_xml> 2017-02-01 21:17:07 -06:00
John Chilton a87feb11ff Merge pull request #3145 from mvdbeek/fastqgz
Support for gzipped fastq formats
2017-01-11 21:18:22 -05:00
Anthony Bretaudeau 99a037d5b9 add fastq(*).bz2 datatypes and converters 2016-11-24 15:37:51 +01:00
mvdbeek 592f15c7b5 Add sam-to-bam conversion test tool 2016-11-16 22:01:47 +01:00
mvdbeek 10f1bb5459 Create a BaseFastq class and add test tools
Having a BaseFastq class allows Fastq and FastqGz classes to inherit from
BaseFastq. FastqGz is therfor not a Fastq datatype and goes through the
converter.

Also add 2 tools to demonstrate that compressed fastq will be converted to
uncompressed fastq if the tool specifies `format="fastq"`, while
`format="fastq.gz"` leaves files compressed.

The tool test can be run with:
```
planemo test --galaxy_root .  test/functional/tools/compressed_fastq_no_conversion.xml
planemo test --galaxy_root .  test/functional/tools/compressed_fastq_conversion.xml
```

Note that fastq conversion appears to required a galaxy user session, and
planemo testing fails. Interactive testing with `planemo serve` is not affected
and works fine.
2016-11-11 16:13:18 +01:00
zipho deaa904eb9 reduced the size of the neostore zip file 2016-07-25 11:43:34 +02:00
zipho 6ce1844bf7 added the sample neostore datatype (zipped) and disabled upload feature 2016-07-14 11:50:37 +02:00
Nicola Soranzo bb5dc6e20b Merge branch 'release_16.04' into dev 2016-06-08 16:09:39 +01:00
Daniel Blankenberg 42739c88c8 Add test for failing handling of BIOM1 metadata. 2016-06-07 12:02:09 -04:00
John Chilton 1ba74094a3 Improve composite output tool test.
- Rename expected output Log from input Log. This relieves a concern I had that the tests were just working because the inputs and outputs match.
 - Add another "unregistered" output file to the output directory and add a test for it. This verifies that such files are infact tested.
 - Add a nested "unregistered" output file to the output directory and add a test for it. This verifies that nested files are tested.
2016-05-16 11:51:03 -04:00
Dannon Baker 39eb262219 More fixes to 3.bam to make it valid stripped out secondary HD header and duplicated sequences chr10-16 2016-02-02 13:54:24 -05:00
Dannon Baker ba9ad97c40 Fix 3.bam @PG header to use : instead of = as a key:value separator. See commentary in https://github.com/galaxyproject/galaxy/pull/1638 for more details. 2016-02-02 09:30:30 -05:00
John Chilton 61fda5f23d Add missing file from previous commit. 2015-09-23 15:10:06 +01:00
John Chilton 2b02677e85 Workaround for metadata_bam.xml failure. 2015-09-19 10:27:09 +01:00