Skip to content

Commit

Permalink
some minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Feb 12, 2019
1 parent 6bf09dc commit e93cad0
Show file tree
Hide file tree
Showing 3 changed files with 1,399 additions and 1,407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -839,31 +839,24 @@ class AnnotationEditorController extends AbstractApolloController implements Ann
, @RestApiParam(name = "password", type = "password", paramType = RestApiParamType.QUERY)
, @RestApiParam(name = "sequence", type = "string", paramType = RestApiParamType.QUERY, description = "(optional) Sequence name")
, @RestApiParam(name = "organism", type = "string", paramType = RestApiParamType.QUERY, description = "(optional) Organism ID or common name")
, @RestApiParam(name = "sequences", type = "JSONArray", paramType = RestApiParamType.QUERY, description = "JSONArray of sequence id object to delete defined by {id:<sequence.id>} ")
, @RestApiParam(name = "sequence", type = "JSONArray", paramType = RestApiParamType.QUERY, description = "JSONArray of sequence id object to delete defined by {id:<sequence.id>} ")
])
def deleteFeaturesForSequences() {
JSONObject inputObject = permissionService.handleInput(request, params)
println "delete freatures for sequences ${inputObject as JSON}"
if (permissionService.hasPermissions(inputObject, PermissionEnum.WRITE)) {
// create features from sequences
JSONArray features = new JSONArray()
inputObject.features = features
List<Long> sequenceList = inputObject.sequence.collect{
return Long.valueOf(it.id)
}
println "sequence lists ${sequenceList}"

List<String> featureUniqueNames = Feature.executeQuery("select f.uniqueName from Feature f left join f.parentFeatureRelationships pfr join f.featureLocations fl join fl.sequence s where f.childFeatureRelationships is empty and s.id in (:sequenceList) and f.class in (:viewableTypes) ", [sequenceList: sequenceList, viewableTypes: requestHandlingService.viewableAnnotationList])
println "feature unique names ${featureUniqueNames}"
featureUniqueNames.each{
def jsonObject = new JSONObject()
jsonObject.put(FeatureStringEnum.UNIQUENAME.value,it)
features.add(jsonObject)
}
println featureUniqueNames
println "deleting features iwth ${inputObject as JSON}"
inputObject.remove("sequence")

render requestHandlingService.deleteFeature(inputObject)
} else {
render status: HttpStatus.UNAUTHORIZED
Expand Down
1 change: 0 additions & 1 deletion src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,6 @@ public void callback(boolean result) {

private Set<AnnotationInfo> getDeletableChildren(AnnotationInfo selectedAnnotationInfo) {
String type = selectedAnnotationInfo.getType();
GWT.log("type:" + type);
if (type.equalsIgnoreCase(FeatureStringEnum.GENE.getValue()) || type.equalsIgnoreCase(FeatureStringEnum.PSEUDOGENE.getValue())) {
return selectedAnnotationInfo.getChildAnnotations();
}
Expand Down
Loading

0 comments on commit e93cad0

Please sign in to comment.