phenoscape / Phenex

Phenex is an application for annotating character matrix files with ontology terms using the Entity-Quality syntax for describing phenotypes.
http://phenex.phenoscape.org/
MIT License
10 stars 3 forks source link

Mark and serialize manual editing of EQ status #84

Open hlapp opened 8 years ago

hlapp commented 8 years ago

Thanks to @calliem's work, a curator will have the ability to pre-fill EQ annotations in Phenex from a named entity recognition service. Many times, these will need subsequent manual adjustment by the curator, such as deleting redundant or incorrect E and Q combinations, or further tweaking of Es and Qs. A curator may not be able to go through all characters in a single session, and when resuming from file later, it may not be entirely obvious where they left off. As a workaround, comments could be left for the character. However, a visible hint (such as by font color) to which characters have been manually adjusted and which ones have not would be very useful, and would need to be persisted between sessions.

The question is how should such a marker best be added as metadata to the in-memory model so it gets properly written out to the NeXML file and read back in upon reloading the file? @balhoff could you advise?

balhoff commented 8 years ago

I would look at something like the comment field of states, to see how it is attached to the state as an annotation in NeXML and then read back in.

https://github.com/phenoscape/Phenex/blob/master/src/org/phenoscape/model/State.java https://github.com/phenoscape/Phenex/blob/master/src/org/phenoscape/io/NeXMLWriter.java#L328 https://github.com/phenoscape/Phenex/blob/master/src/org/phenoscape/io/NeXMLReader.java#L173

balhoff commented 8 years ago

A character could show an indicator that is computed from the progress data attached to its states.

hlapp commented 8 years ago

@balhoff I was also wondering whether you have ideas re: the metadata attribute that would be best suited for attaching such a marker state. Or should we just make up our own?

Do these statements mean that you are essentially hard-coding some metadata attributes? And if so, which vocabulary will these be put in upon writing?

    public static final String COMMENT = "comment";
    public static final String SYMBOL = "symbol";
    public static final String LABEL = "label";
    public static final String FIGURE = "figure";
balhoff commented 8 years ago

The vocabulary for those is just specified in the NeXML input/output code. The constants there are just used within State.java, because there is some reflection used to set properties in the model objects.

I don't know of any good metadata attributes offhand. I did a little looking around but didn't find anything obvious.

hlapp commented 8 years ago

So would the pattern to follow be to add another statement to the aforementioned, such as

public static final String CURATOR_EDITED = "curator_edited";

Alternatively, perhaps it's worth adding an ECO term to the state (or the character?), such as perhaps ECO:0000203 versus ECO:0000218, or ECO:0000363 versus ECO:0000306.

Thoughts, @balhoff?

balhoff commented 8 years ago

I think you can just do a regular getter and setter for a boolean property. The other properties send out property change notifications that are used in undo/redo. If this value is being set indirectly by some other action (like changing a phenotype), then that action would be the thing expected to be undone.

I like ECO:0000203 versus ECO:0000218, good idea. So that would be a URI value, like denotes for Character. That is written out in NeXML a little differently than a string.

hlapp commented 8 years ago

I like ECO:0000203 versus ECO:0000218, good idea. So that would be a URI value, like denotes for Character. That is written out in NeXML a little differently than a string.

But it could come back in the same way? I think that's what matters most for @calliem, i.e., does she need to be concerned with how this is written out and read back in.

hlapp commented 8 years ago

I think you can just do a regular getter and setter for a boolean property.

And that would automatically get serialized?

balhoff commented 8 years ago

You need to write code to serialize and deserialize. I would look at how this works in the NeXML writer and reader for other properties of State (for when to do it), and for the denotes URI for Character (for how to do it for URI). Does that help?