The Reshape module converts scientific datasets between Wide matrix format (repeated replicate columns per row) and Long tidy format (normalized rows with explicit replicate labels and measurement columns).
The Reshape module transforms structured agricultural and experimental datasets between matrix-like Wide format and relational Long (tidy) format.
In experimental designs (such as field trials or laboratory assays), measurements are frequently recorded in wide spreadsheets with replicate columns side-by-side (e.g., Rep1, Rep2, Rep3). Most downstream statistical models and ANOVA tools require tidy long datasets where each row represents a single observational unit. Conversely, wide tables are often needed for compact tabular summaries or cross-tabulation.
When to use this module:
The sidebar control panel provides controls for file ingestion, mode toggling, and column mapping:
| Control / Option | What it does | Why it is used | When to use / select |
|---|---|---|---|
| Upload Data | Uploads a .csv, .xlsx, or .xls data spreadsheet into memory. |
Loads raw data and triggers auto-detection of column types and patterns. | At the start of every reshape workflow. |
| Sheet Selector | Selects the active worksheet from multi-sheet Excel workbooks. | Ensures analysis runs on the correct data sheet. | When uploading multi-sheet Excel workbooks. |
| Preview Spreadsheet | Launches a full-screen interactive preview table of the uploaded spreadsheet. | Inspects column names, row counts, and sample values before transforming. | To verify header labels and check data integrity. |
| Direction Toggle | Switches mode between Wide → Long (melting) and Long → Wide (unmelting/pivoting). |
Determines the underlying structural matrix transformation logic. | Select Wide → Long to unroll replicate columns, or Long → Wide to reconstruct wide matrices. |
| Categorical Metadata | Selects categorical columns (e.g., Group, Site, Condition) to preserve as metadata. |
Keeps experimental grouping variables attached to every transformed row. | Select all grouping factor columns that identify your experimental units. |
| Numeric Metadata | Selects non-replicate numeric metadata columns (e.g., Sample_Size, Year) to preserve as-is. |
Prevents numeric metadata from being mistakenly unrolled as replicate measurements. | Select numeric columns that represent sample descriptors rather than repeated measurement values. |
| Replicate Columns / Groups | In Wide → Long, selects header columns to melt (e.g., R1, R2, R3). In Long → Wide, filters specific replicate group values. |
Identifies which columns contain repeated measurements or filters specific replicates. | Select all replicate measurement columns in Wide → Long mode. |
| Variable Column | In Wide → Long, optionally picks a metadata column to pivot across columns. In Long → Wide, selects the measurement/variable column(s) to unroll into rows. | Controls variable pivoting or defines which measurement variables to restructure. | Select when doing variable pivoting or defining target measurements in Long → Wide mode. |
| Replicate Identifier | In Long → Wide, designates the column holding replicate names/labels (e.g., Replicate). |
Provides column headers for the newly generated wide matrix. | Required when executing Long → Wide transformation. |
The module accepts tabular datasets with the following structural rules:
rep1, R1, t1).In Wide format spreadsheets, metadata columns appear on the left and replicate measurements are arranged side-by-side in separate columns:
| Group | Site | R1 | R2 | R3 |
|---|---|---|---|---|
| Group-01 | Site-01 | 45.20 | 46.80 | 44.90 |
| Group-01 | Site-02 | 38.50 | 39.10 | 37.80 |
| Group-02 | Site-01 | 52.10 | 50.90 | 51.40 |
| Group-02 | Site-02 | 41.00 | 42.30 | 40.70 |
In Long format datasets, each observation is a separate row, with explicit columns for replicate identifiers and numerical measurements:
| Group | Site | Replicate | Response |
|---|---|---|---|
| Group-01 | Site-01 | R1 | 45.20 |
| Group-01 | Site-01 | R2 | 46.80 |
| Group-01 | Site-01 | R3 | 44.90 |
| Group-02 | Site-01 | R1 | 52.10 |
| Group-02 | Site-01 | R2 | 50.90 |
| Group-02 | Site-01 | R3 | 51.40 |
The Reshape module provides two primary operational modes depending on your data restructuring goal:
When to use: Use when your spreadsheet has multiple replicate measurement columns side-by-side (e.g., R1, R2, R3) and you need a single Replicate factor column and a single Value numeric column.
Optional Variable Pivot Sub-mode: If a Variable Column (e.g., Measurement) is selected from metadata, the module groups by remaining metadata, creates new columns for each unique value of that variable, and unrolls replicate measurements under each unique value column.
When to use: Use when your input dataset is in tall format with a column identifying replicates (e.g., Replicate) and one or more measurement columns (e.g., Response, Outcome), and you want to expand replicates horizontally into separate columns.
Condition: Requires selecting a valid Replicate Identifier column and at least one Variable Column.
Upon clicking Reshape, the module generates restructured output datasets in Excel spreadsheet layout.
Transforming the sample Wide input into Long format produces this normalized dataset:
| Group | Site | Replicate | Value |
|---|---|---|---|
| Group-01 | Site-01 | R1 | 45.20 |
| Group-01 | Site-01 | R2 | 46.80 |
| Group-01 | Site-01 | R3 | 44.90 |
| Group-01 | Site-02 | R1 | 38.50 |
| Group-01 | Site-02 | R2 | 39.10 |
| Group-01 | Site-02 | R3 | 37.80 |
| Group-02 | Site-01 | R1 | 52.10 |
| Group-02 | Site-01 | R2 | 50.90 |
| Group-02 | Site-01 | R3 | 51.40 |
| Group-02 | Site-02 | R1 | 41.00 |
| Group-02 | Site-02 | R2 | 42.30 |
| Group-02 | Site-02 | R3 | 40.70 |
Transforming the sample Long input into Wide format expands replicates across matrix headers:
| Group | Site | Variable Column | R1 | R2 | R3 |
|---|---|---|---|---|---|
| Group-01 | Site-01 | Response | 45.20 | 46.80 | 44.90 |
| Group-02 | Site-01 | Response | 52.10 | 50.90 | 51.40 |
.csv or .xlsx dataset.Wide → Long or Long → Wide.XLSX or DOCX at the top of the transformed table to download your output file.When running Long → Wide transformation or Variable Pivot Mode, every combination of metadata factors and replicate IDs must be unique. If duplicates exist, an error will alert you to clean your data first.
If you use the DATES platform for data preparation or statistical analysis in published scientific work, please cite it as follows: