def imageDetailByKey(key): image = image_hunter.getImageByKey(key) if image: return renderImageDetail(image) #return renderImageDetail() return error_template('No image found for key= %s' % key)
def imageDetailById(id): image = image_hunter.getImageByMGIID(id) if image: return renderImageDetail(image) #return renderImageDetail() return error_template('No image found for ID = %s' % id)
def genotypeDetailById(genotypeId): """ Same as all genotype summary for Allele, but renders only the one genotype """ genotype = genotype_hunter.getGenotypeByMGIID(genotypeId) if genotype: return renderGenotypeDetailForGenotype(genotype) return error_template('No genotype found for ID = %s' % genotypeId)
def renderAccessionIDSearch(ids): global ACC_TYPE_MAP accessionObj = None # Try object retrieval with mapped mgitype keys first accessionObjList = accession_hunter.getAccessionByAccID( ids, inMGITypeKeys=list(ACC_TYPE_MAP.keys())) # try marker symbols too accessionObjList.extend(accession_hunter.getAccessionByMarkerSymbol(ids)) app.logger.debug("found %s accession objects: %s" \ % (len(accessionObjList), [r.accid for r in accessionObjList])) # If multiple accession objects, send to summary if len(accessionObjList) > 1: return render_template("summary/accession/accession_summary.html", ids=ids, typemap=ACC_TYPE_MAP, accessionObjList=accessionObjList) # If single accession object, forward to detail page of object if len(accessionObjList) == 1: accessionObj = accessionObjList[0] objectType = ACC_TYPE_MAP[accessionObj._mgitype_key] newUrl = getURLForObject(accessionObj, objectType) return redirect(newUrl) # If we made it this far, and no accession object was found, we # try again without mapped mgitype keys as a filter accessionObjList = accession_hunter.getAccessionByAccID(ids) if len(accessionObjList) > 0: tabletype = '%s(%s)' % (accessionObj.mgitype.name, accessionObj.mgitype.tablename) return error_template('Found %s object with ID = %s, ' 'but no link URL has been defined.' % (tabletype, id)) # if still have no accession object, return default error page return error_template('No accession object found for ID = %s' % ids)
def renderAccessionIDSearch(ids): global ACC_TYPE_MAP accessionObj = None # Try object retrieval with mapped mgitype keys first accessionObjList = accession_hunter.getAccessionByAccID(ids, inMGITypeKeys=ACC_TYPE_MAP.keys()) # try marker symbols too accessionObjList.extend(accession_hunter.getAccessionByMarkerSymbol(ids)) app.logger.debug("found %s accession objects: %s" % (len(accessionObjList), [r.accid for r in accessionObjList])) # If multiple accession objects, send to summary if len(accessionObjList) > 1: return render_template( "summary/accession/accession_summary.html", ids=ids, typemap=ACC_TYPE_MAP, accessionObjList=accessionObjList ) # If single accession object, forward to detail page of object if len(accessionObjList) == 1: accessionObj = accessionObjList[0] objectType = ACC_TYPE_MAP[accessionObj._mgitype_key] newUrl = getURLForObject(accessionObj, objectType) return redirect(newUrl) # If we made it this far, and no accession object was found, we # try again without mapped mgitype keys as a filter accessionObjList = accession_hunter.getAccessionByAccID(ids) if len(accessionObjList) > 0: tabletype = "%s(%s)" % (accessionObj.mgitype.name, accessionObj.mgitype.tablename) return error_template("Found %s object with ID = %s, " "but no link URL has been defined." % (tabletype, id)) # if still have no accession object, return default error page return error_template("No accession object found for ID = %s" % ids)
def assayDetailById(id): assay = gxd_assay_hunter.getAssayByMGIID(id) if assay: return renderAssayDetail(assay) return error_template('No assay found for ID = %s' % id)
def voctermDetailById(id): vocterm = vocterm_hunter.getVocTermByPrimaryID(id) if vocterm: return renderVocTermDetail(vocterm) return error_template('No VocTerm found for primary ID = %s' % id)
def voctermDetailByKey(key): vocterm = vocterm_hunter.getVocTermByKey(key) if vocterm: return renderVocTermDetail(vocterm) return error_template('No VocTerm found for _term_key = %d' % key)
def probeDetailById(id): probe = probe_hunter.getProbeByMGIID(id) if probe: return renderProbeDetail(probe) return error_template('No probe found for ID = %s' % id)
def markerDetailByKey(key): marker = marker_hunter.getMarkerByKey(key) if marker: return renderMarkerDetail(marker) return error_template('No marker found for _marker_key = %d' % key)
def alleleDetailByKey(key): allele = allele_hunter.getAlleleByKey(key) if allele: return renderAlleleDetail(allele) return error_template('No allele found for _allele_key = %d' % key)
def markerDetailById(id): marker = marker_hunter.getMarkerByMGIID(id) if marker: return renderMarkerDetail(marker) return error_template('No marker found for ID = %s' % id)
def experimentDetailById(id): experiment = experiment_hunter.getExperimentByMGIID(id) if experiment: return renderExperimentDetail(experiment) return error_template('No experiment found for ID = %s' % id)
def experimentDetailByKey(key): experiment = experiment_hunter.getExperimentByKey(key) if experiment: return renderExperimentDetail(experiment) return error_template('No experiment found for _experiment_key = %d' % key)
def probeDetailByKey(key): probe = probe_hunter.getProbeByKey(key) if probe: return renderProbeDetail(probe) return error_template('No probe found for _probe_key = %d' % key)
def assayrDetailByKey(key): assay = gxd_assay_hunter.getAssayByKey(key) if assay: return renderAssayDetail(assay) return error_template('No assay found for _assay_key = %d' % key)
def alleleDetailById(id): allele = allele_hunter.getAlleleByMGIID(id) if allele: return renderAlleleDetail(allele) return error_template('No allele found for ID = %s' % id)
def antibodyDetailByKey(key): antibody = antibody_hunter.getAntibodyByKey(key) if antibody: return renderAntibodyDetail(antibody) return error_template('No antibody found for _antibody_key = %d' % key)
def antibodyDetailById(id): antibody = antibody_hunter.getAntibodyByMGIID(id) if antibody: return renderAntibodyDetail(antibody) return error_template('No antibody found for ID = %s' % id)