Created
April 28, 2016 00:38
-
-
Save bkamapantula/3b45dcdc38c5a4a98b9998e95c96f1a7 to your computer and use it in GitHub Desktop.
Gets metadata of GSM accession using GEOmetadb.sqlite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
# from https://gbnci-abcc.ncifcrf.gov/geo/ | |
geo_db = "GEOmetadb.sqlite" | |
# connects to the database | |
sra_con = sqlite3.connect(geo_db) | |
cursor = sra_con.cursor() | |
gsms = ['GSM409307', 'GSM1220601', 'GSM1120314', 'GSM1120315', 'GSM1112815', 'GSM1112816', 'GSM1112817', 'GSM1112818', 'GSM410808'] | |
#cursor.execute("PRAGMA table_info(gsm);") | |
for gsm in gsms: | |
cursor.execute("SELECT source_name_ch1 FROM gsm WHERE gsm='%s';" % gsm) | |
print cursor.fetchall() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment