Skip to content

VDJ Integration block implementation - #1

Merged
mzueva merged 12 commits into
mainfrom
mzueva/develop
Apr 16, 2026
Merged

VDJ Integration block implementation#1
mzueva merged 12 commits into
mainfrom
mzueva/develop

Conversation

@mzueva

@mzueva mzueva commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

VDJ Integration block implementation

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers the foundational implementation of the VDJ Integration block. Its primary purpose is to enable researchers to match VDJ clonotypes between two distinct datasets, such as bulk and single-cell sequencing data. The block facilitates the identification of shared clonotypes and generates bidirectional linker columns, which are crucial for subsequent downstream analyses like lead selection and SHM trees. This initial release establishes the core functionality, data model, user interface, and underlying computational workflow for this new analytical tool.

Highlights

  • New VDJ Integration Block: Introduced a new block designed to integrate VDJ clonotypes between two datasets, supporting both bulk and single-cell sequencing data.
  • Core Matching Logic: Implemented the core clonotype matching functionality using a Python script that performs exact sequence and V/J gene matching, generating linker columns and confidence scores.
  • Interactive User Interface: Developed a Vue.js-based user interface that allows users to select target and reference datasets, specify sequence types, choose features for matching, and view results in a data table.
  • Comprehensive Workflow Integration: Established a robust workflow using Tengo scripts to prepare data bundles, execute the Python matching software, and process the results into pFrames for both UI display and export.
  • Monorepo Structure and Tooling: Set up a monorepo with pnpm and turbo for efficient package management and task orchestration, along with changesets for versioning and release management.
Changelog
  • .changeset/README.md
    • Added a README file explaining Changesets.
  • .changeset/config.json
    • Added the configuration file for Changesets.
  • .changeset/curvy-pillows-marry.md
    • Added a new changeset entry for the initial major release.
  • .gitignore
    • Added new patterns to ignore various build artifacts and development files.
  • .prettierrc
    • Added Prettier configuration for consistent code formatting.
  • CHANGELOG.md
    • Initialized the project changelog with version 1.0.0.
  • block/package.json
    • Defined the main VDJ Integration block package and its metadata.
  • docs/description.md
    • Added a detailed description of the VDJ Integration block's functionality.
  • model/.oxfmtrc.json
    • Added Oxfmt configuration for the model package.
  • model/.oxlintrc.json
    • Added Oxlint configuration for the model package.
  • model/package.json
    • Defined the model package for the VDJ Integration block.
  • model/src/index.ts
    • Implemented the core data model and output definitions for the block.
  • model/tsconfig.json
    • Added TypeScript configuration for the model package.
  • package.json
    • Configured the root package with monorepo scripts and dependencies.
  • pnpm-workspace.yaml
    • Defined the pnpm workspace structure and catalog dependencies.
  • software/package.json
    • Defined the software package for the VDJ Integration block.
  • software/src/match_clonotypes.py
    • Implemented the Python script for matching clonotypes between datasets.
  • software/src/requirements.txt
    • Added Python dependencies for the clonotype matching script.
  • test/package.json
    • Defined the test package for the VDJ Integration block.
  • test/src/wf.test.ts
    • Added a placeholder file for workflow tests.
  • test/tsconfig.json
    • Added TypeScript configuration for the test package.
  • test/vitest.config.mts
    • Added Vitest configuration for the test package.
  • turbo.json
    • Configured Turbo for monorepo task orchestration.
  • ui/.oxfmtrc.json
    • Added Oxfmt configuration for the UI package.
  • ui/.oxlintrc.json
    • Added Oxlint configuration for the UI package.
  • ui/index.html
    • Added the base HTML file for the block's user interface.
  • ui/package.json
    • Defined the UI package for the VDJ Integration block.
  • ui/src/app.ts
    • Implemented the main Vue.js application setup for the UI.
  • ui/src/main.ts
    • Main entry point for the Vue.js UI application.
  • ui/src/pages/MainPage.vue
    • Implemented the main user interface page with data selection and display.
  • ui/tsconfig.json
    • Added TypeScript configuration for the UI package.
  • workflow/format.el
    • Added an Emacs Lisp script for formatting Tengo workflow files.
  • workflow/index.d.ts
    • Added TypeScript declaration file for workflow templates.
  • workflow/index.js
    • Added JavaScript entry point for workflow templates.
  • workflow/package.json
    • Defined the workflow package for the VDJ Integration block.
  • workflow/src/main.tpl.tengo
    • Implemented the main Tengo workflow template for data processing.
  • workflow/src/outputs.lib.tengo
    • Implemented a Tengo library for handling workflow output pFrames.
  • workflow/tsconfig.json
    • Added TypeScript configuration for the workflow package.
  • workflow/vitest.config.mts
    • Added Vitest configuration for the workflow package.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/build.yaml
    • .github/workflows/mark-stable.yaml
