def secret_new(request): """ New secret view for the new chromosome viewer. This is most probably used for uploading the new images ? """ # fn = db.secret_file("%(name)s%(suffix)s" % request.matchdict) # return FileResponse(fn, request=request) profileName = request.matchdict["profile_name"] chr_num = request.matchdict["chr_num"] file_name = "%(name)s%(suffix)s" % request.matchdict fn = db.secret_file(file_name, chr_num) return FileResponse(fn, request=request)
def secret(request): fn = db.secret_file("%(name)s%(suffix)s" % request.matchdict) return FileResponse(fn, request=request)
# thus we need to check to make sure there are no NaN # logratios, and stop with an error if there are. nan_probes = numpy.isnan(probes["logratio"]).sum() if 0 < nan_probes: return {"error": "%d nan probes on chr%s" % (nan_probes, cname)} r = db.ChromProbes(info["name"], cname) r.put(probes) r = db.Profile(info["name"]) info.update(probeInfo) info["uploader"] = userid info["uploaded_on"] = datetime.now() info["ready"] = False r.put(info) # save gz profile to disk. f.seek(0) out_name = db.secret_file("%(name)s.bedGraph.gz" % info) saved = gzip.open(out_name, "w") for data in f: saved.write(data) saved.close() # add profile to user lists. uprofs = [db.UserProfiles(u) for u in db_users] to_update = [r for r in uprofs if r.compatible(info)] for r in to_update: r.add(info["name"]) # add profile to processing queue. db.ProfileQueue.db.append(info["name"]) # need to return error none to avoid template nameError. info["error"] = None return info