Esempio n. 1
0
	def KWOnBooleanSNP(cls, snp1_id, gene1_id, genotype_ls1, snp2_id, gene2_id, genotype_ls2, phenotype_index, phenotype_ls, \
					min_data_point=3):
		"""
		2009-2-8
			refactor out of computing_node_handler()
			kruskal wallis on a boolean-merged SNP
		"""
		return_ls = []
		for bool_type in bool_type2merge_oper:
			merge_oper_matrix = bool_type2merge_oper[bool_type]
			genotype_ls = cls.mergeTwoGenotypeLs(genotype_ls1, genotype_ls2, merge_oper_matrix)
			pdata = Kruskal_Wallis._kruskal_wallis(genotype_ls, phenotype_ls, min_data_point)
			if pdata:
				pdata = PassingData(snp1_id=snp1_id, gene1_id=gene1_id, snp2_id=snp2_id, gene2_id=gene2_id, pvalue=pdata.pvalue,\
								count1=pdata.count_ls[0], count2=pdata.count_ls[1], bool_type=bool_type, phenotype_index=phenotype_index)
				return_ls.append(pdata)
		return return_ls
Esempio n. 2
0
    def KWOnBooleanSNP(cls, snp1_id, gene1_id, genotype_ls1, snp2_id, gene2_id, genotype_ls2, phenotype_index, phenotype_ls, \
        min_data_point=3):
        """
		2009-2-8
			refactor out of computing_node_handler()
			kruskal wallis on a boolean-merged SNP
		"""
        return_ls = []
        for bool_type in bool_type2merge_oper:
            merge_oper_matrix = bool_type2merge_oper[bool_type]
            genotype_ls = cls.mergeTwoGenotypeLs(genotype_ls1, genotype_ls2,
                                                 merge_oper_matrix)
            pdata = Kruskal_Wallis._kruskal_wallis(genotype_ls, phenotype_ls,
                                                   min_data_point)
            if pdata:
                pdata = PassingData(snp1_id=snp1_id, gene1_id=gene1_id, snp2_id=snp2_id, gene2_id=gene2_id, pvalue=pdata.pvalue,\
                    count1=pdata.count_ls[0], count2=pdata.count_ls[1], bool_type=bool_type, phenotype_index=phenotype_index)
                return_ls.append(pdata)
        return return_ls