Workspace Management
Relevant source files
The following files were used as context for generating this wiki page:
Workspace Management provides the core infrastructure for users to organize, share, and process biological data within the DXKB platform. It serves as a virtual file system that handles diverse data types, ranging from raw sequence reads to complex job results and genomic groups.
The system is built on a client-server architecture where a centralized WorkspaceManager service interacts with a JSON-RPC API to perform CRUD operations on objects and folders. It integrates deeply with the application's routing and notification systems, ensuring that data availability is synchronized across various viewer widgets and analysis tools. Sources: public/js/p3/WorkspaceManager.js, public/js/p3/app/p3app.js:283-299
System Architecture
The Workspace Management system follows a modular pattern consisting of a singleton manager, specialized widgets for exploration, and a series of action handlers for data manipulation.
Core Components
| Component | Description | Primary File |
|---|---|---|
| WorkspaceManager | Singleton service handling all RPC calls, permission logic, and data transformation. | public/js/p3/WorkspaceManager.js |
| WorkspaceBrowser | The primary layout container for the workspace UI, including action bars and detail panels. | public/js/p3/widget/WorkspaceBrowser.js |
| WorkspaceExplorerView | A grid-based view for listing and interacting with folder contents, supporting Drag-and-Drop. | public/js/p3/widget/WorkspaceExplorerView.js |
| WorkspaceObjectSelector | A dialog-based widget used to select workspace destinations or sources for tools and services. | public/js/p3/widget/WorkspaceObjectSelector.js |
Sources: public/js/p3/WorkspaceManager.js:13-25, public/js/p3/widget/WorkspaceBrowser.js:29-45, public/js/p3/widget/WorkspaceObjectSelector.js:20-45
Data Flow for Object Retrieval
The following diagram illustrates the sequence for retrieving an object's metadata and data through the WorkspaceManager.
Data Operations
The system supports a variety of file system-like operations, tailored for the specific metadata requirements of biological data.
Object Creation and Manipulation
Users can create workspaces, folders, and specific object types (like genome groups). The system enforces naming conventions, such as forbidding slashes in workspace names. Sources: public/js/p3/widget/CreateWorkspace.js:23-39
Key functions include:
- createWorkspace(name): Initializes a new workspace with default folders like "Genome Groups" and "Experiments". Sources: public/js/p3/WorkspaceManager.js:460-482
- updateMetadata(objs): Replaces
userMetafor specific objects. Sources: public/js/p3/WorkspaceManager.js:203-214 - deleteObjects(paths, ...): Handles recursive deletion of files and folders, including associated hidden job data (dot-folders). Sources: public/js/p3/WorkspaceManager.js:223-268
Bulk Operations (Move and Copy)
Move and copy operations utilize the Workspace.copy RPC method. If the move flag is set to true, the source is deleted after a successful copy. These operations also account for "job_result" types, which often have associated hidden data folders that must be moved in tandem. Sources: public/js/p3/WorkspaceManager.js:338-360, public/js/p3/WorkspaceManager.js:380-410
Permissions and Sharing
Sharing is managed via a permission mapping system. Access levels are categorized into four primary types:
| Permission Code | UI Label | Description |
|---|---|---|
| n | No access | User cannot see or access the object. |
| r | Can view | Read-only access to the data and metadata. |
| w | Can edit | Write access, allowing modification and deletion. |
| a | Admin | Full control, including the ability to change permissions. |
Sources: public/js/p3/WorkspaceManager.js:641-648
Permission Logic Flow
The application determines user capabilities by filtering permissions against the current user ID.
Data Types and Formats
The workspace tracks objects via a "type" field, which determines how they are rendered in the UI and which actions are available.
Supported Object Types
The system categorizes types into "known upload types" and "viewable types".
- Viewable Types: Includes
txt,html,json,csv,tsv,pdf,svg,png,jpg, and specialized alignments likealigned_dna_fasta. Sources: public/js/p3/WorkspaceManager.js:21-24 - Specialized Groups:
genome_group,feature_group, andexperiment_groupare treated as folders but contain specific JSON structures listing IDs. Sources: public/js/p3/WorkspaceManager.js:141-175
Job Results
Objects of type job_result are unique because they act as pointers to a hidden folder (prefixed with a dot .) containing the actual output files of a computational task. Moving, renaming, or deleting a job_result object automatically triggers the same operation on its corresponding hidden data folder. Sources: public/js/p3/WorkspaceManager.js:427-438, public/js/p3/widget/viewer/JobResult.js:48-60
Conclusion
The Workspace Management system provides a robust, permission-aware layer for data persistence and organization. By abstracting the complexities of background data storage (Shock) and providing a consistent interface for metadata manipulation, it enables researchers to manage large-scale genomic datasets and analysis results seamlessly. Sources: public/js/p3/WorkspaceManager.js, public/js/p3/widget/WorkspaceBrowser.js