Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
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)
Пример #6
0
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)
Пример #7
0
def assayDetailById(id):
    assay = gxd_assay_hunter.getAssayByMGIID(id)
    if assay:
        return renderAssayDetail(assay)
    
    return error_template('No assay found for ID = %s' % id)
Пример #8
0
def voctermDetailById(id):
    vocterm = vocterm_hunter.getVocTermByPrimaryID(id)
    if vocterm:
        return renderVocTermDetail(vocterm)
    
    return error_template('No VocTerm found for primary ID = %s' % id)
Пример #9
0
def voctermDetailByKey(key):
    vocterm = vocterm_hunter.getVocTermByKey(key)
    if vocterm:
        return renderVocTermDetail(vocterm)

    return error_template('No VocTerm found for _term_key = %d' % key)
Пример #10
0
def probeDetailById(id):
    probe = probe_hunter.getProbeByMGIID(id)
    if probe:
        return renderProbeDetail(probe)

    return error_template('No probe found for ID = %s' % id)
Пример #11
0
def markerDetailByKey(key):
    marker = marker_hunter.getMarkerByKey(key)
    if marker:
        return renderMarkerDetail(marker)

    return error_template('No marker found for _marker_key = %d' % key)
Пример #12
0
def alleleDetailByKey(key):
    allele = allele_hunter.getAlleleByKey(key)
    if allele:
        return renderAlleleDetail(allele)
    return error_template('No allele found for _allele_key = %d' % key)
Пример #13
0
def markerDetailById(id):
    marker = marker_hunter.getMarkerByMGIID(id)
    if marker:
        return renderMarkerDetail(marker)
    
    return error_template('No marker found for ID = %s' % id)
Пример #14
0
def experimentDetailById(id):
    experiment = experiment_hunter.getExperimentByMGIID(id)
    if experiment:
        return renderExperimentDetail(experiment)

    return error_template('No experiment found for ID = %s' % id)
Пример #15
0
def experimentDetailByKey(key):
    experiment = experiment_hunter.getExperimentByKey(key)
    if experiment:
        return renderExperimentDetail(experiment)

    return error_template('No experiment found for _experiment_key = %d' % key)
Пример #16
0
def probeDetailByKey(key):
    probe = probe_hunter.getProbeByKey(key)
    if probe:
        return renderProbeDetail(probe)

    return error_template('No probe found for _probe_key = %d' % key)
Пример #17
0
def probeDetailById(id):
    probe = probe_hunter.getProbeByMGIID(id)
    if probe:
        return renderProbeDetail(probe)
    
    return error_template('No probe found for ID = %s' % id)
Пример #18
0
def voctermDetailById(id):
    vocterm = vocterm_hunter.getVocTermByPrimaryID(id)
    if vocterm:
        return renderVocTermDetail(vocterm)
    
    return error_template('No VocTerm found for primary ID = %s' % id)
Пример #19
0
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)
Пример #20
0
def alleleDetailById(id):
    allele = allele_hunter.getAlleleByMGIID(id)
    if allele:
        return renderAlleleDetail(allele)

    return error_template('No allele found for ID = %s' % id)
Пример #21
0
def markerDetailByKey(key):
    marker = marker_hunter.getMarkerByKey(key)
    if marker:
        return renderMarkerDetail(marker)

    return error_template('No marker found for _marker_key = %d' % key)
Пример #22
0
def experimentDetailById(id):
    experiment = experiment_hunter.getExperimentByMGIID(id)
    if experiment:
        return renderExperimentDetail(experiment)
    
    return error_template('No experiment found for ID = %s' % id)
Пример #23
0
def probeDetailByKey(key):
    probe = probe_hunter.getProbeByKey(key)
    if probe:
        return renderProbeDetail(probe)

    return error_template('No probe found for _probe_key = %d' % key)
Пример #24
0
def alleleDetailById(id):
    allele = allele_hunter.getAlleleByMGIID(id)
    if allele:
        return renderAlleleDetail(allele)
    
    return error_template('No allele found for ID = %s' % id)
Пример #25
0
def markerDetailById(id):
    marker = marker_hunter.getMarkerByMGIID(id)
    if marker:
        return renderMarkerDetail(marker)

    return error_template('No marker found for ID = %s' % id)
Пример #26
0
def antibodyDetailByKey(key):
    antibody = antibody_hunter.getAntibodyByKey(key)
    if antibody:
        return renderAntibodyDetail(antibody)

    return error_template('No antibody found for _antibody_key = %d' % key)
Пример #27
0
def voctermDetailByKey(key):
    vocterm = vocterm_hunter.getVocTermByKey(key)
    if vocterm:
        return renderVocTermDetail(vocterm)

    return error_template('No VocTerm found for _term_key = %d' % key)
Пример #28
0
def antibodyDetailByKey(key):
    antibody = antibody_hunter.getAntibodyByKey(key)
    if antibody:
        return renderAntibodyDetail(antibody)

    return error_template('No antibody found for _antibody_key = %d' % key)
Пример #29
0
def alleleDetailByKey(key):
    allele = allele_hunter.getAlleleByKey(key)
    if allele:
        return renderAlleleDetail(allele)
    return error_template('No allele found for _allele_key = %d' % key)
Пример #30
0
def experimentDetailByKey(key):
    experiment = experiment_hunter.getExperimentByKey(key)
    if experiment:
        return renderExperimentDetail(experiment)

    return error_template('No experiment found for _experiment_key = %d' % key)
Пример #31
0
def antibodyDetailById(id):
    antibody = antibody_hunter.getAntibodyByMGIID(id)
    if antibody:
        return renderAntibodyDetail(antibody)
    
    return error_template('No antibody found for ID = %s' % id)
Пример #32
0
def antibodyDetailById(id):
    antibody = antibody_hunter.getAntibodyByMGIID(id)
    if antibody:
        return renderAntibodyDetail(antibody)
    
    return error_template('No antibody found for ID = %s' % id)