Skip to content

min & max stoichiometry labels #212

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

colin-combe
Copy link

#19

{
"ac": "CPX-37",
"name": "CPX-37",
"url": "https://www.ebi.ac.uk/complexportal/complex/CPX-37"

Choose a reason for hiding this comment

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

There's a small bug in complex portal (which I have fixed but not deployed yet) causing the min and max stoichiometry not being set properly when the min is 0.

The correct version of this file is
CPX-37.json

Copy link
Author

Choose a reason for hiding this comment

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

yes, the min/max label appears for the correct version of the file

participant.setPosition(-500, -500);
this.proteinUpper.appendChild(participant.upperGroup);
}
participant.setPosition(-500, -500);

Choose a reason for hiding this comment

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

I just got this code locally and I tried to run it, and this is causing errors for complex CPX-5602

app.js:254 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
    at App.init (app.js:254:1)
    at App.readMIJSON (app.js:489:1)
    at index.html?_ijt=vs1f11ftplrbgklh33n43qk7rd&_ij_reload=RELOAD_ON_SAVE:175:16
    at d3.v3.min.js:1:9203
    at Object.<anonymous> (d3.v3.min.js:1:9034)
    at Object.t (d3.v3.min.js:1:740)
    at XMLHttpRequest.i (d3.v3.min.js:1:7909)

Copy link
Author

Choose a reason for hiding this comment

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

odd, for me CPX-5602 is working,
i tested in FireFox and Chrome

Copy link
Author

Choose a reason for hiding this comment

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

it's like you don't have the most recent version of complex.js
the new version of complex.js should initialise this.upperGroup on line 12

Choose a reason for hiding this comment

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

You're right, I forgot those changes. It is working now. The only thing is that because we don't have labels for complexes, when we have stoichiometry, it's just the stoichiometry being displayed.

So, if we change the code (in line 10 of complex.js) to

        const complexIdMatch = interactorRef.match(/^.*(CPX-[0-9]+).*$/);
        const complexId = complexIdMatch ? complexIdMatch[1] : "";
        this.init(id, app, interactor, complexId);

Then we have the complex id of subcomplexes, and it would look like this

Screenshot 2025-05-09 at 10 00 42
Screenshot 2025-05-09 at 10 03 57
Screenshot 2025-05-09 at 10 04 08
Screenshot 2025-05-09 at 10 04 18
Screenshot 2025-05-09 at 10 04 31

Copy link
Author

Choose a reason for hiding this comment

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

Yes, i mentioned in the issue that "you could now also have similar labels for complexes giving their names if you wanted".

I thought it might be perceived as cluttered things up, but if you prefer this then lets do it like that.

Like this then, with complex names shown?

Choose a reason for hiding this comment

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

I'm not sure. I agree that it's a bit more cluttered, but it does look weird with just the numbers and no name. I'll check with the rest of the team to get their opinion on this and I'll get back to you.

Copy link
Author

Choose a reason for hiding this comment

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

it does look weird with just the numbers and no name

i think you're right

Copy link
Author

Choose a reason for hiding this comment

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

it's changed in the pull request now as per your suggestion (v.2.2.8). But lets see what your team think,
cheers,
C

Copy link

@EliotRagueneau EliotRagueneau May 12, 2025

Choose a reason for hiding this comment

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

I agree it looks better with the CPX id, it's clearer that it isn't a misplaced label

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.

3 participants