def set_final_cyst_tryp_positions(self, debug=False, total_length_from_right=-1): """ Set tryp position in the final, combined sequence. """ self.final_cyst_position = self.local_cyst_position - self.effective_erosions[ 'v_5p'] self.final_tryp_position = utils.find_tryp_in_joined_seq( self.local_tryp_position, self.eroded_seqs['v'], self.insertions['vd'], self.eroded_seqs['d'], self.insertions['dj'], self.eroded_seqs['j'], self.erosions['j_5p']) if debug: print ' final tryptophan position: %d' % self.final_tryp_position # make sure cdr3 length matches the desired length in vdj_combo_label final_cdr3_length = self.final_tryp_position - self.final_cyst_position + 3 if debug: print ' final_tryp_position - final_cyst_position + 3 = %d - %d + 3 = %d (should be %d)' % ( self.final_tryp_position, self.final_cyst_position, final_cdr3_length, self.cdr3_length) utils.check_both_conserved_codons( self.eroded_seqs['v'] + self.insertions['vd'] + self.eroded_seqs['d'] + self.insertions['dj'] + self.eroded_seqs['j'], self.final_cyst_position, self.final_tryp_position) assert final_cdr3_length == int(self.cdr3_length) assert total_length_from_right == -1 # deprecated (I think) now that I'm adding the mimic_data_read_length option
def set_final_cyst_tryp_positions(self, debug=False): """ Set tryp position in the final, combined sequence. """ self.final_cyst_position = self.local_cyst_position - self.effective_erosions['v_5p'] self.final_tryp_position = utils.find_tryp_in_joined_seq(self.local_tryp_position, self.eroded_seqs['v'], self.insertions['vd'], self.eroded_seqs['d'], self.insertions['dj'], self.eroded_seqs['j'], self.erosions['j_5p']) if debug: print ' final tryptophan position: %d' % self.final_tryp_position # make sure cdr3 length matches the desired length in vdj_combo_label final_cdr3_length = self.final_tryp_position - self.final_cyst_position + 3 if debug: print ' final_tryp_position - final_cyst_position + 3 = %d - %d + 3 = %d (should be %d)' % (self.final_tryp_position, self.final_cyst_position, final_cdr3_length, self.cdr3_length) utils.check_both_conserved_codons(self.eroded_seqs['v'] + self.insertions['vd'] + self.eroded_seqs['d'] + self.insertions['dj'] + self.eroded_seqs['j'], self.final_cyst_position, self.final_tryp_position) assert final_cdr3_length == int(self.cdr3_length)
def set_final_cyst_tryp_positions(self, debug=False, total_length_from_right=-1): """ Set tryp position in the final, combined sequence. """ self.final_cyst_position = self.local_cyst_position - self.effective_erosions["v_5p"] self.final_tryp_position = utils.find_tryp_in_joined_seq( self.local_tryp_position, self.eroded_seqs["v"], self.insertions["vd"], self.eroded_seqs["d"], self.insertions["dj"], self.eroded_seqs["j"], self.erosions["j_5p"], ) if debug: print " final tryptophan position: %d" % self.final_tryp_position # make sure cdr3 length matches the desired length in vdj_combo_label final_cdr3_length = self.final_tryp_position - self.final_cyst_position + 3 if debug: print " final_tryp_position - final_cyst_position + 3 = %d - %d + 3 = %d (should be %d)" % ( self.final_tryp_position, self.final_cyst_position, final_cdr3_length, self.cdr3_length, ) utils.check_both_conserved_codons( self.eroded_seqs["v"] + self.insertions["vd"] + self.eroded_seqs["d"] + self.insertions["dj"] + self.eroded_seqs["j"], self.final_cyst_position, self.final_tryp_position, ) assert final_cdr3_length == int(self.cdr3_length) assert ( total_length_from_right == -1 ) # deprecated (I think) now that I'm adding the mimic_data_read_length option