From 511b0bc7875e24574da60d549a9b37d4deba56b3 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 23 May 2012 14:34:27 -0500 Subject: Update web/webqtl/correlation/CorrelationPage.py --- web/webqtl/correlation/CorrelationPage.py | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/web/webqtl/correlation/CorrelationPage.py b/web/webqtl/correlation/CorrelationPage.py index 42059117..ce8b8165 100755 --- a/web/webqtl/correlation/CorrelationPage.py +++ b/web/webqtl/correlation/CorrelationPage.py @@ -1,4 +1,4 @@ -# Copyright (C) University of Tennessee Health Science Center, Memphis, TN. +## Copyright (C) University of Tennessee Health Science Center, Memphis, TN. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License @@ -54,9 +54,6 @@ import logging logging.basicConfig(filename="/tmp/gn_log", level=logging.INFO) _log = logging.getLogger("correlation") -debug_file = open("/home/zas1024/gn/web/corr_debug.txt","w") -debug_file2 = open("/home/zas1024/gn/web/corr_debug2.txt","w") - METHOD_SAMPLE_PEARSON = "1" METHOD_SAMPLE_RANK = "2" METHOD_LIT = "3" @@ -222,38 +219,16 @@ def get_species(fd, cursor): def sortTraitCorrelations(traits, method="1"): - for trait in traits: - if trait.lit_corr != None and float(trait.lit_corr) > 0.6: - debug_file.write(str(trait.lit_corr) + "\n") if method in TISSUE_METHODS: - #traits.sort(key=lambda trait: trait.tissue_corr != None and abs(float(trait.tissue_corr)) or 0) traits.sort(key=lambda trait: trait.tissue_corr != None and abs(trait.tissue_corr), reverse=True) elif method == METHOD_LIT: - #traits.sort(key=lambda trait: trait.lit_corr != None and abs(float(trait.lit_corr)) or 0) traits.sort(key=lambda trait: trait.lit_corr != None and abs(trait.lit_corr), reverse=True) else: - #traits.sort(key=lambda trait: trait.correlation != None and abs(float(trait.correlation)) or 0) traits.sort(key=lambda trait: trait.correlation != None and abs(trait.correlation), reverse=True) - for trait in traits: - if trait.lit_corr != None and float(trait.lit_corr) > 0.6: - debug_file2.write(str(trait.lit_corr) + "\n") - return traits - -def cmpTraitCorr(A,B): - try: - if abs(A.correlation) < abs(B.correlation): - return 1 - elif abs(A.correlation) == abs(B.correlation): - return 0 - else: - return -1 - except: - return 0 - def auth_user_for_db(db, cursor, target_db_name, privilege, username): """Authorize a user for access to a database if that database is confidential. A db (identified by a record in ProbeSetFreeze) contains a -- cgit v1.2.3