a Python library and command line tool to make GEO data into gold.
Project description
geo-alchemy
a Python library and command line tool to make GEO data into gold.
why geo-alchemy
GEO is like a gold mine that contains a huge many gold ore. But processing these gold ore(GEO series) into gold(expression matrix, clinical data) is not very easy:
- how to map microarray probe to gene?
- how about multiple probes map to same gene?
- hot to get clinical data?
- ...
geo-alchemy was born to deal with it.
installation
If you only want use as Python library:
pip install geo-alchemy
If you also want use as command line software:
pip install 'geo-alchemy[cmd]'
use as Python library
parse metadata from GEO
parse platform
from geo_alchemy import PlatformParser
parser = PlatformParser.from_accession('GPL570')
platform1 = parser.parse()
# or
platform2 = PlatformParser.from_accession('GPL570').parse()
print(platform1 == platform2)
parse sample
from geo_alchemy import SampleParser
parser = SampleParser.from_accession('GSM1885279')
sample1 = parser.parse()
# or
sample2 = SampleParser.from_accession('GSM1885279').parse()
print(sample1 == sample2)
parse series
from geo_alchemy import SeriesParser
parser = SeriesParser.from_accession('GSE73091')
series1 = parser.parse()
# don't parse samples, samples attribute will be a blank list
series2 = parser.parse(parse_samples=False)
print(series2.samples == [])
# or
series3 = SeriesParser.from_accession('GSE73091').parse()
print(series1 == series3)
additional computed attributes can be access by:
print(series.sample_count) # how many samples
print(series.platforms) # duplication removal platforms
print(series.organisms) # duplication removal organisms
serialization and deserialization
For the convenience of saving, all objects in geo-alchemy can be converted to dict, and this dict can be directly saved to a file in json form.
Moreover, geo-alchemy also provides methods to convert these dicts into objects.
from geo_alchemy import SeriesParser
series1 = SeriesParser.from_accession('GSE73091').parse()
data = series1.to_dict()
series2 = SeriesParser.parse_dict(data)
print(series1 == series2)
use as command line software
preprocessing(microarray series only)
geo-alchemy pp -s GSE174772 -p GPL570 -g 11
-s GSE174772
means preprocessing for GSE174772-p GPL570
means preprocessing samples who use GPL570 of GSE174772-g 11
means NO.11 column of GPL570 annotation file is gene
this command generate 2 files under current directory:
- clinical file
GSE174772_clinical.txt
- gene expression file
GSE174772_expression.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for geo_alchemy-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c23d0a937e64fbf9d2e1bf74fad7abc3b2be1d01d85c1fea68d670f4f1c1ea7e |
|
MD5 | 179cf9c3c19becf77623e3e9be44f998 |
|
BLAKE2b-256 | ebcf64533810c4041b1f870fb2b31c0076dd78758875aec40f186ccbf8f0688b |