JamesSweetJones / abYdraw

Input expressions of antibodies in AbML format and output drawings of their shape
GNU General Public License v3.0
3 stars 1 forks source link

The new TYPE: pulldown doesn't seem to work properly #1

Closed AndrewCRMartin closed 2 years ago

AndrewCRMartin commented 2 years ago

This renders correctly with a TYPE:ZIPPER label on each X domain.

Now click 'TIDY'

If the domains are close enough to interact then the resulting AbML has blank MOD: comments for the X domains instead of the TYPE: comments. If they are not, then both the X domains and the Linkers have blank MOD: comments.

In either case, the rendering step doesn't work and I get the error message:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib64/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "./abYdraw.py", line 7770, in <lambda>
    button = tk.Button(frame, text = "Get Structure", bg = "#CFCFCF", font=20, command=lambda: render_pipeline(lower_canvas))
  File "./abYdraw.py", line 3599, in render_pipeline
    split_chains = Get_dictionaries(entry)
  File "./abYdraw.py", line 46, in Get_dictionaries
    if x[-1] == "]":
IndexError: string index out of range
JamesSweetJones commented 2 years ago

This should have been fixed now. There are no longer blank domain comments in the expression.

AndrewCRMartin commented 2 years ago

Almost....

As before, if I create an IgG, add two X domains that are too far to interacts and then set them as TYPE:ZIPPER all seems OK except that after doing Tidy they are labelled as MOD:ZIPPER instead of TYPE:ZIPPER

JamesSweetJones commented 2 years ago

Have a try of it now. Hopefully the comments system has been fixed now.

AndrewCRMartin commented 2 years ago

Still not quite working right.

After a little more playing, conclusions are

It's good to see that I can add something like MOD:STABILIZATION to hinges (as that is very common with IgG4 drugs)

JamesSweetJones commented 2 years ago

I think I see what's going on. Since the Linkers are drawn to the centre of the X domains then if you put the comment where the X domain and the Linker overlap (i.e. towards the top of the X domain, then it thinks the comment also applies to the linker. I'll work on a fix for this but placing comments where the linkers do not overlap just results in the X domain being assigned the comment.

There was also an issue in the comment system I wrote yesterday which split multiple comments up, leaving you with just the first comment, which has now been fixed.

It was having trouble recognising X* domains so I've removed those for now, but they can be written back in.

Is this the result that you wanted (let me know if you want X* domains to replace the X domains)?

Screenshot 2022-02-11 at 09 36 34
AndrewCRMartin commented 2 years ago

Not sure that was the problem I was seeing - it was the HINGE that was getting the MOD:OTHER, not the linker!

Surely an X is exactly the same as X but has a next to the X in the label?

On Fri, 11 Feb 2022 at 09:39, James Sweet-Jones @.***> wrote:

I think I see what's going on. Since the Linkers are drawn to the centre of the X domains then if you put the comment where the X domain and the Linker overlap (i.e. towards the top of the X domain, then it thinks the comment also applies to the linker. I'll work on a fix for this but placing comments where the linkers do not overlap just results in the X domain being assigned the comment.

There was also an issue in the comment system I wrote yesterday which split multiple comments up, leaving you with just the first comment, which has now been fixed.

It was having trouble recognising X* domains so I've removed those for now, but they can be written back in.

Is this the result that you wanted (let me know if you want X* domains to replace the X domains)?

[image: Screenshot 2022-02-11 at 09 36 34] https://user-images.githubusercontent.com/73530578/153568426-926210ae-c3c1-42c0-8521-0ddfac6652f3.png

— Reply to this email directly, view it on GitHub https://github.com/JamesSweetJones/abYdraw/issues/1#issuecomment-1036024896, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBQ7UMGNAKX6VIZ2WAL6FDU2TKM3ANCNFSM5N6ITRNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

-- Andrew C.R. Martin Professor of Bioinformatics and Computational Biology. Institute of Structural and Molecular Biology, UCL http://www.bioinf.org.uk/ Twitter: @PrfAndrewMartin

JamesSweetJones commented 2 years ago

Try again now. I've made some changes now so hopefully the hinges should not randomly pick up modification comments.

