예제 #1
0
    def compare_good_posi_number(self, Initial, After, IniSeq_buil,
                                 AftSeq_buil):
        IniCou = self.count_good_posi(Initial)
        AftCou = self.count_good_posi(After)
        Align = MegaAlignment()
        CloLs, IniSeq_dic = Align.name2seq(IniSeq_buil)
        CloLs, AftSeq_dic = Align.name2seq(AftSeq_buil)
        ShareIni = Align.GetSharePosi1(IniSeq_dic, 'A')
        ShareAft = Align.GetSharePosi1(AftSeq_dic, 'A')
        print IniCou, AftCou, len(ShareIni), len(ShareAft)
        if IniCou > AftCou or len(ShareAft) > len(ShareIni): AfterGood = 'n'
        else: AfterGood = 'y'

        return AfterGood
    def __init__(self, cluster_information, original_seq, tumor_seq, tsp_list,
                 clone_frequency_cutoff, CNV_info, ReadCountTable):
        self.Tu2Cluster = cluster_information
        self.CNV_info = CNV_info
        self.ReadCountTable = ReadCountTable
        Align = MegaAlignment()
        self.OriAncOrder, self.OriAnc2Seq0 = Align.name2seq(original_seq)
        self.TOrder, self.T2Seq = Align.name2seq(tumor_seq)
        self.SharePosi = Align.GetSharePosi1(self.OriAnc2Seq0, 'T')
        self.all_tsp = tsp_information(tsp_list)
        self.CloFreCutOff = clone_frequency_cutoff
        self.v_obs = self.all_tsp.tumor2alt_frequency()
        identical_seq_list = Align.identify_similar_seq(tumor_seq, 0)
        self.identical_seq = Align.make_similar_seq_dic(identical_seq_list)

        self.freq_cutoff = self.CloFreCutOff