inception
inception copied to clipboard
Option to set colour for different features
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.
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!
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
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?
- 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.
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.