AndrewCRMartin commented 2 years ago

Seems to resolve the problems above now, BUT if I add TYPE and MOD comments to the X domains and then try to add a * to them the comments get removed.

I know you said you had removed it, but when I try to add the *, it renders on the image, but then on doing a Tidy it isn't in the AbML (and therefore disappears from the display) - as well as resulting in the comments going!

JamesSweetJones commented 2 years ago

To remove comments, you can just delete them from the canvas, and then by clicking Tidy the comment will be removed from AbML. I can work out something for the X domains to fix this.

AndrewCRMartin commented 2 years ago

That wasn't quite my point.

If I add MOD/TYPE to an X domain, then try to add a *, the MOD/TYPE is removed.

All is fine at this stage

The MOD: annotation has gone.

JamesSweetJones commented 2 years ago

OK, I may have come up with a solution to this. Try again now.

AndrewCRMartin commented 2 years ago

Seems fine now! Will do some more testing then close

JamesSweetJones commented 2 years ago

Did this work, Andrew?

AndrewCRMartin commented 2 years ago

I'm now getting problems with the linker getting the TYPE: label.

Both the X domains and the linkers have the TYPE: info

Now the linker annotation disappears!

AndrewCRMartin commented 2 years ago

The other problem with adding a * to X domains has also come back!

If I add TYPE to an X domain, then try to add a *, the TYPE is removed.

All OK to that point. Now

The TYPE: annotation has gone.

I think, but haven't checked, that if you just click one of the X domains, the TYPE annotation goes from just that domain.

JamesSweetJones commented 2 years ago

I was under the impression that a "" symbol referred to a modification and so I have only asked it to render when a "MOD:" label has been placed on a domain. Am I correct here or should "" be on the domain whenever a comment TYPE:/LENGTH:/NOTE:/ANTI:?

AndrewCRMartin commented 2 years ago

The * is indeed only for a modification, but it is independent of the comments. i.e. you can have a * without a MOD:. So, if you add a * it should be rendered whatever comments are (or are not) present.

The problem here was that adding the * removed the TYPE: comment.

Ideally a * would be added automatically if you add a MOD: comment, but that's not necessary.

JamesSweetJones commented 2 years ago

Yes the reason for this is because the TYPE comment is linked to an "X" domain, but by adding a "" symbol to the domains it makes it an "X" domain, so when you run get AbML it doesn't find the "X" domain the comment is paired to so it disappears. I will change it so these run independently.

JamesSweetJones commented 2 years ago

I've made a fix for this. When adding/removing the "*" mod from the X domains, the TYPE labels no longer disappear

AndrewCRMartin commented 2 years ago

Just tried it with the Windows version and I still have a problem with labels going:

The * is present, but the MOD: comment has gone.

AndrewCRMartin commented 2 years ago

Actually, just clicking Tidy twice removes the labels:

JamesSweetJones commented 2 years ago

Hi Andrew, I've made another fix that seems to work when running through the scenarios you've outlined above. Let me know if you still have these issues. I have now set it up so "*" are automatically added to the AbML when a MOD label is placed on that domain.

JamesSweetJones commented 2 years ago

I must also say that if a domain has "" on it but does not have a MOD comment, then by clicking Tidy the "" will be removed. In this way, users will be made to give a comment, even if it is MOD:OTHER. Do you think this is suitable or would it be best if we allowed "*" without having to explain it with a comment?

AndrewCRMartin commented 2 years ago

The specification doesn't require a '' to have a MOD comment. Indeed I'm using '' in the INN annotations since the information about modifications is given in more detail elsewhere. Comments are always optional.

A.

On Wed, 16 Feb 2022 at 16:10, James Sweet-Jones @.***> wrote:

I must also say that if a domain has "" on it but does not have a MOD comment, then by clicking Tidy the "" will be removed. In this way, users will be made to give a comment, even if it is MOD:OTHER. Do you think this is suitable or would it be best if we allowed "*" without having to explain it with a comment?

