def get(self, hla_genotype_input): """ returns leader-peptide allotype(s) of HLA-B allele(s) """ try: hla_genotypes = [geno.strip() for geno in list(set(hla_genotype_input.split(',')))] results = [] mapper = LeaderMapper() for hla_genotype in hla_genotypes: results.append(mapper.get_leader_genotype_info(hla_genotype)) return jsonify(results) except Exception as e: return e.__dict__, 500
def step_impl(context): mapper = LeaderMapper() leader_info = mapper.get_leader_genotype_info(context.genotype) context.leader_genotype = str( leader_info["hla-b_allotype_one"]["common_leader"]) + str( leader_info["hla-b_allotype_two"]["common_leader"])