Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update terminator type - 1990 #1997

Merged
merged 18 commits into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reverted unnecessary changes
  • Loading branch information
nathandunn committed Jan 11, 2019
commit 7501a39d2bd62f3162f12c7e146430176992340d
33 changes: 0 additions & 33 deletions client/apollo/js/View/Track/AnnotTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -4323,14 +4323,6 @@ define([
var statusFlags = dojo.create("div", {'class': "status"}, statusDiv);
var statusRadios = [];

var associatedTranscriptDiv = dojo.create("div", {'class': "annotation_info_editor_section"}, content);
var associatedTranscriptLabel = dojo.create("div", {
innerHTML: "Transcript",
'class': "annotation_info_editor_label"
}, associatedTranscriptDiv);
var associatedTranscriptField = new dijitTextBox({'class': "annotation_editor_field"});
dojo.place(associatedTranscriptField.domNode, associatedTranscriptDiv);

var dbxrefsDiv = dojo.create("div", {'class': "annotation_info_editor_section"}, content);
var dbxrefsLabel = dojo.create("div", {
'class': "annotation_info_editor_section_header",
Expand Down Expand Up @@ -4450,7 +4442,6 @@ define([
if (!hasWritePermission) {
nameField.set("disabled", true);
symbolField.set("disabled", true);
associatedTranscriptField.set("disabled", true);
descriptionField.set("disabled", true);
dateCreationField.set("disabled", true);
dateLastModifiedField.set("disabled", true);
Expand All @@ -4464,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 @@ -4506,7 +4495,6 @@ define([
initDescription(feature);
initDates(feature);
initStatus(feature);
initAssociatedTranscript(feature);
initDbxrefs(feature, config);
initAttributes(feature, config);
initPubmedIds(feature, config);
Expand Down Expand Up @@ -4651,27 +4639,6 @@ define([
}
};

var initAssociatedTranscript = function(feature){
// feature type
var featureType = feature.type.name ;
if(!JSONUtils.regulatorTypes.includes(featureType.toUpperCase())){
dojo.style(associatedTranscriptDiv, "display", "none");
}
// if (feature.symbol) {
// symbolField.set("value", feature.symbol);
// }
var oldAssociatedTranscript;
dojo.connect(associatedTranscriptField, "onFocus", function () {
oldAssociatedTranscript = associatedTranscriptField.get("value");
});
dojo.connect(associatedTranscriptField, "onBlur", function () {
var newAssociatedTranscript = associatedTranscriptField.get("value");
if (oldAssociatedTranscript != newAssociatedTranscript) {
updateAssociatedTranscript(newAssociatedTranscript);
}
});

};

var initDbxrefs = function (feature, config) {
if (config.hasDbxrefs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,27 +209,6 @@ class AnnotationEditorController extends AbstractApolloController implements Ann
}


@RestApiMethod(description = "Set associated transcripts to a regulator type", path = "/annotationEditor/setAssociatedTranscript", verb = RestApiVerb.POST
)
@RestApiParams(params = [
@RestApiParam(name = "username", type = "email", paramType = RestApiParamType.QUERY)
, @RestApiParam(name = "password", type = "password", paramType = RestApiParamType.QUERY)
, @RestApiParam(name = "organism", type = "string", paramType = RestApiParamType.QUERY, description = "(optional) Organism ID or common name")
, @RestApiParam(name = "sequence", type = "string", paramType = RestApiParamType.QUERY, description = "(optional) Sequence name")
, @RestApiParam(name = "suppressHistory", type = "boolean", paramType = RestApiParamType.QUERY, description = "Suppress the history of this operation")
, @RestApiParam(name = "suppressEvents", type = "boolean", paramType = RestApiParamType.QUERY, description = "Suppress instant update of the user interface")
, @RestApiParam(name = "features", type = "JSONArray", paramType = RestApiParamType.QUERY, description = "JSONArray of JSON feature objects described by https://github.com/GMOD/Apollo/blob/master/grails-app/domain/org/bbop/apollo/Feature.groovy")
]
)
def setAssociatedTranscript() {
JSONObject inputObject = permissionService.handleInput(request, params)
if (permissionService.hasPermissions(inputObject, PermissionEnum.WRITE)) {
render requestHandlingService.setAssociatedTranscript(inputObject)
} else {
render status: HttpStatus.UNAUTHORIZED
}
}

@RestApiMethod(description = "Add an exon", path = "/annotationEditor/addExon", verb = RestApiVerb.POST
)
@RestApiParams(params = [
Expand Down
53 changes: 0 additions & 53 deletions grails-app/services/org/bbop/apollo/RequestHandlingService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -581,59 +581,6 @@ class RequestHandlingService {

}

JSONObject setAssociatedTranscript(JSONObject inputObject){
JSONArray features = inputObject.getJSONArray(FeatureStringEnum.FEATURES.value)
// first feature is the transcript
String uniqueName = features.getJSONObject(0).getString(FeatureStringEnum.UNIQUENAME.value)
Transcript transcript = Transcript.findByUniqueName(uniqueName)
JSONObject oldJsonObject = featureService.convertFeatureToJSON(transcript)
Sequence sequence = permissionService.checkPermissions(inputObject, PermissionEnum.WRITE)

for (int i = 1; i < features.length(); ++i) {
JSONObject jsonExon = features.getJSONObject(i);
// could be that this is null
Exon gsolExon = (Terminator) featureService.convertJSONToFeature(jsonExon, sequence)

featureService.updateNewGsolFeatureAttributes(gsolExon, sequence);

if (gsolExon.getFmin() < 0 || gsolExon.getFmax() < 0) {
throw new AnnotationException("Feature cannot have negative coordinates")
}

transcriptService.addExon(transcript, gsolExon, false)

gsolExon.save()
}
featureService.removeExonOverlapsAndAdjacencies(transcript)
transcriptService.updateGeneBoundaries(transcript)
featureService.calculateCDS(transcript)

transcript.save(flush: true)
transcript.attach()
nonCanonicalSplitSiteService.findNonCanonicalAcceptorDonorSpliceSites(transcript)
transcript.save(flush: true)

// TODO: one of these two versions . . .
JSONObject newJsonObject = featureService.convertFeatureToJSON(transcript, false)
JSONObject returnObject = createJSONFeatureContainer(newJsonObject)

Gene gene = transcriptService.getGene(transcript)

featureEventService.addNewFeatureEvent(FeatureOperation.ADD_EXON, gene.name, transcript.uniqueName, inputObject, oldJsonObject, newJsonObject, permissionService.getCurrentUser(inputObject))

AnnotationEvent annotationEvent = new AnnotationEvent(
features: returnObject
, sequence: sequence
, operation: AnnotationEvent.Operation.UPDATE
)

fireAnnotationEvent(annotationEvent)

return returnObject


}

/**
* First feature is transcript, and the rest must be exons to add
* @param inputObject
Expand Down
Loading