— Reply to this email directly, view it on GitHub https://github.com/JamesSweetJones/abYdraw/issues/1#issuecomment-1041829671, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBQ7UIQXPKJNKOFVZ357K3U3PEA3ANCNFSM5N6ITRNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

-- Andrew C.R. Martin Professor of Bioinformatics and Computational Biology. Institute of Structural and Molecular Biology, UCL http://www.bioinf.org.uk/ Twitter: @PrfAndrewMartin

AndrewCRMartin commented 2 years ago

This new behaviour of not allowing a * without a MOD: breaks some of the library structures - e.g.

The AbML has changed.

IMHO, if you input some AbML, click Get Structure and then click Tidy without doing anything else, the AbML should never change!

JamesSweetJones commented 2 years ago

My issue here is that I use the * symbols in the Get AbML pipeline to identify which domain the comments apply to. Otherwise if there were more of that type of domain, the pipeline would assign the comment to all domains of that type. If this strategy isn't working I will come up with something better. I have a few ideas that could overcome this.

AndrewCRMartin commented 2 years ago

Each domain has a number so surely the comment should be attached via the domain number rather than the domain label.

I don't quite understand the issue though as any domain with a MOD comment will always have a '', but you can have a '' without MOD comment.

On Thu, 17 Feb 2022 at 12:10, James Sweet-Jones @.***> wrote:

My issue here is that I use the * symbols in the Get AbML pipeline to identify which domain the comments apply to. Otherwise if there were more of that type of domain, the pipeline would assign the comment to all domains of that type. If this strategy isn't working I will come up with something better. I have a few ideas that could overcome this.

— Reply to this email directly, view it on GitHub https://github.com/JamesSweetJones/abYdraw/issues/1#issuecomment-1042884839, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBQ7UIUGAK26PYU4CQES4LU3TQTBANCNFSM5N6ITRNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

-- Andrew C.R. Martin Professor of Bioinformatics and Computational Biology. Institute of Structural and Molecular Biology, UCL http://www.bioinf.org.uk/ Twitter: @PrfAndrewMartin

JamesSweetJones commented 2 years ago

I've rewritten the system that recognises and allocates comments. I think this is working much better and after having tested it on the scenarios outlined above!

AndrewCRMartin commented 2 years ago

Great - I will take a look :)

A.

On Thu, 17 Feb 2022 at 16:23, James Sweet-Jones @.***> wrote:

I've rewritten the system that recognises and allocates comments. I think this is working much better and after having tested it on the scenarios outlined above!

— Reply to this email directly, view it on GitHub https://github.com/JamesSweetJones/abYdraw/issues/1#issuecomment-1043147807, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBQ7UKSPUJ4MF4UHX5C67LU3UOHNANCNFSM5N6ITRNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

-- Andrew C.R. Martin Professor of Bioinformatics and Computational Biology. Institute of Structural and Molecular Biology, UCL http://www.bioinf.org.uk/ Twitter: @PrfAndrewMartin

AndrewCRMartin commented 2 years ago

Much better, but still not quite there!

I created an IgG and tried clicking on each pair of interacting domains in turn and clicking Tidy after each pair. It all worked fine until I did CL/CH1 (which I did last) when it gave:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib64/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "./abYdraw.py", line 7658, in <lambda>
    button = tk.Button(frame, text = "Tidy", bg = "#CFCFCF", font=20, command=lambda: sequence_render_pipeline(lower_canvas))
  File "./abYdraw.py", line 3810, in sequence_render_pipeline
    exp = sequence_pipeline(lower_canvas)
  File "./abYdraw.py", line 4399, in sequence_pipeline
    bondx2 = bonds_dict.get(full_chain[-1])[0][2]
TypeError: 'NoneType' object is not subscriptable
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib64/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "./abYdraw.py", line 5686, in items_selected
    index = i[0]
IndexError: tuple index out of range

Also if I just do

The AbML is created correctly, but the * on CL doesn't appear

Sorry!!!!!

JamesSweetJones commented 2 years ago

Oh that is strange. Must be where I do my checks to make sure the labels aren't duplicated. I'll have a look.

JamesSweetJones commented 2 years ago

Works now :)

AndrewCRMartin commented 2 years ago

Brilliant :)