diff options
Diffstat (limited to 'wqflask/wqflask/my_pylmm/pyLMM/runlmm.py')
-rw-r--r-- | wqflask/wqflask/my_pylmm/pyLMM/runlmm.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py index df86f718..4a640d6d 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py @@ -17,4 +17,53 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +from optparse import OptionParser +import sys +import os +import numpy as np +# from lmm import LMM, run_other +import csv + +usage = """ +python runlmm.py [options] command + + runlmm.py processing multiplexer reads standard input types and calls the routines + + Current commands are: + + parse : only parse input files + + try --help for more information +""" + +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") +parser.add_option("-q", "--quiet", + action="store_false", dest="verbose", default=True, + help="don't print status messages to stdout") + +(options, args) = parser.parse_args() + +if len(args) != 1: + print usage + sys.exit(1) + +cmd = args[0] +print "Command: ",cmd + +if options.kinship: + K1 = [] + print options.kinship + with open(options.kinship,'r') as tsvin: + assert(tsvin.readline().strip() == "# Kinship format version 1.0") + tsvin.readline() + tsvin.readline() + tsv = csv.reader(tsvin, delimiter='\t') + for row in tsv: + ns = np.genfromtxt(row[1:]) + K1.append(ns) # <--- slow + K = np.array(K1) |