8000 Feature: Implement Batch Variant Processing Mode · Issue #30 · halbritter-lab/nc-scorer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Feature: Implement Batch Variant Processing Mode #30
Closed
@berntpopp

Description

@berntpopp

Description

NC-Scorer currently processes variants individually through the UI. Users needing to analyze or score multiple variants (e.g., from a VCF file filter or a candidate list) must manually enter each one, which is time-consuming and inefficient.

Desired Behavior (Revised Plan)

Implement a simple batch processing mode that leverages variant-linker v2.0.0's batch capabilities. This initial implementation will focus on allowing users to paste a list of variants, processing them in a single batch API call, and providing the results directly as a downloadable file (JSON, CSV, TSV, or VCF), without displaying results in a table initially.

Requirements

  1. New Route/View:
    • Create a dedicated route (e.g., /batch) and corresponding view component (src/views/BatchView.vue).
  2. Input Method:
    • Provide a <v-textarea> component for users to paste a list of variants (one per line).
    • Supported input formats per line: VCF-style (CHR-POS-REF-ALT) or HGVS notation.
    • Implement client-side validation to limit input to a maximum number of lines (e.g., 200).
  3. Output Format Selection:
    • Provide a UI element (e.g., <v-select> or <v-radio-group>) for the user to choose the desired output format: JSON, CSV, TSV, VCF.
  4. Processing Logic:
    • Parse the pasted variants from the textarea, trim whitespace, and filter empty lines.
    • Validate the number of variants against the maximum limit (e.g., 200).
    • Update the queryVariant wrapper in src/api/variantApi.js (or create queryVariantBatch) to accept an array of variant strings.
    • The API wrapper must pass the variant array and the user-selected output format parameter to the underlying variant-linker analyzeVariant function.
    • Handle potential errors during API calls gracefully, displaying an error message to the user.
    • Show a loading indicator while processing.
  5. Output Handling:
    • When the variant-linker API call succeeds:
        Expect the response to be a single string for CSV, TSV, or VCF formats, or a JSON object/array for JSON format.
      • Trigger an automatic file download of the received result string (or stringified JSON).
      • Generate an appropriate filename (e.g., nc_scorer_batch_results_[timestamp].[format]).
      • Set the correct MIME type for the download based on the selected format.
    • No initial requirement to display results in a UI table.

Implementation Plan (High-Level)

  1. Create Batch View (src/views/BatchView.vue):
    • Set up the basic structure with ContentContainer.
    • Add UI elements: v-textarea (for input), v-select (for output format), v-btn (to submit), v-alert (for errors/status).
    • Implement client-side validation (max lines).
  2. Update API Wrapper (src/api/variantApi.js):
    • Modify queryVariant (or create queryVariantBatch) to accept variants: string[] and pass the output option.
    • Ensure it correctly calls variantLinker.analyzeVariant with the array and returns the expected result (string or object based on output format).
  3. Implement View Logic (src/views/BatchView.vue):
    • Write the processAndDownload function:
      • Parse/validate input text area.
      • Call the updated API wrapper function with the variant array and selected format.
      • Handle the promise: trigger download on success, show error on failure.
      • Manage loading state.
  4. Add Routing (src/router/index.js):
    • Define the /batch route pointing to the BatchView component (lazy-loaded).
  5. Add Navigation (src/config/menuConfig.json):
    • (Optional) Add a "Batch Analysis" item to the main navigation menu.

Motivation

To provide an initial, efficient way for users to process multiple variants using the underlying capabilities of variant-linker v2.0.0, focusing on data output rather than immediate display. This addresses the core need for batch processing described in #30 while simplifying the initial implementation. Future iterations can build upon this to add UI display features.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0