aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/wqflask/my_pylmm/pyLMM/lmm.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py
index 369fcbcc..8de3b3a7 100755
--- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py
+++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py
@@ -45,11 +45,16 @@ import sys
sys.path.append("/home/zas1024/gene/wqflask/")
print("sys.path2:", sys.path)
-from utility.benchmark import Bench
-from utility import temp_data
-
-from wqflask.my_pylmm.pyLMM import chunks
+has_gn2=True
+try:
+ from utility.benchmark import Bench
+ from utility import temp_data
+ from wqflask.my_pylmm.pyLMM import chunks
+except ImportError:
+ print("WARNING: Standalone version\n")
+ has_gn2=False
+ pass
#np.seterr('raise')
@@ -288,6 +293,7 @@ def run_other(pheno_vector,
def matrixMult(A,B):
# If there is no fblas then we will revert to np.dot()
+
try:
linalg.fblas
except AttributeError:
@@ -708,7 +714,7 @@ class LMM:
pl.ylabel("Probability of data")
pl.title(title)
-def main():
+def gn2_main():
parser = argparse.ArgumentParser(description='Run pyLMM')
parser.add_argument('-k', '--key')
parser.add_argument('-s', '--species')
@@ -750,7 +756,10 @@ def main():
Redis.expire(results_key, 60*60)
if __name__ == '__main__':
- main()
+ if has_gn2:
+ gn2_main()
+ else:
+ cli_main()