def extractdrug(cat):
split = cat.split('')
if len(split) == 2:
return split[-1]
return '_'.join(split[1:]) # bug here in original code split[1:-1]
if left the way it is, eval_category of VCAP_assinex_D328 would be truncated to assinex, which would not match the condition of assinex_D328. Same for other examples like HDACi1,2 + 3_mix and TUL_XIX003
def extractdrug(cat): split = cat.split('') if len(split) == 2: return split[-1] return '_'.join(split[1:]) # bug here in original code split[1:-1]
if left the way it is, eval_category of VCAP_assinex_D328 would be truncated to assinex, which would not match the condition of assinex_D328. Same for other examples like HDACi1,2 + 3_mix and TUL_XIX003