From 24b44a2de4fb47c2ed6a6a3def3acce1c06bebf4 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 14 Mar 2015 15:26:07 +0300 Subject: Conditional run of K calculation --- wqflask/wqflask/my_pylmm/pyLMM/kinship.py | 2 +- wqflask/wqflask/my_pylmm/pyLMM/runlmm.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/my_pylmm/pyLMM/kinship.py b/wqflask/wqflask/my_pylmm/pyLMM/kinship.py index c1750e1d..1dca1c57 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/kinship.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/kinship.py @@ -59,7 +59,7 @@ def compute_matrixMult(job,W,q = None): def f_init(q): compute_matrixMult.q = q -def kinship_full(G,options): +def kinship_full(G): print G.shape m = G.shape[0] # snps n = G.shape[1] # inds diff --git a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py index 21d9240b..26485136 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py @@ -139,20 +139,21 @@ elif cmd == 'kinship': print "MAF replacements: \n",G if not options.skip_genotype_normalization: G = np.apply_along_axis( genotype.normalize, axis=1, arr=G) - - K = kinship_full(G,options) - print "Genotype",G.shape, "\n", G - print "first Kinship method",K.shape,"\n",K - K2 = calculate_kinship(np.copy(G.T),temp_data=None) - print "Genotype",G.shape, "\n", G - print "GN2 Kinship method",K2.shape,"\n",K2 + if True: + K = kinship_full(G) + print "Genotype",G.shape, "\n", G + print "first Kinship method",K.shape,"\n",K + k1 = round(K[0][0],4) + K2 = calculate_kinship(np.copy(G.T),temp_data=None) + print "Genotype",G.shape, "\n", G + print "GN2 Kinship method",K2.shape,"\n",K2 + k2 = round(K2[0][0],4) + print "Genotype",G.shape, "\n", G K3 = kinship(np.copy(G),options) print "third Kinship method",K3.shape,"\n",K3 sys.stderr.write(options.geno+"\n") - k1 = round(K[0][0],4) - k2 = round(K2[0][0],4) k3 = round(K3[0][0],4) if options.geno == 'data/small.geno': assert k1==0.7939, "k1=%f" % k1 -- cgit v1.2.3