aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/db/webqtlDatabaseFunction.py8
-rw-r--r--wqflask/wqflask/do_search.py28
-rw-r--r--wqflask/wqflask/views.py1
3 files changed, 1 insertions, 36 deletions
diff --git a/wqflask/db/webqtlDatabaseFunction.py b/wqflask/db/webqtlDatabaseFunction.py
index ba998e91..8a9dc79d 100644
--- a/wqflask/db/webqtlDatabaseFunction.py
+++ b/wqflask/db/webqtlDatabaseFunction.py
@@ -30,14 +30,6 @@ logger = getLogger(__name__ )
#output: cursor instance
#function: connect to database and return cursor instance
###########################################################################
-def getCursor():
- try:
- logger.warning("Creating new MySQLdb cursor (this method is OBSOLETE!)")
- con = MySQLdb.Connect(db=webqtlConfig.DB_NAME, host=webqtlConfig.MYSQL_SERVER, user=webqtlConfig.DB_USER, passwd=webqtlConfig.DB_PASSWD)
- cursor = con.cursor()
- return cursor
- except:
- return None
def retrieve_species(group):
"""Get the species of a group (e.g. returns string "mouse" on "BXD"
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index e2a0a479..c7dbc972 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -872,32 +872,6 @@ if __name__ == "__main__":
dataset_name = "HC_M2_0606_P"
dataset = create_dataset(db_conn, dataset_name)
- #cursor.execute("""
- # SELECT ProbeSet.Name as TNAME, 0 as thistable,
- # ProbeSetXRef.Mean as TMEAN, ProbeSetXRef.LRS as TLRS,
- # ProbeSetXRef.PVALUE as TPVALUE, ProbeSet.Chr_num as TCHR_NUM,
- # ProbeSet.Mb as TMB, ProbeSet.Symbol as TSYMBOL,
- # ProbeSet.name_num as TNAME_NUM
- # FROM ProbeSetXRef, ProbeSet, Geno
- # WHERE ProbeSetXRef.LRS > 99.0 and
- # ABS(ProbeSet.Mb-Geno.Mb) < 5 and
- # ProbeSetXRef.Locus = Geno.name and
- # Geno.SpeciesId = 1 and
- # ProbeSet.Chr = Geno.Chr and
- # ProbeSet.Id = ProbeSetXRef.ProbeSetId and
- # ProbeSetXRef.ProbeSetFreezeId = 112""")
-
- #logger.debug(pf(cursor.fetchall()))
- #results = ProbeSetSearch("shh", None, dataset, cursor, db_conn).run()
results = PvalueSearch(['0.005'], '<', dataset, cursor, db_conn).run()
- #results = RifSearch("diabetes", dataset, cursor, db_conn).run()
- #results = WikiSearch("nicotine", dataset, cursor, db_conn).run()
- #results = CisLrsSearch(['99'], '>', dataset, cursor, db_conn).run() # cisLRS > 99
- #results = LrsSearch('99', '>', dataset, cursor, db_conn).run()
- #results = TransLrsSearch(['9', '999', '10'], dataset, cursor, db_conn).run()
- #results = PhenotypeSearch("brain", dataset, cursor, db_conn).run()
- #results = GenotypeSearch("rs13475699", dataset, cursor, db_conn).run()
- #results = GoSearch("0045202", dataset, cursor, db_conn).run()
-
- logger.debug("results are:", pf(results))
+
db_conn.close()
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 49b47123..2089f9de 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -72,7 +72,6 @@ import utility.logger
logger = utility.logger.getLogger(__name__ )
-
@app.before_request
def connect_db():
db = getattr(g, '_database', None)