Datasets — Methodological guides
1. Overview#
The Datasets tab manages two different levels of BarCodeR work:
- Datasets in memory: named
phyloseqobjects available in the current session. - Persistent projects: folders stored on disk that may contain datasets, the active dataset, interface state, figure histories and module files.
Dataset actions include selecting the active object, renaming, annotating, tagging, duplicating, reordering, exporting and removing an object from memory. Project actions include saving, restoring, creating, opening, renaming, duplicating, exporting, importing and deleting workspaces.
2. Essential definitions#
2.1. Dataset#
A dataset is a named entry in the reactive list:
datasets()
Each entry is normally a phyloseq object. Its list name is used throughout the application.
2.2. Active dataset#
The active dataset is stored separately in:
active_ds()
It is only the name of the object selected as the global default; it is not another copy of the object.
2.3. Dataset registry#
The registry is the current in-memory list, including names, order, attributes and the active name. It does not automatically match the last version saved on disk.
2.4. Session#
The session is the current browser/application state. Registry changes are first applied in memory. Unsaved changes can be lost when the application is closed or an older save is restored.
2.5. Project#
A project is stored under:
save/projects/<internal-project-id>/
It may contain registry.rds, manifest.rds, ui_state.rds and module folders such as barplot/, alpha_div/, Ordination/, DAA/, Analyse/ and multiview/.
3. Dataset versus project#
| Property | Dataset | Project |
|---|---|---|
| Contains a phyloseq object | Yes | One or several |
| Can be active | Yes | Yes, as current project |
| Contains figure histories | No | Yes |
| Can be removed only from memory | Yes | No |
| Can be physically deleted from disk | Not through dataset deletion | Yes |
Deleting a dataset and deleting a project are therefore completely different operations.
4. Tab layout#
The tab contains three main areas:
- global active dataset;
- dataset registry;
- projects.
5. Global active dataset#
5.1. Selector role#
The selected dataset becomes the default working object for Description, Data Edition, Filtration, Exploration and Analysis.
5.2. Synchronization#
The selector is synchronized with active_ds() and other global dataset selectors.
5.3. Local module selections#
Some modules can locally use another dataset. Always check both the global selector and the module-specific selector before running an operation.
5.4. Effect of changing the active dataset#
The change does not edit, filter, copy or delete data. It only changes the global reference, but it still marks the project as having unsaved changes because the active name is persisted.
6. No dataset in memory#
When the registry is empty, load data through Input data, import a phyloseq from OpenMetaBar, open a saved project, import a project archive or restore a previous registry.
7. Dataset registry#
The table displays one row per entry currently held in datasets(). It does not scan disk files.
8. Registry columns#
8.1. Active state#
A star marks the active dataset; a circle marks an inactive dataset. This icon says nothing about quality, filtering or save status.
8.2. Name#
The name is the key used in selectors, reports, exports, histories, lineage attributes, legends and some filenames.
8.3. ASV#
The displayed value comes from:
phyloseq::ntaxa()
It is the number of taxa, which may represent ASVs, OTUs, ZOTUs or another unit depending on the source workflow.
8.4. Samples#
The displayed value comes from:
phyloseq::nsamples()
8.5. Provenance#
- Loaded: no recognized filtration or OpenMetaBar provenance attribute.
- OpenMetaBar: the object has
openmetabar_run. - Filtered:
filtration_logcontains a named parent.
Filtered takes priority over OpenMetaBar.
8.6. Parent#
The parent name comes from:
filtration_log$parent_dataset
This is a stored string, not a live object link. BarCodeR updates recognized descendants when a parent is renamed or deleted.
8.7. Note and tags#
They are stored in the object attribute:
list(note = "...", tags = c("tag1", "tag2"))
They travel with individual exports, project saves and duplicates.
8.8. Modified#
The displayed date is taken first from the latest edit_log entry, then from filtration_log. Renaming, tags, notes, order and active selection do not necessarily update this date.
8.9. Actions#
Each row can be activated, edited, duplicated, exported, moved up, moved down or deleted from memory.
9. Refresh registry#
Refresh rebuilds the visible table from the current reactive objects. It does not read registry.rds, scan projects or restore data.
10. Set a dataset active#
Activating a row updates active_ds(), synchronizes global selectors and marks the project as modified. Save the project to preserve this selection across restarts.
11. Edit a dataset#
The edit dialog contains the dataset name, a free-text note and comma-separated tags.
12. Rename a dataset#
12.1. Name cleaning#
bcr_clean_label() trims whitespace, replaces unsafe characters with _, removes edge underscores and falls back to dataset when empty.
12.2. Non-ASCII characters#
Cleaning depends partly on the R locale. For maximum portability, prefer ASCII letters, digits, _ and -.
12.3. Name collision#
If the name already exists, a suffix such as _2 or _3 is added. Existing objects are not silently overwritten.
12.4. Active dataset update#
If the renamed dataset was active, active_ds() is updated to its final name.
12.5. Filtered descendants#
Recognized descendants have their parent_dataset value changed to the new parent name.
12.6. Items not renamed#
Previously exported files, source RDS files, old figures, old reports, the project name and the project slug are not renamed.
13. Add a note#
A note can document processing, caveats, database versions, validation state or intended use. It is stored inside the phyloseq object. Editing a note does not necessarily change the registry’s Modified date.
14. Add tags#
Tags are split on commas and trimmed. Empty tags are removed, but duplicates and capitalization differences are kept. Use a consistent convention.
15. dataset_meta attribute#
Saving the edit replaces dataset_meta with a list containing only note and tags. Other custom fields previously stored under that attribute may be lost.
16. Duplicate a dataset#
16.1. Proposed name#
The default name is <name>_copy, with a numeric suffix if needed.
16.2. Copied content#
The whole object is copied: count table, metadata, taxonomy, sequences, tree, logs, provenance, note, tags and other attributes.
16.3. Active dataset#
The new copy becomes active.
16.4. Later independence#
The registry entries are subsequently edited independently.
16.5. Provenance#
Duplication does not create a special “copy” provenance. The copied object keeps the source provenance attributes and parent value.
17. Reorder datasets#
Up and down arrows change the list order. This can affect selectors, multi-dataset operations and fallback selection. The order is persistent only after saving the project.
18. Export an individual dataset#
The row export writes the current phyloseq object to a file similar to:
dataset_<name>_<timestamp>.rds
It includes object components and attributes but not other datasets, project figures, module histories, raw FASTQ files, cluster run folders or the original taxonomic database. Reimport it through Input data.
19. Remove a dataset from the session#
19.1. Immediate effects#
The object is removed from datasets(), disappears from selectors and can no longer be used in the current session. The project is marked unsaved.
19.2. Removing the active dataset#
The first remaining dataset becomes active; if none remains, active_ds() becomes empty.
19.3. Filtered descendants#
If the deleted dataset was recorded as a parent, descendants have parent_dataset cleared. Because the Filtered badge currently depends on a non-empty parent, their displayed provenance may change.
19.4. Memory only#
The last saved registry is not changed immediately. Restoring from disk can bring the dataset back.
19.5. Make deletion persistent#
Delete the row, verify the registry, then click Save project.
19.6. Deleting the last dataset#
The quick-save function refuses to save an empty registry. An older non-empty registry.rds may therefore remain. Create a new project when a truly empty persistent workspace is needed.
20. Unsaved changes state#
The project is marked modified when datasets() or active_ds() changes. This mainly tracks the registry and active name; it is not a complete audit of every file created by every module.
21. Projects section#
The project manager controls the current persistent workspace, saving, restoring, creation, exports, imports and the list of available projects.
22. Current project#
The current slug is stored in:
save/projects/.current
BarCodeR attempts to reopen it at startup. If unavailable, it falls back to sans-titre.
23. Display name and internal slug#
A project has a display name, an internal ASCII-safe slug and a disk folder. Renaming changes only the display name; the slug and paths remain stable.
24. Project disk structure#
24.1. registry.rds#
Stores the saved datasets, their order, the active dataset and format metadata.
24.2. manifest.rds#
Stores display name, creation/modification times and saved dataset count.
24.3. ui_state.rds#
May store the main tab, sub-tabs and restorable interface parameters.
24.4. Module folders#
Modules can persist figures, R objects, parameter files and history metadata in their own subdirectories.
25. What a project does not automatically contain#
A project is not a complete copy of all scientific inputs. Raw FASTQ/BAM files, reference FASTA files, taxonomic databases, OpenMetaBar design files, remote cluster results, external scripts and tool databases must be archived separately.
26. Save project#
26.1. Saved content#
The operation stores the dataset list, order, complete objects and attributes, active dataset, manifest count and available UI state.
26.2. Figure histories#
Histories are usually written by their modules directly. Saving mainly synchronizes the dataset registry.
26.3. Empty project#
Saving is refused when no dataset is present.
26.4. Protection from empty overwrite#
A non-empty saved registry is protected from being replaced by an empty in-memory registry, for example after a failed load.
26.5. Success#
A successful save clears the unsaved flag and updates project metadata.
27. Available save status#
The displayed timestamp is the modification time of registry.rds; it is not necessarily the time of the last figure, analysis or history file.
28. Reload from disk#
Reloading replaces all current in-memory datasets with the contents of registry.rds; it does not merge them. Unsaved imports, edits, deletions, filters, notes, tags, order and active selection may be lost.
29. Save not found#
No registry.rds may mean a new project, a figure-only project, a project never saved, a manually deleted file or a partial import.
30. Unreadable save#
If registry.rds cannot be read, the project may open empty with a warning. BarCodeR protects the unreadable file from being silently overwritten by an empty registry. Copy the project directory before attempting recovery.
31. Export data only as .rds#
This export downloads a versioned list containing datasets() and active_ds(). It excludes figures, histories, manifest, project display name, UI state and external files. Reimport it through Input data.
32. Export complete project as .zip#
The ZIP contains the current project directory. BarCodeR first attempts to save the in-memory registry. If that save fails, the export may still contain the last valid disk registry rather than current memory. Always read notifications.
33. Size warning#
A warning is displayed above 200 MB. The size includes all project files and may be briefly cached. The application upload limit is 500 MB, so a ZIP larger than that may be exportable but not reimportable through the interface.
34. Import a project .zip#
The archive is extracted as a new project and is never merged into the current project. Open it from the project list after import. BarCodeR recognizes registry.rds, manifest.rds or known history folders; figure-only projects may therefore import with zero datasets.
35. Create a new project#
A new folder and manifest are created, the current project is submitted to the normal save/switch workflow, the new project becomes current and the application reloads. Empty or duplicate display names are refused.
36. Open another project#
BarCodeR attempts to save the current project, writes the new slug to .current, reloads the full session and initializes modules against the new project paths. A save error does not always prevent the switch, so red notifications must not be ignored.
37. Multiple BarCodeR browser tabs#
The current project is shared at the R-process level. Other tabs may retain paths from the previous project and write files to unexpected locations. Save and close other BarCodeR tabs before switching projects.
38. Rename the current project#
Only the display name changes. The slug, directory, histories, datasets and active dataset do not move. A name already used by another project is refused.
39. Project list#
Projects are sorted by most recent manifest modification time. The dataset count represents the saved registry, not necessarily unsaved in-memory state.
40. Duplicate a project#
The whole project folder is copied, including registry, manifest, UI state, datasets, figures and histories. When duplicating the current project, save manually first because the internal pre-save result is not strictly blocking.
41. Delete a project#
Only a closed project can be deleted. The entire save/projects/<slug>/ directory is removed permanently, without an internal trash. Export a ZIP first.
42. Differences between exports#
| Export | Content | Figures | Reimport |
|---|---|---|---|
Individual dataset .rds |
One phyloseq | No | Input data |
Project data .rds |
Dataset list + active name | No | Input data |
Complete project .zip |
Project directory | Yes | Datasets |
43. Projects and OpenMetaBar data#
Importing a phyloseq does not copy the remote OpenMetaBar run directory. Raw reads, Nextflow logs, work/, containers, reference databases and cluster outputs require separate archiving.
44. Projects and figure histories#
Only figures actually stored in module histories are guaranteed to be in the project. A plot merely displayed on screen may not be archived.
45. Physical project location#
Projects are stored under <BarCodeR-working-directory>/save/projects/. On Docker or server deployments this folder must use persistent storage. On shared installations, privacy and isolation depend on deployment permissions and authentication.
46. Recommended daily workflow#
- Open or create the correct project.
- Load data.
- Check the registry and active dataset.
- Add useful notes and tags.
- Duplicate before major edits.
- Save regularly.
- Export critical datasets.
- Periodically export a complete ZIP to external storage.
47. Before a risky operation#
Save the project, confirm success, export the important dataset, export the complete project when appropriate, and verify the downloaded files before filtering, mass editing, deleting, restoring, switching projects or upgrading the application.
48. Troubleshooting#
48.1. A dataset is missing#
Check whether import completed, whether the correct project is open, whether the dataset was removed, and whether an older registry was restored.
48.2. A module uses the wrong dataset#
Check both the global active dataset and the module-specific selection.
48.3. Active selection is not preserved#
Save the project after changing it.
48.4. The entered name changed#
Unsafe characters were normalized.
48.5. _2 was added#
A dataset with the same final name already existed.
48.6. Modified date did not change#
Notes, tags and renaming are not represented by that date source.
48.7. A copy keeps original provenance#
Duplication copies attributes and does not create a “copy” provenance.
48.8. A filtered dataset no longer shows as filtered#
Its parent may have been deleted and the parent field cleared. Inspect attr(ps, "filtration_log").
48.9. A deleted dataset returned#
The deletion was not saved and an older registry was restored.
48.10. Empty project cannot be saved#
Quick save requires at least one dataset. Create a new project when needed.
48.11. Reload removed edits#
Reload replaces memory with the saved registry.
48.12. No save exists#
The project has not yet written registry.rds.
48.13. Project opens empty with registry error#
Do not overwrite the project. Copy its folder and test readRDS() externally.
48.14. New project name refused#
It is empty or already used, ignoring case and outer whitespace.
48.15. Folder kept old name after rename#
Only the display name changes by design.
48.16. Opening a project reloads the app#
This is required to reinitialize module paths.
48.17. Save error while opening another project#
The switch may still continue. Reopen and verify the previous project.
48.18. Multiple-tab warning#
Close other tabs before switching projects.
48.19. Duplicate lacks latest changes#
Save explicitly before duplicating.
48.20. Current project cannot be deleted#
Open another project first.
48.21. Project deletion fails#
Check permissions, locks, disk errors and the target directory.
48.22. ZIP is very large#
Remove unnecessary histories or export data only.
48.23. ZIP exceeds 500 MB#
Increase shiny.maxRequestSize, reduce the archive, copy the project directory directly or use external storage.
48.24. Imported project did not open#
Select it in the list and click Open.
48.25. Archive is invalid#
Check ZIP integrity and the presence of recognized project markers.
48.26. Imported project has zero datasets#
It may contain histories only or an unreadable/missing registry.
48.27. ZIP lacks latest data#
The pre-export save may have failed; review notifications.
48.28. Project dataset count looks wrong#
Save and refresh; the list reflects persisted metadata.
48.29. Project size is delayed#
The size calculation is cached briefly.
48.30. Projects disappear after redeployment#
Mount save/projects/ on persistent storage.
49. Checklist before saving#
- Correct project is open.
- Expected datasets are present.
- Correct dataset is active.
- Names, notes and tags are correct.
- Deletions and duplicates are intentional.
- No important operation is pending.
- No error notification is visible.
50. Checklist before switching projects#
- Save the current project.
- Confirm the success notification.
- Export critical datasets.
- Close dialogs and finish calculations.
- Close other BarCodeR tabs.
- Verify the target project name.
51. Checklist before deleting a dataset#
- Verify its exact name and active status.
- Check filtered descendants.
- Export it if needed.
- Archive the project.
- Delete and verify the new active dataset.
- Save the project.
52. Checklist before deleting a project#
- Ensure it is not current.
- Export and verify a ZIP archive.
- Export critical datasets individually.
- Confirm raw data and OpenMetaBar outputs are archived elsewhere.
- Delete only after these checks.
53. Recommended backup strategy#
Use at least three layers:
- regular internal Save project;
- individual RDS exports of critical datasets;
- periodic complete ZIP archives stored outside the BarCodeR installation.
Internal storage alone does not protect against disk loss, deployment replacement or server failure.
54. Traceability principles#
Use explicit project and dataset names, consistent tags, meaningful notes, preserved provenance, copies before major edits, frequent saves, reference exports, recorded BarCodeR versions and separate raw-data archives.
55. Current limitations#
- Dataset actions are memory-first and become persistent only after saving.
- An empty project cannot be quick-saved.
- Modified date is incomplete.
- Filtered provenance depends on a named parent.
- Duplication keeps provenance attributes.
- Dataset names are not guaranteed to be ASCII.
- Project switching is global to the R instance.
- Save errors do not always block project switching or duplication.
- The save indicator mainly tracks registry and active dataset.
- ZIP exports exclude external scientific files.
- Archives above 500 MB may not be importable through the interface.
save/projects/must use persistent storage.
Verified internal sources#
modules/datasets/mod_datasets_ui.Rmodules/datasets/mod_datasets_server.Rmodules/_shared/_dataset_naming.Rmodules/_shared/_project_store.Rmodules/_shared/_ui_state.Rapp.R