예제 #1
0
 def get(self, hla_allotype_input):
     """
     returns leader-peptide allotype(s) of HLA-B allele(s)log fie
     """
     try:
         hla_allotypes = [allo.strip() for allo in list(set(hla_allotype_input.split(',')))]
         results = []
         mapper = LeaderMapper()
         for hla_allotype in hla_allotypes:
             results.append(mapper.get_leader_allotype_info(hla_allotype))
         return jsonify(results)
     except Exception as e:
         return e.__dict__, 500
def step_impl(context):
    mapper = LeaderMapper()
    leader_info = mapper.get_leader_allotype_info(context.allotype)

    context.leader_allotype = leader_info['common_leader']

    known = leader_info['known'] or []
    context.known = (", ".join(known[0:3]) or "None")

    context.exceptions = (leader_info['exceptions'] and ", ".join(
        [str(allotype) for allotype in leader_info['exceptions']]) or "None")

    context.unknowns = (leader_info['unknowns'] and ", ".join(
        [str(allotype) for allotype in leader_info['unknowns'][:3]]) or "None")
예제 #3
0
def step_impl(context):
    mapper = LeaderMapper()
    leader_info = mapper.get_leader_allotype_info(context.allotype)

    context.leader_allotype = leader_info["common_leader"]

    known = leader_info["known"] or []
    context.known = ", ".join(known[0:3]) or "None"

    context.exceptions = (
        leader_info["exceptions"]
        and ", ".join([str(allotype) for allotype in leader_info["exceptions"]])
        or "None"
    )

    context.unknowns = (
        leader_info["unknowns"]
        and ", ".join([str(allotype) for allotype in leader_info["unknowns"][:3]])
        or "None"
    )