aboutsummaryrefslogtreecommitdiff
path: root/scripts/maintenance/Update_Case_Attributes_MySQL_tab.py
diff options
context:
space:
mode:
authorPjotr Prins2018-04-03 07:50:28 +0000
committerPjotr Prins2018-04-03 07:50:28 +0000
commitfb57f05083b0512b7bb9f9e15b6cc6efaded5a1f (patch)
treeb2d5e7cf8f9a52a44b719103809276315de7f325 /scripts/maintenance/Update_Case_Attributes_MySQL_tab.py
parent9544ca2e6461b267c28d9a4c7fe976bc34f10be3 (diff)
downloadgenenetwork2-fb57f05083b0512b7bb9f9e15b6cc6efaded5a1f.tar.gz
@acenteno added data upload scripts into main repo
Diffstat (limited to 'scripts/maintenance/Update_Case_Attributes_MySQL_tab.py')
-rw-r--r--scripts/maintenance/Update_Case_Attributes_MySQL_tab.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/maintenance/Update_Case_Attributes_MySQL_tab.py b/scripts/maintenance/Update_Case_Attributes_MySQL_tab.py
new file mode 100644
index 00000000..0f8602c9
--- /dev/null
+++ b/scripts/maintenance/Update_Case_Attributes_MySQL_tab.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python2
+########################################################################
+# Last Updated Apr 11, 2016 By Arthur and Zach
+########################################################################
+import string
+import sys
+import MySQLdb
+import getpass
+import time
+import csv
+########################################################################
+
+mydb = MySQLdb.connect(host='localhost',
+ user='username',
+ passwd='',
+ db='db_webqtl')
+cursor = mydb.cursor()
+
+csv_data = csv.reader(file('GN711_pvalues.txt'), delimiter ="\t")
+for row in csv_data:
+
+ cursor.execute("""UPDATE ProbeSetXRef SET pValue = %s WHERE ProbeSetFreezeId = %s AND ProbeSetId = %s """,
+ (row))
+#close the connection to the database.
+mydb.commit()
+cursor.close()
+print "Done" \ No newline at end of file