Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

807 tally number of residues for bilbomd af form #832

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shrprabh
Copy link
Collaborator

@shrprabh shrprabh commented Feb 5, 2025

This pull request introduces several significant changes to the NewAlphaFoldJobForm.tsx file, primarily focusing on the handling of amino acid sequences and form field interactions. The most important changes include the addition of a custom AminoAcidField component, updates to event type handling, and the calculation of total characters with copies for entities.

Enhancements to Amino Acid Sequence Handling:

  • Added a new AminoAcidField component that displays chunked text when not focused, improving readability and user interaction. [1] [2]

Event Type Handling:

  • Updated event type definitions for handleBlur and handleChange to use FocusEvent and ChangeEvent respectively, ensuring type safety.

Form Functionality Improvements:

  • Implemented a calculation for the total characters with copies for entities, displaying this information in the form. [1] [2]

General Code Enhancements:

  • Imported additional event types (ChangeEvent, FocusEvent) and useEffect to support new functionality.

Add a visually appealing display when the user inputs an amino sequence, with superscripted numbers separated by a count of 10.

image
image
Screenshot 2025-02-04 at 6 39 08 PM

Ensure that superscripts and all are not sent through the network when submitting.

image

@shrprabh shrprabh added the enhancement New feature or request label Feb 5, 2025
@shrprabh shrprabh requested a review from dsclassen February 5, 2025 00:40
@shrprabh shrprabh self-assigned this Feb 5, 2025
@shrprabh shrprabh linked an issue Feb 5, 2025 that may be closed by this pull request
@dsclassen
Copy link
Contributor

This is a good start. I like the new chunking functionality. I am still looking at the details of your implementation. One thing that comes to mind is that we may want to store the residue count in the value object so that we can make use of Yup to validate? For example the current initialValues is:

  const initialValues: NewAlphaFoldJobFormValues = {
    title: '',
    dat_file: '',
    email: email,
    entities: [
      {
        id: '1',
        name: 'pro-1',
        sequence: '',
        type: 'Protein',
        copies: 1
      }
    ]
  }

but maybe something like this would be preferable:

  const initialValues: NewAlphaFoldJobFormValues = {
    title: '',
    dat_file: '',
    email: email,
    entities: [
      {
        id: '1',
        name: 'pro-1',
        sequence: '',
        type: 'Protein',
        copies: 1,
        seq_length: 0
      }
    ]
  }

on the other hand... maybe this isn't necessary since we can easily access sequence?.length within our yup validation schema.

@dsclassen
Copy link
Contributor

There is an odd display glitch with some of the superscripted numbers:

Screenshot 2025-02-05 at 1 38 41 PM

@shrprabh
Copy link
Collaborator Author

shrprabh commented Feb 7, 2025

There is an odd display glitch with some of the superscripted numbers:

Screenshot 2025-02-05 at 1 38 41 PM

I’ll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tally number of residues for BilboMD AF form
2 participants