def renderIndexSummary(form): # default return values reference = None refSortedIndexRecords = None marker = None template = "gxdindex_summary" # gather index records from the DB indexRecords = form.queryIndexRecords() # check for truncation by default limits resultsTruncated = form.index_limit.data and \ (len(indexRecords) >= form.index_limit.data) # generate age/assay count table countSummary = gxdindex_aggregator.aggregateGenesByAssayAndStage(indexRecords) # send to lit-index by reference, if passed a ref ID if form.refs_id.data: reference = reference_service.get_by_jnum_id(form.refs_id.data) template = "gxdindex_summary_by_ref" # send to lit-index by marker, if passed a marker ID if form.marker_id.data: # re-order indexRecords - this page has specific sort indexRecords.sort(key=lambda r: r.reference.short_citation) marker = marker_hunter.getMarkerByMGIID(form.marker_id.data) template = "gxdindex_summary_by_marker" # send to lit-index by age / assay, if passed age and assay_type if form.age.data and form.assay_type.data: template = "gxdindex_summary_by_age_assay" return render_template("summary/gxdindex/%s.html" % template, indexRecords=indexRecords, resultsTruncated=resultsTruncated, countSummary=countSummary, reference=reference, marker=marker, form=form, queryString=form.argString())
def markerDetailById(id): marker = marker_hunter.getMarkerByMGIID(id) if marker: return renderMarkerDetail(marker) return error_template('No marker found for ID = %s' % id)