def get_recomb_stats_splitweight0(clones): # in case of unambiguous calls, split the weight model = RecombModel() for clone in clones: # V vsize = 1.0 / len(clone.vgenes) for v in clone.vgenes: model.update_attr('v', v, vsize) model.update_attr2('v2del', clone.vgenes[0], clone.vdel, vsize) # J jsize = 1.0 / len(clone.jgenes) for j in clone.jgenes: model.update_attr('j', j, jsize) model.update_attr2('j2del', clone.jgenes[0], clone.jdel, jsize) # D dsize = 1.0 / len(clone.dgenes) for d in clone.dgenes: model.update_attr('d', d, dsize) model.update_attr2('d2del', clone.dgenes[0], (clone.d5del, clone.d3del), dsize) # DJ numdj = len(clone.jgenes) * len(clone.dgenes) djsize = 1.0 / numdj for d in clone.dgenes: for j in clone.jgenes: model.update_attr('dj', (d, j), djsize) # Insertion length ins_vd = clone.firstdpos - clone.lastvpos - 1 model.update_attr('ins_vd', ins_vd, vsize) ins_dj = clone.firstjpos - clone.lastdpos - 1 model.update_attr('ins_dj', ins_dj, jsize) # inserted nt given 5' nt vd_nts = clone.nuc[clone.lastvpos: clone.firstdpos] # include the lastV model.update_vd2next(vd_nts, vsize) dj_nts = clone.nuc[clone.lastdpos + 1: clone.firstjpos + 1] # include lastJ model.update_dj2prev(dj_nts, jsize) return model
def get_recomb_stats_splitweight(clones): # in case of unambiguous calls, split the weight model = RecombModel() for clone in clones: # V model.update_attr('v', clone.v, 1.0) model.update_attr2('v2del', clone.v, clone.vdel, 1.0) # J model.update_attr('j', clone.j, 1.0) model.update_attr2('j2del', clone.j, clone.jdel, 1.0) # D model.update_attr('d', clone.d, 1.0) model.update_attr2('d2del', clone.d, (clone.d5del, clone.d3del), 1.0) # DJ model.update_attr('dj', (clone.d, clone.j), 1.0) # Insertion length ins_vd = len(clone.vdins) - 1 model.update_attr('ins_vd', ins_vd, 1.0) ins_dj = len(clone.djins) - 1 model.update_attr('ins_dj', ins_dj, 1.0) # inserted nt given 5' nt model.update_vd2next(clone.vdins, 1.0) model.update_dj2prev(clone.djins, 1.0) return model
def get_recomb_stats0(clones): # in case of unambiguous calls, just record the first call model = RecombModel() for clone in clones: # V model.update_attr('v', clone.vgenes[0], 1) model.update_attr2('v2del', clone.vgenes[0], clone.vdel, 1) # J model.update_attr('j', clone.jgenes[0], 1) model.update_attr2('j2del', clone.jgenes[0], clone.jdel, 1) # D model.update_attr('d', clone.dgenes[0], 1) model.update_attr2('d2del', clone.dgenes[0], (clone.d5del, clone.d3del), 1) # DJ model.update_attr('dj', (clone.dgenes[0], clone.jgenes[0]), 1) # Insertion length ins_vd = clone.firstdpos - clone.lastvpos - 1 model.update_attr('ins_vd', ins_vd, 1) ins_dj = clone.firstjpos - clone.lastdpos - 1 model.update_attr('ins_dj', ins_dj, 1) # inserted nt given 5' nt vd_nts = clone.nuc[clone.lastvpos: clone.firstdpos] # include the lastV model.update_vd2next(vd_nts, 1) dj_nts = clone.nuc[clone.lastdpos + 1: clone.firstjpos + 1] # include lastJ model.update_dj2prev(dj_nts, 1) return model
def get_recomb_stats(clones): # in case of unambiguous calls, just record the first call model = RecombModel() for clone in clones: # V model.update_attr('v', clone.v, 1) model.update_attr2('v2del', clone.v, clone.vdel, 1) # J model.update_attr('j', clone.j, 1) model.update_attr2('j2del', clone.j, clone.jdel, 1) # D model.update_attr('d', clone.d, 1) model.update_attr2('d2del', clone.d, (clone.d5del, clone.d3del), 1) # DJ model.update_attr('dj', (clone.d, clone.j), 1) # Insertion length ins_vd = len(clone.vdins) - 1 model.update_attr('ins_vd', ins_vd, 1) ins_dj = len(clone.djins) - 1 model.update_attr('ins_dj', ins_dj, 1) # inserted nt given 5' nt model.update_vd2next(clone.vdins, 1) # include the lastV model.update_dj2prev(clone.djins, 1) # include the fistJ return model