Closed jseager7 closed 5 years ago
annotation_edit.html
annotationEditDialogCtrl
startEditing
(opens modal linked to template and controller)featureChooser
featureType
binding to have a value of "metagenotype"
, but the controller doesn't support this option yet; the Metagenotype
service needs to be injected and logic needs to be added to function featureChooserControlHelper
.Yes this is strange In normal Canto you can edit the genotype in this pop up with cop/edit.....
Yes this is strange In normal Canto you can edit the genotype in this pop up with cop/edit.....
Changing the genotype still works. It's changing the meta-genotype of an annotation that needs implementing.
I've changed the Perl code that returns metagenotype details so that a minimal display_name is returned for each metagenotype. Currently it's just pathogen and host display names separated by "/".
minimal display_name is returned
I've also added a feature_id
that's needed by the feature-chooser.
While trying to understand #1768 I think I've implemented some of this issue. I've made pull request: https://github.com/pombase/canto/pull/1769
OK, the metagenotypes display in the feature chooser now:
Unfortunately, the chooser should really display the organism and strain names (as suggested above), since the most common use case for copying pathogen–host annotations is copying them onto different strains of the same organism, and those metagenotypes can't be distinguished at the moment. I'd like it to look something like this:
@kimrutherford I'm not sure how easy it is to change the metagenotype feature formatting, since the formatting seems to be handled by featureChooserFilter
, and I'm not sure if adding conditional filtering there for metagenotypes will have unexpected side effects.
After further investigation, it looks like I could add some conditional formatting to featureChooserFilter
based on whether feature.metagenotype_id
is present:
canto.filter('featureChooserFilter', function () {
return function (feature) {
var ret = ""
if (feature.metagenotype_id === undefined) {
ret = feature.display_name;
} else {
/* some other formatting rule */
}
if (feature.background) {
ret += " (bkg: " + feature.background.substr(0, 15);
if (feature.background.length > 15) {
ret += " ...";
}
ret += ")";
}
return ret;
};
});
But maybe we should just change the display name of metagenotypes to include the organism and strain instead.
Hi James.
The text displayed in the chooser is the "display_name" field of the meta-genotype data returned from the server. It's quick to change the display_name. I'm a bit concerned that the chooser will become too wide but I don't know how to avoid that.
I've added the organism name and strain to the "display name" of the metagenotypes. In Firefox the annotaion edit dialog looks like this with some long-ish names. It handles things better than I thought it would.
Those are some very long genotype names 😮
Good to see that even in the worse case it doesn't overflow your screen, but it could possibly overflow on smaller screens like laptops. I've got some ideas for how to save space, presuming we can add some conditional formatting for the feature chooser. Since this issue was only to do with adding the functionality, I'll open a new issue for improving the display. Closing.
(Requested by @CuzickA)
Currently, there is no way to change the target metagenotype of a metagenotype annotation (pathogen–host interaction phenotype). Instead, a new annotation has to be created each time, which is a problem for experiments where many interactions display the same phenotypes.
This is how the annotation editing popup looks now:
Ideally, there should be a selector listing the metagenotypes added to the session. The organism name may have to be displayed in this list as well, in the case that different organisms have the same gene names. We can either re-use the existing text display for metagenotypes (as seen in the popup title in the image above), or we can use something more compact, for example:
Which would look like this in the selector:
Note that the metagenotype name may have to account for alleles with more complicated formatting – using standard parentheses to delimit the organism name and strain might be confusing when those parentheses are in the allele names as well, for example with nonsense mutations:
We could solve this by using parentheses that are never used in allele names, for example square brackets
[]
or curly brackets{}
.