def remove_annotation_intersections(self, ids): vs = ViewSet(self.db, self.get_viewset_id()) info = vs.data["annotation_information"] for aid in ids: anno = info.get(str(aid)) if not anno: continue del vs.data["field_information"]["Annotations"][anno["label"]] del vs.data["annotation_information"][aid] vs.remove_columns([anno['field']]) vs.update()
def delete_tss_distances(self): vs = ViewSet(self.db, self.get_viewset_id()) fields = vs.data["field_information"].get("TSS").values() vs.remove_columns(fields) del vs.data["field_information"]["TSS"] vs.update() new_charts = [] for chart in self.data["graph_config"]: if chart['id'].startswith("_tss"): continue new_charts.append(chart) self.data["graph_config"] = new_charts del self.data["find_tss_distances_job_id"] del self.data["find_tss_distances_job_status"] self.update()
def delete_columns(self, columns=[]): vs = ViewSet(self.db, self.get_viewset_id()) vs.remove_columns(columns) self.refresh_data() new_graphs = [] for g in self.data["graph_config"]: param = g.get("param") if param: contains_field = False if isinstance(param, list): for p in param: if p in columns: contains_field = True break else: if param in columns: contains_field = True if contains_field: continue new_graphs.append(g) if len(self.data["graph_config"]) != len(new_graphs): self.data["graph_config"] = new_graphs self.update() history = self.data.get("history") if history: new_history = [] for h in history: if h["id"] in columns: continue new_history.append(h) self.set_data("history", new_history) return self.data["history"]