Activity
  • The pull request was opened by mzueva with the title "VDJ Integration block implementation" and a description stating "VDJ Integration block implementation".
  • All changes involve the addition of new files, indicating the initial implementation of the VDJ Integration block and its associated components.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive VDJ Integration block, structured as a multi-package monorepo for the model, UI, workflow, and software components. The overall implementation is robust, with a clear separation of concerns. My review provides feedback on improving the performance and clarity of the Python matching script, addresses a potential dependency issue that could block builds, and emphasizes the importance of adding tests for this new functionality.

@@ -0,0 +1 @@
polars-lts-cpu==1.33.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version 1.33.1 for polars-lts-cpu appears to be incorrect. This version is not available on PyPI and does not follow the package's versioning scheme, which will likely cause the software build to fail. Please correct it to a valid version. For reference, a recent version of polars-lts-cpu is 0.20.31.

return pl.read_csv(path, separator="\t")


def melt_chains(df: pl.DataFrame, prefix: str) -> pl.DataFrame:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The prefix parameter is unused within this function and can be removed for improved code clarity. Remember to update the calls to this function in main.

Suggested change
def melt_chains(df: pl.DataFrame, prefix: str) -> pl.DataFrame:
def melt_chains(df: pl.DataFrame) -> pl.DataFrame:

Comment thread software/src/match_clonotypes.py Outdated
Comment on lines +63 to +64
pl.col("vGene").map_elements(strip_allele, return_dtype=pl.Utf8).alias("vGene_stripped"),
pl.col("jGene").map_elements(strip_allele, return_dtype=pl.Utf8).alias("jGene_stripped"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better performance, it's recommended to use Polars' native string expressions instead of map_elements, which can be slow. The current implementation can be rewritten to use fill_null and str.replace for a more idiomatic and performant solution.

Suggested change
pl.col("vGene").map_elements(strip_allele, return_dtype=pl.Utf8).alias("vGene_stripped"),
pl.col("jGene").map_elements(strip_allele, return_dtype=pl.Utf8).alias("jGene_stripped"),
pl.col("vGene").fill_null("").str.replace(r"\*\d+$", "").alias("vGene_stripped"),
pl.col("jGene").fill_null("").str.replace(r"\*\d+$", "").alias("jGene_stripped"),

Comment on lines +90 to +91
target_melted = melt_chains(target_df, "target")
ref_melted = melt_chains(ref_df, "reference")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Following the removal of the unused prefix parameter from the melt_chains function, these calls should be updated accordingly.

Suggested change
target_melted = melt_chains(target_df, "target")
ref_melted = melt_chains(ref_df, "reference")
target_melted = melt_chains(target_df)
ref_melted = melt_chains(ref_df)

Comment thread test/src/wf.test.ts
Comment on lines +1 to +3
/*
There are no tests yet, create them via blockTest from @platforma-open/sdk-test' function.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This file indicates that no tests have been implemented yet. For a new feature of this complexity, it is crucial to add tests to ensure its correctness and facilitate future maintenance. Please consider adding unit tests for the Python matching logic and integration tests for the Tengo workflow.

Adds the missing pl7.app/linker/excludeColumns and pl7.app/label
annotations to the toReference linker column, matching the spec in
pcolumn-specs.md. The excludeColumns filter uses the target axis
chain value to prevent discovery of same-chain columns through
the linker.
@mzueva
mzueva merged commit 733dd7b into main Apr 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants