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

Add custom sequence component #14

Open
wants to merge 37 commits into
base: development
Choose a base branch
from
Open

Conversation

p3rcypj
Copy link

@p3rcypj p3rcypj commented Dec 20, 2024

📌 References

📝 Implementation

Added custom SequenceView component, in order to sync chains and ligands between the viewer and the sequence in molstar. In ligand view, the selected ligand should be shown at sequence, but will not trigger any chain change. On the other hand, when chain or entity is changed, it will reflect on the viewer dropdown and viceversa. If chain is not in entry chains, it will display a toast.

Sync with protvista was also fixed by using chainId on events.

@p3rcypj
Copy link
Author

p3rcypj commented Dec 20, 2024

@tokland You will see a bunch of try catch and some repeated code that I know for sure you will point at. I know that is not the best way to do it, but I will await your response on which would be the best way to do it (because I don't)

Copy link

@tokland tokland left a comment

Choose a reason for hiding this comment

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

In-line comments:

package.json Outdated Show resolved Hide resolved
src/app/index.ts Outdated Show resolved Hide resolved
src/app/index.ts Outdated Show resolved Hide resolved
src/app/index.ts Outdated Show resolved Hide resolved
src/app/index.ts Outdated Show resolved Hide resolved
src/app/index.ts Outdated Show resolved Hide resolved
src/app/index.ts Show resolved Hide resolved
src/app/subscribe-events.ts Show resolved Hide resolved
src/app/ui/sequence-wrapper.tsx Outdated Show resolved Hide resolved
src/app/ui/sequence.tsx Show resolved Hide resolved
@p3rcypj p3rcypj requested a review from tokland January 19, 2025 06:53
@p3rcypj
Copy link
Author

p3rcypj commented Jan 19, 2025

I apologize for the formatting and the extra time you had to take to review the PR for my mistake 🙏🏼

Copy link

@tokland tokland left a comment

Choose a reason for hiding this comment

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

In-line comments:

src/app/ui/sequence.tsx Show resolved Hide resolved
src/app/ui/sequence.tsx Outdated Show resolved Hide resolved
@p3rcypj p3rcypj requested a review from tokland February 3, 2025 04:24
Copy link

@tokland tokland left a comment

Choose a reason for hiding this comment

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

In-line comments:

uniprot_accession: proteinId,
start_uniprot_residue_number: parseInt(e.detail.start),
end_uniprot_residue_number: parseInt(e.detail.end)
} : {
Copy link

Choose a reason for hiding this comment

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

Move the common props to a const before and use it in the two branches

color: fragment.color,
entity_id: fragment.feature?.entityId,
auth_asym_id: fragment.feature?.bestChainId,
}
Copy link

Choose a reason for hiding this comment

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

same

uniprot_accession: proteinId,
start_uniprot_residue_number: parseInt(e.detail.start),
end_uniprot_residue_number: parseInt(e.detail.end)
} : {
Copy link

Choose a reason for hiding this comment

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

same

@@ -48,7 +48,15 @@ export function splitModelEntityId(modelEntityId: string) {
return [parseInt(modelIdx), entityId];
}

export function getSequenceWrapper(state: { structure: Structure, modelEntityId: string, chainGroupId: number, operatorKey: string }, structureSelection: StructureSelectionManager): SequenceWrapper.Any | string {
Copy link

Choose a reason for hiding this comment

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

It looks like this file was prettified, so the diff is much larger than the real one. Can you restart the file and apply the changes again, without prettification?

Copy link
Author

Choose a reason for hiding this comment

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

@tokland I actually "prettified" by myself because of the comment about keeping the line length around 140 characters, so I prettified every line that went over that length... now I see that.. that comment was only for our own modifications right?

Copy link

@tokland tokland Feb 12, 2025

Choose a reason for hiding this comment

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

@p3rcypj Yes, this applies only to our new code. The ultimate goal is to ensure new code is readable while adding no cosmetic diffs to old code (to make upstream merging easier)

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