示例#1
0
 def getVariantSet(self, id_):
     """
     Returns the VariantSet with the specified name, or raises a
     VariantSetNotFoundException otherwise.
     """
     if id_ not in self._variantSetIdMap:
         raise exceptions.VariantSetNotFoundException(id_)
     return self._variantSetIdMap[id_]
示例#2
0
文件: backend.py 项目: afirth/server
def _getVariantSet(request, variantSetIdMap):
    if len(request.variantSetIds) != 1:
        if len(request.variantSetIds) == 0:
            msg = "Variant search requires specifying a variantSet"
        else:
            msg = ("Variant search over multiple variantSets "
                   "not supported")
        raise exceptions.NotImplementedException(msg)
    variantSetId = request.variantSetIds[0]
    try:
        variantSet = variantSetIdMap[variantSetId]
    except KeyError:
        raise exceptions.VariantSetNotFoundException(variantSetId)
    return variantSet