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

Option to set colour for different features #4534

Open
azankl opened this issue Feb 21, 2024 · 4 comments
Open

Option to set colour for different features #4534

azankl opened this issue Feb 21, 2024 · 4 comments

Comments

@azankl
Copy link

azankl commented Feb 21, 2024

I have set up ‘Phenotypes’ Layer on which I annotate text spans to HPO terms. I also added a ‘Comment’ Feature, where I can write short comments, e.g. ’need to look for a better term’, see screenshot below.

Screenshot 2024-02-16 at 12 23 29 pm

I would like the Labels with Comments to show up red, but could not find out a way to do this. As a workaround, I created a regex rule that makes the label red if the text starts with “?”. This works, but just making any label with text in the Comments turn red would be nicer. Thanks for considering this!

@reckart
Copy link
Member

reckart commented Feb 21, 2024

The workaround you adopted has the charm of allowing you to configure the color you want easily through the coloring rules. I could imagine following up on that by allowing to add a label prefix setting to the feature that would add the prefix whenever the feature value is non-empty and which could then be used in the coloring rule. It could also help discerning labels originating from different features in the UI. However, the approach is not quite user friendly / discoverable.

Another option would be to allow features to interact with the marker functionality in the annotation editor protocol - maybe through a dedicated "marker" feature type. This could then allow the user to define a feature that triggers e.g. an "error" or "comment" marker when non-empty. Such markers are shown e.g. as red or blue glows on the annotations to which they apply. This is more discoverable but less flexible because there is a fixed set of marker types and they have a fixed way of being displayed - there is no choice of color in this case.

Example of an error marker rendered in the brat editor
Screenshot 2024-02-21 at 19 02 04

@azankl
Copy link
Author

azankl commented Feb 29, 2024

I like the 2nd option (marker functionality) better. Would the text entered for the marker feature (ie. the text 'Required feature [identifier] not set.' in your example above), be exported in BioC format? What are the fixed marker types? Could not find any documentation for the marker functionality, is this part of brat?

@reckart
Copy link
Member

reckart commented Feb 29, 2024

  • Would the text entered for the marker feature (ie. the text 'Required feature [identifier] not set.' in your example above), be exported in BioC format?

Yes. There is currently no way to exclude specific features from the export. BioC supports string features. Ergo, it should be included.

  • What are the fixed marker types?

Currently, INFO and ERROR are defined.

  • Could not find any documentation for the marker functionality, is this part of brat?

👀 tl;dr: It doesn't really matter.

For historical reference:

Actually, I made a mistake - it's comment types, not marker types. We also have markers (primarily FOCUS) - those are used to highlight things for a certain purpose, but they do not include a message. Comments have a type and a text (and incidentally, they also can cause things to be highlighed).

Comments and markers have been in brat as well. I may be wrong, but I believe in the brat, the comments were stored in as Note entries. However, it is irrelevant because INCEpTION does not really use that brat format. What we have is a modified version of the brat JavaScript annotation editor. The communication protocol with that editor in principle includes marker and comment structures, e.g.:

  • AnnotationComment: ["1", "error", "This is an error"]
  • AnnotationMarker: ["1", "focus"]

But this is also partially historic since INCEpTION is has its own protocol for talking with annotation editors these days. It is similar to the one brat used, but not the same. With most editors, we use the new protocol - brat is a beast, so there we still mostly use a modified version of the original brat protocol.

@azankl
Copy link
Author

azankl commented Mar 1, 2024

Haha, not sure I understood all the details in the historical reference, but marker types INFO and ERROR sound like a good start and if the comments are exported in BioC, I think that would work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants