-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: development
Are you sure you want to change the base?
Conversation
@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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In-line comments:
I apologize for the formatting and the extra time you had to take to review the PR for my mistake 🙏🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In-line comments:
There was a problem hiding this 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) | ||
} : { |
There was a problem hiding this comment.
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, | ||
} |
There was a problem hiding this comment.
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) | ||
} : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
src/app/ui/sequence.tsx
Outdated
@@ -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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
📌 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.