Skip to content

Commit

Permalink
update terminator type - 1990 (#1997)
Browse files Browse the repository at this point in the history
* fixed width calculation

* small fixes and disabled portions of the drop-down menu

* fixed counting errors

* added the initial associated transcript type

* added the appropriate hooks

* some minor fix type things

* reverted unnecessary changes

* added a basic start to an image

* removed unused code

* some minor fixes, but still not adaquetyly drawing

* testing readthedocs webhook

* added

* adding a semi-sange default

* started to add the strand types

* is properly adding strand

* gotthe styling correct
  • Loading branch information
nathandunn committed Jan 21, 2019
1 parent 1eca4e8 commit ddb6156
Show file tree
Hide file tree
Showing 10 changed files with 1,062 additions and 1,017 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ Thanks to YourKit for providing us the use of their YourKit Java Profiler. Your

[![Waffle.io - Columns and their card count](https://badge.waffle.io/GMOD/Apollo.svg?columns=all)](https://waffle.io/GMOD/Apollo)


29 changes: 29 additions & 0 deletions client/apollo/css/webapollo_track_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,35 @@ div.track_webapollo_view_track_annotsequencetrack div.track-label .track-close-b
background-color: magenta;
}


.jbrowse .terminator {
position: absolute;
height: 16px;
z-index: 100;
/*background-color: black;*/
background-repeat: no-repeat;
background-size: 9px 15px;


/* TODO: remove when we have another strand type */
background-image: url('../img/plus-terminator.png');
background-position: bottom center; /* center image vertically */
}

.jbrowse .terminator-render {
position: absolute;
height: 10px;
z-index: 100;
background-color: black;
}


.jbrowse .minus-terminator {
}

.jbrowse .plus-terminator {
}

.jbrowse .transposable_element,
.jbrowse .plus-transposable_element,
.jbrowse .minus-transposable_element {
Expand Down
Binary file added client/apollo/img/minus-terminator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/apollo/img/plus-terminator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/apollo/img/terminator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 27 additions & 12 deletions client/apollo/js/View/Track/AnnotTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,9 +1147,11 @@ define([
var biotype ;

// TODO: pull from the server at some point
// TODO: this list is duplicated
var recognizedBioType = [
'transcript' ,'tRNA','snRNA','snoRNA','ncRNA','rRNA','mRNA','miRNA','repeat_region','transposable_element'
'transcript' ,'tRNA','snRNA','snoRNA','ncRNA','rRNA','mRNA','miRNA','repeat_region','transposable_element','terminator'
];
var strandedOneLevelTypes = ['terminator'];

if(force_type) {
biotype = featureToAdd.get('type');
Expand All @@ -1175,7 +1177,7 @@ define([
target_track.createGenericAnnotations([featureToAdd], biotype, null , 'gene');
}
else {
target_track.createGenericOneLevelAnnotations([featureToAdd], biotype , true );
target_track.createGenericOneLevelAnnotations([featureToAdd], biotype , strandedOneLevelTypes.indexOf(biotype)<0);
}

var postData = {
Expand Down Expand Up @@ -1495,14 +1497,12 @@ define([
track.executeUpdateOperation(postData);
}
else if (feature.afeature.parent_id) {
var feats = [feature];
this.createGenericAnnotations([feature], feature.get("type"), feature.get("subfeatures")[0].get("type"), feature.afeature.parent_type.name);
}
else {
if (!feature.get("name")) {
feature.set("name", feature.afeature.name);
}
var feats = [feature];
this.createGenericOneLevelAnnotations([feature], feature.get("type"), feature.get("strand") == 0);
}
}
Expand Down Expand Up @@ -4275,7 +4275,6 @@ define([
var nameField = new dijitTextBox({'class': "annotation_editor_field"});
var nameLabelss = "Follow GenBank or UniProt-SwissProt guidelines for gene, protein, and CDS nomenclature.";
dojo.place(nameField.domNode, nameDiv);
// var nameField = new dojo.create("input", { type: "text" }, nameDiv);

new Tooltip({
connectId: nameDiv,
Expand Down Expand Up @@ -4456,8 +4455,6 @@ define([
dojo.attr(deleteGoIdButton, "disabled", true);
dojo.attr(addCommentButton, "disabled", true);
dojo.attr(deleteCommentButton, "disabled", true);
//dojo.attr(addreplacementButton, "disabled", true);
//dojo.attr(deletereplacementButton, "disabled", true);
}

var pubmedIdDb = "PMID";
Expand Down Expand Up @@ -4497,7 +4494,6 @@ define([
initSymbol(feature);
initDescription(feature);
initDates(feature);
// initStatus(feature, config);
initStatus(feature);
initDbxrefs(feature, config);
initAttributes(feature, config);
Expand Down Expand Up @@ -4606,7 +4602,7 @@ define([
var statusRadio = new dijitRadioButton({
value: status[i],
name: "status_" + uniqueName,
checked: status[i] == feature.status ? true : false
checked: status[i] == feature.status
});
if (!hasWritePermission) {
statusRadio.set("disabled", true);
Expand Down Expand Up @@ -4643,6 +4639,7 @@ define([
}
};


var initDbxrefs = function (feature, config) {
if (config.hasDbxrefs) {
var oldDb;
Expand Down Expand Up @@ -6610,6 +6607,10 @@ define([
},

initAnnotContextMenu: function () {

// TODO: this list is duplicated
var topTypes = ['repeat_region','transposable_element','gene','pseudogene', 'SNV', 'SNP', 'MNV', 'MNP', 'indel', 'insertion', 'deletion','terminator'];

var thisB = this;
contextMenuItems = new Array();
annot_context_menu = new dijit.Menu({});
Expand Down Expand Up @@ -6650,7 +6651,6 @@ define([
var selected = thisB.selectionManager.getSelection();
var selectedFeature = selected[0].feature;
var selectedFeatureDetails = selectedFeature.afeature;
var topTypes = ['repeat_region','transposable_element','gene','pseudogene', 'SNV', 'SNP', 'MNV', 'MNP', 'indel', 'insertion', 'deletion'];
while(selectedFeature ){
if(topTypes.indexOf(selectedFeatureDetails.type.name)>=0){
thisB.getApollo().viewInAnnotationPanel(selectedFeatureDetails.name);
Expand Down Expand Up @@ -6741,13 +6741,28 @@ define([
thisB.changeAnnotationType("miRNA");
}
}));
changeAnnotationMenu.addChild(new dijitMenuItem( {
label: "terminator",
onclick: function(event) {
var selected = thisB.selectionManager.getSelection();
var selectedFeatureType = selected[0].feature.afeature.type.name === "exon" ?
selected[0].feature.afeature.parent_type.name : selected[0].feature.afeature.type.name;
if (selectedFeatureType != "transposable_element" && selectedFeatureType != "repeat_region") {
var message = "Warning: You will not be able to revert back to " + selectedFeatureType + " via 'Change annotation type' menu option, use 'Undo' instead. Do you want to proceed?";
thisB.confirmChangeAnnotationType(thisB, [selected], "terminator", message);
}
else {
thisB.changeAnnotationType("terminator");
}
}
}));
changeAnnotationMenu.addChild(new dijitMenuItem( {
label: "repeat_region",
onClick: function(event) {
var selected = thisB.selectionManager.getSelection();
var selectedFeatureType = selected[0].feature.afeature.type.name === "exon" ?
selected[0].feature.afeature.parent_type.name : selected[0].feature.afeature.type.name;
if (selectedFeatureType != "transposable_element") {
if (selectedFeatureType != "transposable_element" && selectedFeatureType != "terminator" ) {
var message = "Warning: You will not be able to revert back to " + selectedFeatureType + " via 'Change annotation type' menu option, use 'Undo' instead. Do you want to proceed?";
thisB.confirmChangeAnnotationType(thisB, [selected], "repeat_region", message);
}
Expand All @@ -6762,7 +6777,7 @@ define([
var selected = thisB.selectionManager.getSelection();
var selectedFeatureType = selected[0].feature.afeature.type.name === "exon" ?
selected[0].feature.afeature.parent_type.name : selected[0].feature.afeature.type.name;
if (selectedFeatureType != "repeat_region") {
if (selectedFeatureType != "repeat_region" && selectedFeatureType != "terminator") {
var message = "Warning: You will not be able to revert back to " + selectedFeatureType + " via 'Change annotation type' menu option, use 'Undo' instead. Do you want to proceed?";
thisB.confirmChangeAnnotationType(thisB, [selected], "transposable_element", message);
}
Expand Down
2 changes: 1 addition & 1 deletion client/apollo/js/View/Track/DraggableHTMLFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ var draggableTrack = declare( HTMLFeatureTrack,
var selection = this.selectionManager.getSelection();
var selFeats = this.selectionManager.getSelectedFeatures();
this.selectionManager.clearSelection();
atrack.createGenericOneLevelAnnotations(selFeats, "terminator", true);
atrack.createGenericOneLevelAnnotations(selFeats, "terminator", false);
})
}));
createAnnotationMenu.addChild(new dijitMenuItem( {
Expand Down
4 changes: 2 additions & 2 deletions client/apollo/json/annot.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"arrowheadClass" : "annot-arrowhead",
"alternateClasses" : {
"terminator" : {
"renderClassName" : "black-80pct annot-apollo",
"className" : "black-80pct"
"renderClassName" : "terminator-render annot-apollo",
"className" : "terminator"
},
"transposable_element" : {
"renderClassName" : "blue-ibeam-render annot-apollo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.springframework.http.HttpStatus
/**
* This is server-side code supporting the high-level functionality of the GWT AnnotatorPanel class.
*/
@RestApi(name = "Application Services", description = "Methods for running the annotation engine")
@RestApi(name = "Annotator Engine Services", description = "Methods for running the annotation engine")
class AnnotatorController {

def featureService
Expand Down
Loading

0 comments on commit ddb6156

Please sign in to comment.