From 9485cbbad2596b3105ad995e15ac3cb3dca6615d Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 9 Mar 2015 08:43:12 +0300 Subject: Parse new phenotype format --- wqflask/wqflask/my_pylmm/pyLMM/runlmm.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py index 4a640d6d..27afd6f4 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py @@ -41,7 +41,9 @@ parser = OptionParser(usage=usage) # parser.add_option("-f", "--file", dest="input file", # help="In", metavar="FILE") parser.add_option("--kinship",dest="kinship", - help="Kinship file format") + help="Kinship file format 1.0") +parser.add_option("--pheno",dest="pheno", + help="Phenotype file format 1.0") parser.add_option("-q", "--quiet", action="store_false", dest="verbose", default=True, help="don't print status messages to stdout") @@ -67,3 +69,19 @@ if options.kinship: ns = np.genfromtxt(row[1:]) K1.append(ns) # <--- slow K = np.array(K1) + +if options.pheno: + Y1 = [] + print options.pheno + with open(options.pheno,'r') as tsvin: + assert(tsvin.readline().strip() == "# Phenotype format version 1.0") + tsvin.readline() + tsvin.readline() + tsvin.readline() + tsv = csv.reader(tsvin, delimiter='\t') + for row in tsv: + ns = np.genfromtxt(row[1:]) + Y1.append(ns) # <--- slow + Y = np.array(Y1) + +print Y -- cgit 1.4.1