Trying to auto-fill sequence(s) description field - getting a pop-up window "Conflicting Changes"
Please, help with the following:
1. Code snippet for auto-populating sequence(s) description field using the "generate" method:
2. When I fire-up the plugin, I keep getting the following window. The plugin works after clicking on "Discard changes in viewer" button:
3. How should I build the resultsList, so that it only updates the description field of the current documents, and does not create new documents?
Thank you a ton!
Yev
-
That's because you are saving the document in your annotation generate method. You mustn't modify the document directly or call save(). Instead, for each sequence you just need to add an AnnotationGeneratorResult with
result.addDocumentFieldToSet(...)
Also, don't worry about the annotations on the sequence, these will be maintained automatically. You don't have to return any annotations from the generate method.
0 -
Hello, Richard Moir.
The solution that you have proposed did not help me, because I couldn't figure out how to return the list of AnnotationGenerationResult objects inside the "generate" method. The examples in the development kit and the Phobos plugin showed how the annotations were added to the document objects, prior to returning a list of AnnotationGenerationResult objects. However, in my case I didn't need to modify the annotations, but only the description field. Upon returning the AnnotationGenerationResult objects (including when using the addDocumentFieldToSet to add the descripion field), the interface would show the pop-up (as shown in the original post).
Instead of going via the SequenceAnnotationGeneration route, I went with the DocumentOperation and returned the list of AnnotatedPluginDocument objects. Perhaps, additional code examples would've helped me more.
0 -
Is the DocumentOperation approach working for you so far?
0
Please sign in to leave a comment.
Comments
3 comments