def remove_zero_copynumbers(gtype):
'''
remove any clonal or subclonal copy-numbers
where the total copy-number is zero
'''
if gtype=='': return ''
gtype_tmp = map(methodcaller('split',','),gtype.split('|'))
if len(gtype_tmp)==1:
gt = map(float, gtype_tmp[0])
if (gt[0]==0 and gt[1]==0) or gt[0] < 0 or gt[1] < 0:
gtype = ''
# else:
# new_gtype = []
# for gt in gtype_tmp:
# gt = map(float,gt)
# if (gt[0]!=0 or gt[1]!=0):
# new_gtype.append(gt)
# if len(new_gtype) > 0:
# new_gtype = [map(str,g) for g in new_gtype]
# gtype = '|'.join([','.join(g) for g in new_gtype])
# else:
# gtype = ''
return gtype
评论列表
文章目录