Skip to content

aa position table - #18

Open
Alex-Davydov wants to merge 1 commit into
mainfrom
aa-position-table
Open

aa position table#18
Alex-Davydov wants to merge 1 commit into
mainfrom
aa-position-table

Conversation

@Alex-Davydov

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @Alex-Davydov, 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 a new capability to export Kabat CDR3 amino acid positions, providing more detailed data for specific analysis needs. This feature is seamlessly integrated into the existing workflow and user interface. Concurrently, the project's dependencies have undergone a significant update to ensure stability, performance, and compatibility with the latest ecosystem standards.

Highlights

  • New Feature: Kabat CDR3 AA Position Export: Introduced an option to export Kabat CDR3 amino acid positions, enhancing data output for specific numbering schemes.
  • Dependency Updates: Numerous project dependencies have been updated to their latest versions, including core SDK packages and various build tools.
  • Workflow Enhancements: The workflow now conditionally generates and processes a new TSV file for Kabat CDR3 positions, integrating it into the final data output.
  • UI Integration: A new checkbox has been added to the user interface, allowing users to easily enable or disable the export of Kabat CDR3 AA positions when the Kabat numbering scheme is selected.
Changelog
  • model/src/index.ts
    • Added exportKabatCdr3AaPositions to BlockArgs type
    • Initialized exportKabatCdr3AaPositions to false in BlockModel.create()
  • pnpm-lock.yaml
    • Updated versions for multiple @milaboratories and @platforma-sdk packages
    • Removed several @esbuild specific platform packages for older versions (e.g., 0.24.2)
    • Added new @oxfmt and @oxlint packages for various platforms
    • Removed any-promise, bundle-require, cac, chokidar, commander@4.1.1, joycon, lines-and-columns, load-tsconfig, lodash.sortby, mz, pirates, postcss-load-config, readdirp, source-map@0.8.0-beta.0, sucrase, thenify-all, thenify, tr46@1.0.1, tree-kill, ts-interface-checker, tslib@2.7.0, tsup, typescript-eslint@8.41.0(eslint@9.34.0)(typescript@5.8.2) and related transitive dependencies
    • Added fast-json-patch, oxfmt, oxlint, tinypool, vite@6.4.1 and related transitive dependencies
    • Updated tar deprecated message
  • pnpm-workspace.yaml
    • Updated version specifications for several core SDK packages in the catalog
  • software/anarci-numbering/src/main.py
    • Added --out_cdr3_positions_tsv argument to main function
    • Implemented logic to export Kabat CDR3 positions to a TSV file if out_cdr3_positions_tsv is provided
  • ui/src/pages/MainPage.vue
    • Imported PlCheckbox component
    • Added exportKabatCdr3AaPositions computed property
    • Added a watchEffect to reset exportKabatCdr3AaPositions if the numbering scheme is not Kabat
    • Added a PlCheckbox component to the template, conditionally displayed when the numbering scheme is Kabat, allowing users to export Kabat CDR3 AA positions
  • workflow/src/anarci-numbering.tpl.tengo
    • Added cdr3Positions to self.defineOutputs
    • Added exportCdr3Positions input variable
    • Conditionally added --out_cdr3_positions_tsv argument and saveFile("cdr3_positions.tsv") to numberingExec if exportCdr3Positions is true
    • Conditionally added cdr3Positions to the workflow outputs
  • workflow/src/main.tpl.tengo
    • Added exportKabatCdr3AaPositions, cdr3PositionsTsv, and cdr3PositionsWithSampleTsv variables
    • Passed exportCdr3Positions argument to numbering workflow call, conditioned on exportKabatCdr3AaPositions and numberingScheme == "kabat"
    • Conditionally retrieved cdr3PositionsTsv from numbering.output
    • Added logic to import cdr3PositionsTsv into a DataFrame and save it as cdr3_positions.tsv if available
    • Added new logic to handle CDR3 sequence length for numbering, including new chain and alphabet checks
    • Added a comment about skipping deanonimization for Kabat positions
    • Modified newClonotypeKeySpec creation to handle clonotypingRunId and chainDomain more robustly
    • Added reorderDomainMap, normalizeAxisSpecDomain, and normalizeSpecAxisDomains functions to normalize axis spec domains
    • Added logic to import cdr3PositionsRaw into pfBuilder if available
    • Conditionally added kabatCdr3AaPositions to workflow exports
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 new feature to export a table of amino acid positions for Kabat CDR3. The changes span across the model, UI, a Python script, and workflow templates to support this new functionality. The implementation is mostly correct, but I've found a critical bug in the main workflow that prevents the new export from being generated, as well as a leftover debug statement. I've also included a suggestion to improve code style in one of the workflow templates for better readability.

Comment on lines +1130 to +1132
if cdr3PositionsPf != undefined {
exports.kabatCdr3AaPositions = cdr3PositionsPf
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The variable cdr3PositionsPf is used here but it's never assigned a value, so this block will never execute and the kabatCdr3AaPositions export will be missing.

To fix this, you should create a pframe from cdr3PositionsRaw and assign it to cdr3PositionsPf after cdr3PositionsRaw is created, for example on line 1073:

cdr3PositionsPf = pframes.fromSpecAndDataMap(cdr3PositionsRaw)

Comment on lines +83 to 92
numberingExec = numberingExec.arg("--out_tsv").arg("numbered.tsv").saveFile("numbered.tsv")
if exportCdr3Positions {
numberingExec = numberingExec.
arg("--out_cdr3_positions_tsv").arg("cdr3_positions.tsv").
saveFile("cdr3_positions.tsv")
}
numberingExec = numberingExec.
arg("--out_tsv").arg("numbered.tsv").
saveFile("numbered.tsv").
printErrStreamToStdout().
cache(24 * 60 * 60 * 1000).
run()

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 readability and to maintain a fluent interface style, you could restructure this part to keep the command-building chain more contiguous. This also makes it easier to add more conditional arguments in the future.

    if exportCdr3Positions {
        numberingExec = numberingExec.
            arg("--out_cdr3_positions_tsv", "cdr3_positions.tsv").
            saveFile("cdr3_positions.tsv")
    }
    numberingExec = numberingExec.
        arg("--out_tsv", "numbered.tsv").
        saveFile("numbered.tsv").
        printErrStreamToStdout().
        cache(24 * 60 * 60 * 1000).
        run()

},
domain: json.decode(canonical.encode(clonotypeKeyDomain))
}
ll.print("__THE_LOG__ newClonotypeKeySpec: " + json.encode(newClonotypeKeySpec))

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 appears to be a leftover debug statement. It should be removed before merging.

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.

1 participant