Skip to content

Instantly share code, notes, and snippets.

@thusal
Created June 13, 2017 17:40
Show Gist options
  • Save thusal/a164ccd364f02325bf8db64769d26468 to your computer and use it in GitHub Desktop.
Save thusal/a164ccd364f02325bf8db64769d26468 to your computer and use it in GitHub Desktop.
GEOparse
# GEOparse download GEO series as SOFT files, and supplementary fiels to use locally
# load as easy to manipulate objects
# prepare dataset for GEO upload
import GEOparse
gse = GEOparse.get_GEO(geo="GSE1563", destdir="./")
# check GEO database for accession ID and download to CWD
# if already downloaded... use to read file into GSE object
# gse = GEOparse.get_GEO(filepath="./GSE1563.soft.gz")
print()
print("GSM example:")
for gsm_name, gsm in gse.gsms.items():
print("Name: ", gsm_name)
print("Metadata:",)
for key, value in gsm.metadata.items():
print(" - %s : %s" % (key, ", ".join(value)))
print ("Table data:",)
print (gsm.table.head())
break
print()
print("GPL example:")
for gpl_name, gpl in gse.gpls.items():
print("Name: ", gpl_name)
print("Metadata:",)
for key, value in gpl.metadata.items():
print(" - %s : %s" % (key, ", ".join(value)))
print("Table data:",)
print(gpl.table.head())
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment