public QueryResult<Cohort> removeAnnotationSets(String studyStr, String cohortStr, List<String> annotationSetIdList, QueryOptions options, String token) throws CatalogException { List<AnnotationSet> annotationSetList = annotationSetIdList .stream() .map(id -> new AnnotationSet().setId(id)) .collect(Collectors.toList()); return updateAnnotationSet(studyStr, cohortStr, annotationSetList, ParamUtils.UpdateAction.REMOVE, options, token); }
public QueryResult<Individual> removeAnnotationSets(String studyStr, String individualStr, List<String> annotationSetIdList, QueryOptions options, String token) throws CatalogException { List<AnnotationSet> annotationSetList = annotationSetIdList .stream() .map(id -> new AnnotationSet().setId(id)) .collect(Collectors.toList()); return updateAnnotationSet(studyStr, individualStr, annotationSetList, ParamUtils.UpdateAction.REMOVE, options, token); }
public QueryResult<Family> removeAnnotationSets(String studyStr, String familyStr, List<String> annotationSetIdList, QueryOptions options, String token) throws CatalogException { List<AnnotationSet> annotationSetList = annotationSetIdList .stream() .map(id -> new AnnotationSet().setId(id)) .collect(Collectors.toList()); return updateAnnotationSet(studyStr, familyStr, annotationSetList, ParamUtils.UpdateAction.REMOVE, options, token); }
public QueryResult<Sample> removeAnnotationSets(String studyStr, String sampleStr, List<String> annotationSetIdList, QueryOptions options, String token) throws CatalogException { List<AnnotationSet> annotationSetList = annotationSetIdList .stream() .map(id -> new AnnotationSet().setId(id)) .collect(Collectors.toList()); return updateAnnotationSet(studyStr, sampleStr, annotationSetList, ParamUtils.UpdateAction.REMOVE, options, token); }
/** * Deletes the annotation set. * * @param id id of the entity storing the annotation. * @param studyStr study string. * @param annotationSetName annotation set name of the annotation to be deleted. * @param sessionId session id of the user asking for the annotation. * @return a queryResult object with the annotationSet that has been deleted. * @throws CatalogException when the session id is not valid, the user does not have permissions to delete the annotationSet or * the annotation set name is not valid. */ @Deprecated public QueryResult<AnnotationSet> deleteAnnotationSet(String id, @Nullable String studyStr, String annotationSetName, String sessionId) throws CatalogException { if (StringUtils.isEmpty(annotationSetName)) { throw new CatalogException("Missing annotationSetName field"); } ObjectMap params = new ObjectMap(AnnotationSetManager.ANNOTATION_SETS, Collections.singleton(new AnnotationSet().setId(annotationSetName))); QueryOptions options = new QueryOptions(Constants.ACTIONS, new ObjectMap(AnnotationSetManager.ANNOTATION_SETS, ParamUtils.UpdateAction.REMOVE)); QueryResult<R> update = update(studyStr, id, params, options, sessionId); return new QueryResult<>("Delete annotationSet", update.getDbTime(), 0, 0, update.getWarningMsg(), update.getErrorMsg(), Collections.emptyList()); }