diff --git a/lib/galaxy/tools/convert_sample_sheet.xml b/lib/galaxy/tools/convert_sample_sheet.xml index 0ed0a43a700..44477b900e3 100644 --- a/lib/galaxy/tools/convert_sample_sheet.xml +++ b/lib/galaxy/tools/convert_sample_sheet.xml @@ -26,21 +26,83 @@ Synopsis ======== -Converts a sample sheet collection back to its corresponding list collection type. +Strips sample sheet metadata and produces a regular list collection. + +======================== +What is a sample sheet? +======================== + +A sample sheet is a special type of Galaxy collection that pairs each dataset with structured metadata — such as replicate number, treatment condition, or tissue type. It works like a regular list collection but with an attached spreadsheet of per-sample information. =========== Description =========== -This tool takes a sample sheet collection and produces a regular list collection, removing all sample sheet metadata (column definitions and row values). +This tool removes the metadata layer from a sample sheet and converts it to the corresponding regular list collection type. The datasets themselves are unchanged — only the column definitions and row values are discarded. The conversion follows this mapping: -- ``sample_sheet`` becomes ``list`` -- ``sample_sheet:paired`` becomes ``list:paired`` -- ``sample_sheet:paired_or_unpaired`` becomes ``list:paired_or_unpaired`` +- ``sample_sheet`` → ``list`` +- ``sample_sheet:paired`` → ``list:paired`` +- ``sample_sheet:paired_or_unpaired`` → ``list:paired_or_unpaired`` -Use this tool when you need to pass a sample sheet to a tool that expects a regular list collection, or when you want to discard the sample sheet metadata. +Use this when you need to pass a sample sheet to a tool that only accepts regular list collections. + +======== +Examples +======== + +**Flat sample sheet** + +Suppose you have an RNA-seq experiment uploaded as a sample sheet collection with metadata about each sample:: + + Sample Sheet: "RNA-seq experiment" + Column definitions: replicate (int), treatment (string) + + sample1.fastq | replicate=1, treatment="control" + sample2.fastq | replicate=2, treatment="treated" + +Running **Convert sample sheet** strips the metadata and produces a plain list:: + + List: "RNA-seq experiment (converted)" + + sample1.fastq + sample2.fastq + +Same datasets, same identifiers, but now it is a regular list that any tool can consume. + +------- + +**Paired sample sheet** + +If your sample sheet contains paired-end reads (``sample_sheet:paired``), the tool converts it to ``list:paired``:: + + Sample Sheet (paired): "WGS samples" + Column definitions: replicate (int) + + sample1 -> [forward, reverse] | replicate=42 + sample2 -> [forward, reverse] | replicate=43 + +After conversion:: + + List (paired): "WGS samples (converted)" + + sample1 -> [forward, reverse] + sample2 -> [forward, reverse] + +The paired structure is preserved; only the metadata is removed. + +------- + +.. image:: ${static_path}/images/tools/collection_ops/convert_sample_sheet.svg + :alt: Convert sample sheet to list collection + :width: 500 + +------- + +.. class:: warningmark + +If you need to preserve the metadata, use the **Sample sheet to tabular** tool first to export it as a tab-separated table before converting. ---- diff --git a/lib/galaxy/tools/sample_sheet_to_tabular.xml b/lib/galaxy/tools/sample_sheet_to_tabular.xml index c92c00768f1..1da60a36453 100644 --- a/lib/galaxy/tools/sample_sheet_to_tabular.xml +++ b/lib/galaxy/tools/sample_sheet_to_tabular.xml @@ -2,6 +2,9 @@ name="Sample sheet to tabular" version="1.0.0"> to extract sample sheet metadata as a table + + model_operation_macros.xml + operation_3359 @@ -45,17 +48,81 @@ cp '$out_config' '$output' Synopsis ======== -Converts sample sheet metadata into a tabular dataset. +Exports the metadata from a sample sheet collection as a tab-separated table. + +======================== +What is a sample sheet? +======================== + +A sample sheet is a special type of Galaxy collection that pairs each dataset with structured metadata — such as replicate number, treatment condition, or tissue type. It works like a regular list collection but with an attached spreadsheet of per-sample information. =========== Description =========== -This tool takes a sample sheet dataset collection and extracts its metadata into a tab-separated file. Each row corresponds to an element in the sample sheet collection. The first column contains the element identifier, followed by columns for each metadata field defined in the sample sheet. +This tool reads the column definitions and row values from a sample sheet collection and writes them to a tabular dataset. The first column is always the element identifier (sample name). The remaining columns match the metadata fields defined in the sample sheet. The datasets in the collection are not affected — only the metadata is extracted. When **Include column headers** is enabled, the first row will contain the column names, with ``element_identifier`` as the first column followed by the names from the sample sheet column definitions. You can customize how special values are represented in the output using the replacement parameters for null values, empty strings, and boolean values. +======== +Examples +======== + +**Basic extraction (without headers)** + +Given a sample sheet with three samples and two metadata columns (``replicate`` of type int, ``treatment`` of type string):: + + Sample Sheet: "RNA-seq experiment" + + sample1.fastq | replicate=1, treatment="control" + sample2.fastq | replicate=2, treatment="treated" + sample3.fastq | replicate=3, treatment="control" + +The output tabular file contains:: + + sample1 1 control + sample2 2 treated + sample3 3 control + +------- + +**With headers enabled** + +Enabling **Include column headers** adds a header row:: + + element_identifier replicate treatment + sample1 1 control + sample2 2 treated + sample3 3 control + +------- + +**Replacement parameters** + +If some metadata values are null or boolean, you can control their text representation: + +- *Replace 'null' values with*: converts missing values (default: empty string, or use ``-`` or ``NA``) +- *Replace boolean 'true'/'false' values with*: controls how booleans are written (default: ``TRUE`` / ``FALSE``) + +For example, with null replacement set to ``NA``:: + + element_identifier replicate is_paired + sample1 1 TRUE + sample2 NA FALSE + +------- + +.. image:: ${static_path}/images/tools/collection_ops/sample_sheet_to_tabular.svg + :alt: Sample sheet to tabular dataset + :width: 500 + +------- + +.. class:: infomark + +This tool creates a new tabular dataset (not a collection operation), so normal quota usage applies. + ]]> diff --git a/static/images/tools/collection_ops/convert_sample_sheet.svg b/static/images/tools/collection_ops/convert_sample_sheet.svg new file mode 100644 index 00000000000..85fd273895b --- /dev/null +++ b/static/images/tools/collection_ops/convert_sample_sheet.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + Sample Sheet: "RNA-seq" + + + + + + + Name + rep + treatment + + + + + + sample1 + 1 + control + + + + + + sample2 + 2 + treated + + + + + + sample3 + 3 + control + + + metadata columns + + + + + + + Convert + + + + List: "RNA-seq" + + + + sample1.fastq + + + sample2.fastq + + + sample3.fastq + + + same datasets, no metadata + diff --git a/static/images/tools/collection_ops/sample_sheet_to_tabular.svg b/static/images/tools/collection_ops/sample_sheet_to_tabular.svg new file mode 100644 index 00000000000..2e10fa6d3be --- /dev/null +++ b/static/images/tools/collection_ops/sample_sheet_to_tabular.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + Sample Sheet: "RNA-seq" + + + + + + + Name + rep + treatment + + + + + + sample1 + 1 + control + + + + + + sample2 + 2 + treated + + + + + + sample3 + 3 + control + + + metadata columns + + + + + + + Extract + metadata + + + + Tabular dataset + + + + + + element_id + rep + treatment + + + + + + sample1 + 1 + control + + + + + + sample2 + 2 + treated + + + + + + sample3 + 3 + control + + + tab-separated metadata export +