Data Edition — Methodological guide
1. General presentation#
Data Edition directly modifies the internal components of a loaded phyloseq dataset: sample metadata, OTU abundances, taxonomy, reference sequences and phylogenetic tree. It also supports component import/export, deletion, ASV renaming and a descriptive edit log.
2. Fundamental principle: changes are immediate#
Data Edition is not a separate draft. Most actions immediately replace the selected object inside datasets(): cell edits, column operations, merges, ASV renaming, taxonomy replacements, full imports and component deletion.
3. The Save button does not apply pending changes#
Changes have already been applied. Save only registers the current edited state under the same name, a new name, or over another registry entry. It does not save the project to disk.
4. Important consequence for the original version#
Editing COI_raw and then saving as COI_edited does not preserve an untouched COI_raw: the source entry was already changed. Duplicate the raw dataset in Datasets before editing.
5. Effect on source files#
Data Edition does not rewrite the original RDS, RData, CSV, FASTA, Newick or remote files. It modifies the in-memory object. Persist changes by saving the project or exporting the edited dataset.
6. Tab organization#
The tab contains dataset selection, metadata editing, OTU editing, taxonomy editing, full component import/export/deletion, logs and registry saving.
7. Dataset to edit#
The picker lists registry datasets and is synchronized with active_ds(). Selecting a dataset here changes the global active dataset.
8. Switching datasets during editing#
Switching reloads the local states of the metadata, OTU and taxonomy editors and resets initial/previous states and previews. The local initial state is not necessarily the original file state.
9. Reset after switching away and back#
If COI is edited, another dataset is opened, and COI is reopened, Reset now points to the already edited state loaded on return. It cannot restore the state before the first edit.
10. Editing and project persistence#
Each action updates datasets() and may mark the project unsaved. Use Datasets → Save project to retain changes after closing the application.
11. Difference between the two import mechanisms#
Merge in the table editors only adds missing columns for matching identifiers. Full component import replaces the entire selected component as soon as the file is chosen.
12. What Data Edition is not designed for#
It is not the preferred tool for biological filtering, normalization, abundance transformation or threshold-based removal. Use Filtration or a controlled external workflow for those operations.
13. Edit history#
Actions may append an entry to attr(ps, "edit_log") with time, dataset, table, action, description, dimensions before/after and warnings.
14. The log is not a backup#
The log stores descriptions, not complete old tables. It is an audit trail, not a version-control or full restoration system.
15. Log language#
Internal edit_log actions and warnings remain in French even when the interface is displayed in another language.
16. The three log views#
Latest global action covers the current module session, Full history displays the stored log, and Summary aggregates action counts, affected tables, warnings and dates.
17. Actions counted in the total#
The count can include cell edits, structural changes, imports, exports, undo, reset, registry saves, renaming and automatic synchronization.
18. Undo: one step only#
Each editor stores one previous local state. Undo does not walk through the whole audit log; repeated clicks may alternate between two recent states.
19. Reset#
Reset restores the local state captured when the submodule loaded the dataset. It is immediate, logged and undoable, but it is not guaranteed to restore the original source file.
20. Metadata editing — overview#
This section modifies sample_data(ps) and supports value editing, variable addition/deletion/renaming, file merge, undo and reset.
21. Automatic creation of missing metadata#
If no usable metadata exists, opening the editor creates minimal sample_data with a SampleID column and one row per sample. This can modify the dataset without a dedicated log entry.
22. Sample identifiers#
The real sample identifiers are metadata row names aligned with sample_names(ps). A displayed SampleID column is ordinary data; editing it does not rename OTU samples.
23. Editable metadata table#
Cells are edited directly and applied when the cell edit is validated. There is no global Apply button.
24. Factor handling#
Factors are converted locally to character values. Their levels and ordering may be lost after the first table rewrite.
25. List-column handling#
List columns are flattened to comma-separated text, which may be irreversible without knowledge of the original structure.
26. Editing a numeric column#
Valid numbers remain numeric, a blank cell becomes NA_real_, and a nonnumeric value may convert the entire column to character with a warning.
27. Consequence of numeric-to-text conversion#
A continuous covariate converted to character may no longer work as numeric input in statistical modules. Check types after editing.
28. Logical, date and special classes#
Explicit preservation mainly covers numeric columns. logical, Date, POSIXct, ordered factors and custom classes may be lost.
29. Adding a metadata column#
The new column is filled with NA. Its name must start with an ASCII letter, contain only letters, numbers or _, contain no dot and be unique.
30. Compatible-name suggestions#
The module may suggest a normalized valid name, but it does not apply the suggestion automatically.
31. Renaming a metadata column#
Renaming preserves values and requires a valid unique name. It does not rename row names or sample identifiers.
32. Consequence of renaming for analyses#
Saved formulas and module settings using the old variable name are not updated and must be configured again.
33. Deleting a metadata column#
Deletion requires the exact case-sensitive name. Case-insensitive or approximate suggestions may be shown.
34. Deleting the final column#
There is no general guarantee that one column remains. To remove metadata entirely, use full component deletion.
35. Metadata row consistency#
Missing samples are added with NA, rows are reordered to sample_names(ps), and extra rows are discarded.
36. Merging a file into metadata#
CSV, TSV and TXT files are accepted, with comma, semicolon or tab separators.
37. Automatic metadata separator detection#
Up to thirty nonempty, noncomment lines are inspected for field count and consistency. An uncertain result can be overridden manually.
38. First column as identifiers#
When enabled, the first column becomes row names. Without it, numeric row names will usually prevent sample matching.
39. Metadata merge: actual behavior#
Only new columns are added for matching row names. Matching samples receive values; other current samples receive NA.
40. Existing columns#
Existing columns are never updated by Merge. If no new column exists, nothing changes.
41. Extra samples in the merge file#
Identifiers not present in the phyloseq object are ignored and do not create samples.
42. Current samples missing from the merge file#
They remain in the dataset and receive NA in the new columns.
43. OTU-table editing — overview#
The section supports cell edits, column addition/deletion, merge, display sorting, ASV renaming, orientation declaration, undo and reset.
44. OTU-table orientation#
The editor preserves taxa_are_rows(). With taxa in rows, columns are samples; otherwise columns are taxa.
45. “ASV in columns” is not a transpose command#
The switch mainly informs automatic ASV renaming. Changing it alone does not transpose the matrix or immediately alter taxa_are_rows.
46. Risk of selecting the wrong axis#
A wrong axis can rename samples as ASVs, alter the declared orientation and desynchronize taxonomy, sequences and tree.
47. Editable OTU table#
Each cell can be edited and the module then rebuilds the table as a numeric matrix.
48. Numeric conversion of the OTU table#
The entire table is converted to numeric after an action. Nonconvertible values become NA and generate a warning.
49. Blank OTU values#
Blank cells, whitespace and NA are reported but are not automatically replaced by zero.
50. Nonnumeric values#
Text such as absent, low or ? generally becomes NA during numeric conversion.
51. Negative and decimal values#
They are not blocked. The table may therefore contain counts, proportions, transformed values or CLR data, although downstream methods may reject them.
52. Adding a column to the OTU table#
With taxa in rows it adds a sample; with taxa in columns it adds a taxon. The new column is initialized with NA.
53. Risks when adding a sample#
Adding an OTU column does not add the matching sample_data row, so the phyloseq object may become inconsistent.
54. Risks when adding a taxon#
Adding a taxon does not create taxonomy, reference sequence or tree tip. RefSeq or the tree may be dropped when they become incomplete.
55. Recommendation for structural additions#
For new taxa or samples, rebuild and validate a complete phyloseq object in R rather than extending only one table.
56. Deleting a column from the OTU table#
Depending on orientation, this removes a sample or taxon. Metadata or taxonomy are not systematically synchronized by this generic action.
57. Use Filtration for biological removal#
Use Filtration to remove samples or taxa according to documented criteria and produce a coherent child dataset.
58. Natural ASV sorting#
Natural display sorting places ASV1, ASV2, ASV10 in numerical order without changing internal order.
59. Editing while sorting is enabled#
The displayed row is mapped back to its original identifier so the correct element is edited.
60. Merging a file into the OTU table#
The module detects the separator, uses row names, finds common rows and adds only new columns.
61. Meaning of imported columns#
Their meaning depends on current orientation; the module does not infer whether they are samples or taxa.
62. Extra rows in an OTU merge file#
Rows absent from the current table are ignored and do not create new identifiers.
63. Current rows absent from the file#
New columns remain NA for those rows.
64. Automatic ASV renaming#
Renaming combines a prefix, the declared ASV axis and current identifiers.
65. Preserving final numbers#
If every identifier ends with a unique number, those numbers are retained, for example ASV128 to Feature128.
66. Sequential renaming#
If at least one identifier lacks a usable final number, all identifiers are renamed sequentially according to internal order.
67. New-name collisions#
If generated names are not unique, sequential fallback names are used.
68. Prefix validation#
Only outer whitespace is removed. Use a simple prefix such as ASV, OTU, ZOTU or Feature.
69. Propagating ASV renaming#
When old identifiers are unique, names are propagated to tax_table, refseq and tree tips.
70. Duplicate identifiers before renaming#
With duplicates, propagation is disabled and the resulting object may remain inconsistent. Fix duplicates upstream.
71. Realigning sequences after an OTU change#
Unnamed sequences are named by order if counts match. Complete named sequences are reordered. If any taxon lacks a sequence, the whole refseq component is removed.
72. Realigning the tree after an OTU change#
Extra tips are pruned. If any OTU taxon is missing from the tree, the entire tree is removed.
73. Missing ape package#
If ape is unavailable during an OTU change, the tree is removed and the log records a warning.
74. Taxonomy after structural OTU changes#
Taxonomy propagation is explicit during ASV renaming but not guaranteed for every structural edit. Check taxon identifiers afterward.
75. Taxonomy editing — overview#
This section edits tax_table(ps): cells, ranks, file merge, automatic replacement, undo and reset.
76. Missing taxonomy#
When no taxonomy table exists, use full component import to add one.
77. Confirmation before the first taxonomy edit#
The first attempted action only displays an information modal and does not run the action. Close it and repeat the action.
78. New confirmation after changing dataset#
The confirmation state resets when the selected dataset changes.
79. Editing a taxonomy cell#
The value is stored as text. No nomenclatural or taxonomic validation is performed.
80. No hierarchy validation#
The module does not verify species–genus–family consistency or scientific-name validity.
81. Adding a taxonomic rank#
A new NA column is appended and must use a strict valid unique name.
82. Rank order#
No taxonomic order is enforced. Maintain a coherent sequence manually.
83. Renaming a taxonomic rank#
There is no direct button. Create a new rank, transfer values and delete the old rank, or perform the operation in R.
84. Deleting a rank#
Deletion is immediate with the exact name; approximate suggestions may be offered.
85. Deleting all ranks#
No general protection prevents it. Use full component deletion when the intention is to remove taxonomy entirely.
86. Taxonomy sorting by ASV#
Natural sorting affects display only and uses the first numeric sequence found in the identifier.
87. Synchronization after ASV renaming#
When taxonomy row names change with the same row count, local taxonomy states are updated and a synchronization log entry is added.
88. Synchronization limitation#
A full replacement with unchanged identifiers may not refresh local displayed values. Switch to another dataset and back.
89. Merging a file into taxonomy#
Only missing rank columns are added for common taxa; other taxa receive NA.
90. No automatic taxonomy separator detection#
The separator must be selected manually.
91. Existing taxonomy columns#
Merge does not replace an existing rank such as Genus. Use full import to replace the table.
92. Automatic value replacement#
Patterns such as NA, unidentified, unclassified, unknown or missing can be replaced by one common text value.
93. Exact case-insensitive matching#
Patterns are trimmed and lowercased, then compared exactly rather than as broad substrings.
94. NA pattern#
It matches both true missing values and textual NA variants.
95. Empty pattern#
An empty pattern targets empty or whitespace-only strings.
96. Replacement scope#
Replacement applies across every taxonomy rank; no single-column targeting is available.
97. Mandatory preview#
The module reports total cells and counts by pattern and column before confirmation.
98. Overlapping patterns#
A cell may match multiple normalized patterns; per-pattern counts can overlap even when the global total uses unique cells.
99. Nonempty replacement value#
An empty replacement string is rejected.
100. Scientific consequences of replacement#
Replacing NA with Unassigned turns missing information into a real category and changes completeness, agglomeration and plots.
101. Grouping unassigned taxa#
Taxa with the same text value may be grouped by tax_glom(), unlike true missing values.
102. Initial taxonomy state and reset#
The initial state is recaptured when the local editor loads the dataset, so switching datasets can change the Reset reference.
103. Import, export and deletion — overview#
This area manages whole phyloseq components: metadata, OTU, taxonomy, RefSeq and tree.
104. Automatic import#
Import starts immediately when a file is selected, with no additional confirmation button or general preview.
105. File-size limit#
The file inputs use the global BarCodeR upload limit, currently about 500 MB.
106. Separator detection for full imports#
The first line is mainly inspected: semicolon takes priority, then tab, otherwise comma. This is less robust than merge detection.
107. Full metadata import#
The first column provides identifiers. Unknown samples cause rejection; missing current samples are added with NA. The previous metadata table is completely replaced.
108. Full OTU-table import#
The file is interpreted as taxa in rows and samples in columns, and taxa_are_rows = TRUE is imposed.
109. Identifiers accepted for OTU import#
File taxa and samples must be subsets of existing identifiers. The import cannot introduce new samples or taxa.
110. Missing identifiers in OTU import#
Missing current samples or taxa are filled with zeros, then the table is reordered to the current object.
111. Numeric conversion during OTU import#
The whole table is converted to numeric. Invalid values become NA; import may still continue with a warning.
112. Full taxonomy import#
The first column supplies taxa. Unknown taxa cause rejection; missing taxa are added with NA. The old table and ranks are replaced.
113. RefSeq import#
FASTA identifiers must match and fully cover all taxa. Partial files or unknown identifiers are rejected.
114. Tree import#
Newick tips must match and fully cover all taxa. Unknown tips or missing taxa cause rejection.
115. Complete component replacement#
The old component is not retained as a snapshot. Only dimensions, file information and warnings are logged.
116. Refreshing editors after full import#
Local editors may keep an old copy when the dataset name does not change. Switch datasets and return before editing further.
117. Component export#
Metadata, OTU and taxonomy use CSV; RefSeq uses FASTA; the tree uses Newick.
118. CSV export separator#
CSV files use semicolon ; despite their .csv extension.
119. Metadata export#
A SampleID column is built from row names and missing values are exported as blank cells.
120. OTU export#
The stored orientation is preserved and the file does not explicitly record taxa_are_rows.
121. Taxonomy export#
Taxon identifiers are written in the first column and missing annotations as blank cells.
122. RefSeq export#
Sequences are written as FASTA with current names; Biostrings is required.
123. Tree export#
The tree is written as Newick; ape is required.
124. Export and the audit log#
Every export adds an edit_log entry and may therefore mark the project unsaved.
125. Component deletion#
The modal lists currently present components and allows multiple selections before confirmation.
126. Deleting metadata#
The sam_data slot is removed and analyses requiring groups or covariates become unavailable.
127. Deleting taxonomy#
The tax_table slot is removed and taxonomy-based analyses become unavailable.
128. Deleting RefSeq#
Sequence-length, GC and sequence-based functions lose their reference sequences.
129. Deleting the tree#
UniFrac, Faith PD and phylogenetic visualizations become unavailable.
130. Deleting the OTU table#
The interface permits it, but this removes the central component and makes the dataset unusable in most modules.
131. Deleting several components together#
Several slots may be removed even when the remaining object becomes internally incoherent.
132. Undoing component deletion#
This area has no Undo. Reimport the component, restore the project or reload an earlier export.
133. Deletion and disk files#
Deletion affects memory until the project is saved. Source files and previous disk backups are not removed.
134. Saving the dataset in the registry#
The name field supports same-name registration, a new entry or replacement of an existing entry.
135. Empty name#
The current dataset is re-registered under its current name, remains active and receives a log entry. The project is not saved to disk.
136. Available new name#
A new registry entry receives the current edited state and becomes active. The source remains, but it was already edited in place.
137. Name already used by another dataset#
After confirmation, the target is fully overwritten by the edited source state, while the source entry also remains.
138. Dataset-name cleaning#
The shared naming helper cleans the label before collision checks.
139. Overwriting another dataset#
All tables, sequences, tree, attributes, logs and provenance are replaced. This is not a merge.
140. Saving the complete project#
Use Datasets → Save project after editing to persist the registry on disk.
141. Troubleshooting#
The following subsections describe common failures and their actual causes.
141.1. The wrong dataset was modified#
The picker follows the global active dataset. Check the displayed name before every action.
141.2. The original changed although a new name was intended#
Edits occur before copying. Restore a backup, export or original source file.
141.3. Save did not save the project#
It only modifies the in-memory registry. Save from Datasets.
141.4. Metadata appeared automatically#
The dataset lacked sample_data; a minimal table was created.
141.5. Editing SampleID did not rename samples#
True identifiers are row names, not the displayed column.
141.6. A numeric variable became text#
A nonnumeric value was entered. Repair the whole column or reimport typed metadata.
141.7. A factor became character#
Factors are flattened in the editor. Restore levels in R if needed.
141.8. A new column has the wrong type#
It starts with NA and is inferred from edited values. Validate and convert afterward.
141.9. Metadata merge did not update an existing column#
Merge only adds missing columns. Use full import or edit cells.
141.10. No common identifier was found#
Check the first column, row-name option, case, whitespace and spelling.
141.11. The detected separator is wrong#
Override it manually when the file is irregular or contains separator characters in values.
141.12. OTU values became NA#
Numeric conversion failed because of text, symbols, whitespace or decimal commas.
141.13. Decimal commas become NA#
The expected decimal mark is a point. Correct the source file.
141.14. An added OTU column desynchronized metadata#
The sample was added only to the OTU table. Add matching metadata or rebuild the object.
141.15. RefSeq disappeared after an OTU change#
It no longer covered every taxon.
141.16. The tree disappeared after an OTU change#
A taxon was missing, renaming did not propagate, or ape was unavailable.
141.17. Tree tips disappeared#
Tips not present in the OTU table are pruned automatically.
141.18. Samples were renamed as ASVs#
The wrong axis was declared. Restore a copy or backup.
141.19. The ASV prefix produced unusual names#
The prefix is not strictly validated. Use a simple prefix.
141.20. Taxonomy no longer matches the OTU table#
Check row names, duplicates and refresh the editors; compare identifier sets in R.
141.21. The first taxonomy change did not run#
The first attempt only opens the warning modal. Repeat the action.
141.22. A taxonomy replacement changed several ranks#
Replacement applies across all columns. Review the per-rank preview.
141.23. NA is now treated as a real category#
Missing values were replaced with text and may now be aggregated as assigned taxonomy.
141.24. Taxonomy merge did not replace Genus#
The rank already exists; Merge only adds missing ranks.
141.25. The taxonomy separator was not detected#
This editor requires manual separator selection.
141.26. Full import erased columns#
It replaces the whole component. Restore a backup or use Merge for additive changes.
141.27. Full OTU import changed orientation#
It always imposes taxa in rows.
141.28. Full import rejects new samples#
Identifiers must already exist. Build a new complete phyloseq object to extend samples.
141.29. Full import rejects new taxa#
Row names must already belong to taxa_names(ps).
141.30. FASTA import is rejected#
Check format, identifier uniqueness, complete coverage and Biostrings availability.
141.31. Tree import is rejected#
Check valid Newick, unknown tips, missing taxa and ape availability.
141.32. The editor still displays the old table after import#
Switch to another dataset and back to refresh local state.
141.33. A deleted old table reappears after editing#
A stale submodule state may have rewritten its previous copy. Refresh after deletion or full import.
141.34. Downloading created an unsaved modification#
Exports are logged and modify the dataset attribute.
141.35. Table deletion cannot be undone#
There is no Undo in the component-deletion area. Reimport or restore.
141.36. The dataset no longer works after deleting the OTU table#
Restore a complete version; the OTU table is the central component.
141.37. Undo does not go back through several actions#
Only one previous state is stored.
141.38. Reset does not return to the original file#
It returns to the state captured when the local editor loaded the dataset.
141.39. The log remains French in another language#
Internal audit messages are deliberately stored in French.
141.40. The action count increases after export#
Exports are logged as actions.
142. Checklist before editing#
- Confirm the current project and dataset.
- Duplicate the raw dataset.
- Save the project and export important data.
- Check components and OTU orientation.
- Close other sessions that may write to the same project.
143. Checklist before metadata editing#
- Check row names and distinguish them from a
SampleIDcolumn. - Document numeric types, ordered factors, dates and missing values.
- Use valid column names.
- Recheck types after editing.
144. Checklist before OTU editing#
- Check
taxa_are_rowsand the ASV axis. - Confirm the nature of abundance values and absence of text.
- Check metadata, taxonomy, RefSeq and tree before structural changes.
- Export before mass renaming.
145. Checklist before taxonomy replacement#
- Review patterns, case and whitespace.
- Inspect counts by rank.
- Understand missing values versus text categories.
- Anticipate agglomeration effects.
- Preserve the original taxonomy.
146. Checklist before full import#
- Verify dataset, separator, first column, identifiers and coverage.
- Back up the previous component.
- Understand that it will be replaced.
- Refresh editors and validate in Description afterward.
147. Checklist before deleting a component#
- Export the component and save the project.
- Check dependent modules.
- Avoid deleting the OTU table except in exceptional cases.
- Remember there is no Undo.
148. Checklist after Data Edition#
- Open Description and check dimensions, sums, types, missing values, taxonomy, RefSeq and tree.
- Verify identifier alignment and read the edit log.
- Save the project in Datasets.
149. Recommended R checks after editing#
setequal(sample_names(ps), rownames(as.data.frame(sample_data(ps))))
setequal(taxa_names(ps), rownames(as(tax_table(ps), "matrix")))
setequal(taxa_names(ps), names(refseq(ps)))
setequal(taxa_names(ps), phy_tree(ps)$tip.label)
otu <- as(otu_table(ps), "matrix")
anyNA(otu)
any(otu < 0, na.rm = TRUE)
all(otu == round(otu), na.rm = TRUE)
150. Current limitations#
- Changes are immediate and the original is not automatically preserved.
- Save does not persist the project.
- Undo stores one state and Reset depends on local loading.
- Metadata may be created automatically.
- Factors and special classes may be lost.
- The ASV switch is not a transpose command.
- OTU edits may desynchronize components.
- Taxonomy replacements affect every rank.
- Full imports start without preview and cannot extend identifiers.
- Local editors may display stale copies.
- Export modifies the log.
- OTU-table deletion is allowed.
- No full integrity guard runs after every action.
151. Recommended workflow#
- Save the project and duplicate the raw dataset.
- Edit the copy.
- Verify OTU orientation.
- Edit metadata and validate types.
- Edit OTU only when necessary.
- Check taxonomy, RefSeq and tree after structural edits.
- Use taxonomy previews.
- Refresh after full import or deletion.
- Validate in Description.
- Save the project and export the final dataset.
152. Verified internal sources#
This guide was reconstructed from the current Data Edition main UI/server, metadata editor, OTU editor, taxonomy editor, component import/export/deletion submodule, active-dataset synchronization, dataset naming helper, app.R, and the architecture notes checked against effective code.