Skip to content

Commit 5f9b6d2

Browse files
authoredDec 17, 2020
added a lookup for uuid in loc (#2549)
* added a lookup for uuid in loc * updated * made ids linkable
1 parent 79d19d1 commit 5f9b6d2

File tree

9 files changed

+34
-17
lines changed

9 files changed

+34
-17
lines changed
 

‎ChangeLog.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Features
1010
- Added UUID lookup and link [2539](https://github.com/GMOD/Apollo/pull/2539/).
1111
- Added status filter for recent annotations [2543](https://github.com/GMOD/Apollo/pull/2543/).
1212
- Add feature name `loc` to loadLink [2544](https://github.com/GMOD/Apollo/issues/2544).
13+
- `loc` loadLink now supports UUID and ID popup provides link [2549](https://github.com/GMOD/Apollo/issues/2549).
1314

1415
Bug Fixes
1516

@@ -18,6 +19,7 @@ Bug Fixes
1819
- Now able to resize terminators by dragging [2521](https://github.com/GMOD/Apollo/issues/2521).
1920
- Added missing GO annotations [2535](https://github.com/GMOD/Apollo/pull/2535).
2021
- findAllOrganism webserver failed when user is not an admin and no session is present [2540](https://github.com/GMOD/Apollo/issues/2540).
22+
- Provide minor UI and bug fixes [2548](https://github.com/GMOD/Apollo/pull/2548).
2123

2224
Infrastructure Changes
2325

‎docs/Configure.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,7 @@ http://demo.genomearchitect.org/Apollo2/3836/jbrowse/index.html?loc=Group1.31:28
638638

639639
<apollo server url>/<organism>/annotator/loadLink?loc=<location>&organism=<organism>&tracks=<tracks>
640640

641-
- `location` = <sequence name>:<fmin>..<fmax> it can also be the annotated feature name as well
642-
- `uuid` = The uniquename of the feature. It replaces the feature and does not require an organism argument. It is used inplace of the `loc` option.
641+
- `location` = <sequence name>:<fmin>..<fmax> it can also be the annotated feature `name` if an organims is provided or the `uniqueName` (see the ID in the annotation detail window), which is typically a UUID and does not require an organism.
643642
- `organism` is the organism id or common name if unique.
644643
- `tracks` are url-encoded tracks separated by a comma
645644

‎grails-app/controllers/org/bbop/apollo/AnnotatorController.groovy

+14-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ class AnnotatorController {
8585
organism = featureLocation.sequence.organism
8686
}
8787

88-
if (!allowedOrganisms.contains(organism)) {
88+
if (Feature.countByUniqueName(params.loc)>0) {
89+
Feature feature = Feature.findByUniqueName(params.loc)
90+
FeatureLocation featureLocation = feature.featureLocation
91+
params.loc = featureLocation.sequence.name + ":" + featureLocation.fmin + ".." + featureLocation.fmax
92+
organism = featureLocation.sequence.organism
93+
}
94+
95+
if (!allowedOrganisms.contains(organism)) {
8996
log.error("Can not load organism ${organism?.commonName} so loading ${allowedOrganisms.first().commonName} instead.")
9097
params.loc = null
9198
organism = allowedOrganisms.first()
@@ -94,10 +101,12 @@ class AnnotatorController {
94101
log.debug "loading organism: ${organism}"
95102
preferenceService.setCurrentOrganism(permissionService.currentUser, organism, clientToken)
96103
String location = params.loc
97-
// assume that the lookup is a symbol lookup value and not a location
104+
105+
// assume that the lookup is a symbol lookup value and not a location
98106
if (location) {
99107
int colonIndex = location.indexOf(':')
100108
int ellipseIndex = location.indexOf('..')
109+
101110
if(colonIndex > 0 && colonIndex < ellipseIndex){
102111
String[] splitString = location.split(':')
103112
log.debug "splitString : ${splitString}"
@@ -127,6 +136,9 @@ class AnnotatorController {
127136
int fmax = featureLocation.fmax
128137
preferenceService.setCurrentSequenceLocation(sequence.name, fmin, fmax, clientToken)
129138
}
139+
else{
140+
log.error("Failed to process load process loadLink string")
141+
}
130142
}
131143
}
132144

‎src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1034,8 +1034,7 @@ public void updateStatus(ChangeEvent changeEvent){
10341034

10351035
@UiHandler(value = {"annotationLinkButton"})
10361036
public void showAnnotationLink(ClickEvent clickEvent){
1037-
String url = MainPanel.getInstance().generateApolloUrl(selectedAnnotationInfo.getUniqueName());
1038-
String link = "<a href='"+url+"'>"+url+"</a>";
1037+
String link =MainPanel.getInstance().generateApolloLink(selectedAnnotationInfo.getUniqueName());
10391038
new LinkDialog("Link to '"+selectedAnnotationInfo.getName()+"'",link,true);
10401039
}
10411040

‎src/gwt/org/bbop/apollo/gwt/client/GeneDetailPanel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public void updateData(AnnotationInfo annotationInfo) {
267267

268268
@UiHandler("annotationIdButton")
269269
void getAnnotationInfo(ClickEvent clickEvent) {
270-
Bootbox.alert(internalAnnotationInfo.getUniqueName());
270+
new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true);
271271
}
272272

273273
@UiHandler("gotoAnnotation")

‎src/gwt/org/bbop/apollo/gwt/client/MainPanel.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,11 @@ public String generateApolloUrl() {
953953
return generateApolloUrl(null);
954954
}
955955

956+
public String generateApolloLink(String uuid) {
957+
String url = generateApolloUrl(uuid);
958+
return "<a href='"+url+"'>"+url+"</a>";
959+
}
960+
956961
public String generateApolloUrl(String uuid) {
957962
String url = Annotator.getRootUrl();
958963
url += "annotator/loadLink";
@@ -964,7 +969,7 @@ public String generateApolloUrl(String uuid) {
964969
}
965970
}
966971
else{
967-
url += "?uuid="+uuid;
972+
url += "?loc="+uuid;
968973
}
969974
url += "&organism=" + currentOrganism.getId();
970975
url += "&tracks=";

‎src/gwt/org/bbop/apollo/gwt/client/RepeatRegionDetailPanel.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
public class RepeatRegionDetailPanel extends Composite {
3434
private AnnotationInfo internalAnnotationInfo;
35-
35+
3636
interface AnnotationDetailPanelUiBinder extends UiBinder<Widget, RepeatRegionDetailPanel> {
3737
}
3838

@@ -74,7 +74,7 @@ public RepeatRegionDetailPanel() {
7474

7575
@UiHandler("annotationIdButton")
7676
void getAnnotationInfo(ClickEvent clickEvent) {
77-
Bootbox.alert(internalAnnotationInfo.getUniqueName());
77+
new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true);
7878
}
7979

8080
@UiHandler("gotoAnnotation")
@@ -184,7 +184,7 @@ void handleNameChange(ChangeEvent e) {
184184
internalAnnotationInfo.setName(updatedName);
185185
updateEntity();
186186
}
187-
187+
188188
@UiHandler("descriptionField")
189189
void handleDescriptionChange(ChangeEvent e) {
190190
String updatedDescription = descriptionField.getText();
@@ -204,7 +204,7 @@ private void enableFields(boolean enabled) {
204204
descriptionField.setEnabled(enabled);
205205
synonymsField.setEnabled(enabled);
206206
}
207-
207+
208208
private void updateEntity() {
209209
final AnnotationInfo updatedInfo = this.internalAnnotationInfo;
210210
enableFields(false);
@@ -227,7 +227,7 @@ public void onError(Request request, Throwable exception) {
227227
data.put(FeatureStringEnum.ORGANISM.getValue(),new JSONString(MainPanel.getInstance().getCurrentOrganism().getId()));
228228
RestService.sendRequest(requestCallback, "annotator/updateFeature/", data);
229229
}
230-
230+
231231
public void updateData(AnnotationInfo annotationInfo) {
232232
GWT.log("Updating entity");
233233
this.internalAnnotationInfo = annotationInfo;
@@ -305,4 +305,4 @@ public void setEditable(boolean editable) {
305305
synonymsField.setEnabled(editable);
306306
deleteAnnotation.setEnabled(editable);
307307
}
308-
}
308+
}

‎src/gwt/org/bbop/apollo/gwt/client/TranscriptDetailPanel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void callback(boolean result) {
159159

160160
@UiHandler("annotationIdButton")
161161
void getAnnotationInfo(ClickEvent clickEvent) {
162-
Bootbox.alert(internalAnnotationInfo.getUniqueName());
162+
new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true);
163163
}
164164

165165
@UiHandler("gotoAnnotation")

‎src/gwt/org/bbop/apollo/gwt/client/VariantDetailPanel.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void callback(boolean result) {
155155

156156
@UiHandler("annotationIdButton")
157157
void getAnnotationInfo(ClickEvent clickEvent) {
158-
Bootbox.alert(internalAnnotationInfo.getUniqueName());
158+
new LinkDialog("UniqueName: "+internalAnnotationInfo.getUniqueName(),"Link to: "+MainPanel.getInstance().generateApolloLink(internalAnnotationInfo.getUniqueName()),true);
159159
}
160160

161161
@UiHandler("gotoAnnotation")
@@ -315,4 +315,4 @@ public void onError(Request request, Throwable exception) {
315315
public static boolean isValidDNA(String bases) {
316316
return bases.matches("^[ATCGN]+$");
317317
}
318-
}
318+
}

0 commit comments

Comments
 (0)
Please sign in to comment.