Simple API for Python Integration with NCBI
Project description
PyNCBI
Simple API for Python Integration with NCBI .
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
About The Project
Here's Why PyNCBI :dna: :
When working with methylation data, NCBI might be one of the most extensive open source databases that provide the methylation data and the information around it. When working with NCBI on a day-to-day basis, searching, querying, and extracting information may prove to be a time-consuming and headache-producing challenge. PyNCBI strives to answer all needs a researcher might need when communicating with NCBI using a straightforward python API that allows to quickly test, extract, analyze and download relevant data.
Installation
pip install PyNCBI
Usage
GEOReader
GSE Wise Info Retrival
from PyNCBI import GEOReader
# Create Reader Instance
reader= GEOReader()
# Extact all GSM info associated to GSE99624 (Saved csv will appear in your downloads folder)
reader.extract_gse_sample_info('GSE99624')
GSE Wise Data Retrival
from PyNCBI import GEOReader
# Create Reader Instance
reader= GEOReader()
# Extact all GSM methylation data associated to GSE142512 (Saved files will appear in your downloads folder per GSM depending on page data status)
reader.download_gse_data('GSE142512')
Single GSM Data Retrival
from PyNCBI import GEOReader
# Create Reader Instance
reader= GEOReader()
# Extact GSM methylation data associated to GSE142512 (Saved file will appear in your downloads folder per GSM depending on page data status)
reader.download_gsm_data('GSM1518180')
Parsing IDAT files
from PyNCBI import parse_idat_files
# Beta Values will be stored in a parquet file in path
parse_idat_files("Path_To_IDAT_FILES/", 'array_type')
GSM
The GSM API extracts all info from a GSM card and downloads the methylation data, and renders the beta values ready for work. After extracting and preprocessing the data once, that GSM instance will be cached for your convenience; each following time, you will reference the same GSM id the cached version will be loaded. The GSM class contains the following attributes:
- array_type - the array type used to sequence the data
- gse - the parent GSM id
- info - a Pandas Series contacting the entire GSM card information
- data - a Pandas DataFrame containing the probes and matching beta values
- characteristics - the parsed characteristics section from the GSM info section
Single GSM API
from PyNCBI import GSM
# Build and populate with data an instance of a GSM container
example_gsm = GSM('GSM1518180')
print(example_gsm)
Output:
GSM: GSM1518180 | GSE: GSE62003
tissue: Whole blood
Sex: Male
age: 77
Currently Supported Data Features
- GSE Wise Card Information Extraction
- GSM Card Information Extraction
- GSE Wise Methylation Data Extraction
- GSM Card Methylation Data Extraction
- IDAT File Parsing Management Based on methylprep
- Single GSM API
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open-source community such a powerful place to create new ideas, inspire, and make progress. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT license. See LICENSE
for more information.
Contact
Thomas Konstantinovsky - thomaskon90@gmail.com
Project Link: https://github.com/MuteJester/PyNCBI
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
File details
Details for the file PyNCBI-0.1.6.1.tar.gz
.
File metadata
- Download URL: PyNCBI-0.1.6.1.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae7cb4706f3d4ca3522b6ac0387099737e25f3540491198914586067088f2777 |
|
MD5 | de92e028ab93f491ecf8fd5fcc3b5062 |
|
BLAKE2b-256 | d48d2154e82dd68746fded476605a184c155e637ed3c247166128e66aa3747f8 |