用于机器学习应用的自动化生物医学信息管理。

biovida的Python项目详细描述


《生物维达》是一个旨在使其易于获得现有的图书馆。 生物医学图像的数据集,以及建立全新的、定制的 一个。

希望通过自动化单调乏味的数据咀嚼 通常,更多的人会对这个过程感兴趣 将机器学习应用于生物医学图像,反过来, 深入了解人类疾病。

为了向递归致敬,biovida试图完成一些 利用机器学习本身实现自动化,使用诸如卷积的工具 神经网络。

安装

python包索引:

$ pip install biovida

最新版本:

$ pip install git+git://github.com/TariqAHassan/BioVida@master

需要python 3.4+

图像:稳定

只需几行代码,您就可以访问生物医学数据库 存储了上千万张图片。

请注意,您必须遵守版权和其他 根据其向您提供此数据的使用限制 创造者。

open-i生物医学图像搜索引擎

# 1. Import the Interface for the NIH's Open-i API.frombiovida.imagesimportOpeniInterface# 2. Create an Instance of the Toolopi=OpeniInterface()# 3. Perform a search for x-rays and cts of lung canceropi.search(query='lung cancer',image_type=['x_ray','ct'])# Results Found: 9,220.# 4. Pull the datasearch_df=opi.pull()

癌症影像档案

# 1. Import the interface for the Cancer Imaging Archivefrombiovida.imagesimportCancerImageInterface# 2. Create an Instance of the Toolcii=CancerImageInterface(YOUR_API_KEY_HERE)# 3. Perform a searchcii.search(cancer_type='esophageal')# 4. Pull the datacdf=cii.pull()

CancerImageInterfaceOpeniInterface缓存图像 以后使用。当数据被“拉”时,会生成一个records_db,它 是与图像关联的所有文本数据的数据帧。他们是 作为类属性提供,例如cii.records_db。当 records_db只存储最近数据拉取的数据, cache_records_dbdataframes提供所有图像数据的帐户 当前已缓存。

分割图像

biovida可以将缓存的图像分为训练/验证/测试。

frombiovida.imagesimportimage_divvy# 1. Define a rule to 'divvy' up images in the cache.defmy_divvy_rule(row):ifrow['image_modality_major']=='x_ray':return'x_ray'elifrow['image_modality_major']=='ct':return'ct'# 2. Define Proportions and Divide Datatt=image_divvy(opi,my_divvy_rule,action='ndarray',train_val_test_dict={'train':0.8,'test':0.2})# 3. The resultant ndarrays can be unpacked as follows:train_ct,train_xray=tt['train']['ct'],tt['train']['x_ray']test_ct,test_xray=tt['test']['ct'],tt['test']['x_ray']

图像:实验性

自动图像数据清理

不幸的是,从上面open-i中提取的数据可能包含 大量与搜索查询无关的图像和/或 不适合机器学习。

实验性的OpeniImageProcessing类可用于 完全自动化此数据清理过程,该过程部分由 通过卷积神经网络。

# 1. Import Image Processing Toolsfrombiovida.imagesimportOpeniImageProcessing# 2. Instantiate the Tool using the OpeniInterface Instanceip=OpeniImageProcessing(opi)# 3. Analyze the Imagesidf=ip.auto()# 4. Use the Analysis to Clean Imagesip.clean_image_dataframe()

很容易将这些图像分割成训练集和测试集。

frombiovida.imagesimportimage_divvydefmy_divvy_rule(row):ifrow['image_modality_major']=='x_ray':return'x_ray'elifrow['image_modality_major']=='ct':return'ct'tt=image_divvy(ip,my_divvy_rule,action='ndarray',train_val_test_dict={'train':0.8,'test':0.2})# These ndarrays can be unpack as shown above.

基因组数据

虽然biovida主要关注图像,但它也提供了一个简单的 获取相关信息的接口,如基因组数据。

# 1. Import the Interface for DisGeNET.orgfrombiovida.genomicsimportDisgenetInterface# 2. Create an Instance of the Tooldna=DisgenetInterface()# 3. Pull a Databasegdf=dna.pull('curated')

诊断数据

biovida还使获得诊断数据变得容易。

关于疾病定义、家族和同义词的信息:

# 1. Import the Interface for DiseaseOntology.orgfrombiovida.diagnosticsimportDiseaseOntInterface# 2. Create an Instance of the Tooldoi=DiseaseOntInterface()# 3. Pull the Databaseddf=doi.pull()

有关疾病相关症状的信息:

# 1. Import the Interface for Disease-Symptoms Informationfrombiovida.diagnosticsimportDiseaseSymptomsInterface# 2. Create an Instance of the Tooldsi=DiseaseSymptomsInterface()# 3. Pull the Databasedsdf=dsi.pull()

统一信息

unify_against_images函数集成图像数据信息 对DisgenetInterfaceDiseaseOntInterfaceDiseaseSymptomsInterface

frombiovida.unificationimportunify_against_imagesunify_against_images(interfaces=[cii,opi],db_to_extract='cache_records_db')

数据框左侧:仅图像数据

article_typeimage_idimage_ca ptionmodality_best_guessagesexdisease
0case_re port1Magnetic Resonance Imaging (MRI)73malefibroma
1case_re port2Magnetic Resonance Imaging (MRI)73malefibroma
2case_re port1Computed Tomography (CT): angiography45femal ebile duct cancer

数据框右侧:添加了信息

disease_famil ydisease_sy nonymdisease_d efinitionknown_associ ated_symptom smentioned_symptomsknown_assoc iated_genes
(cell type benign neoplasm,)nannan(abdominal pain,…)(pain,)((ANTXR2, 0.12), …)
(cell type benign neoplasm,)nannan(abdominal pain,…)(pain,)((ANTXR2, 0.12), …)
(biliary tract cancer,)(bile duct tumor,…)A biliary tract…(abdominal obesity,..)(colic,)nan

贡献

有关如何贡献的详细信息,请参阅 contributing 文件。

始终欢迎错误报告和功能请求,并且可以提供 穿过Issues 网页

资源

那个 resources 文档提供了所有数据源和所用学术著作的说明 生物多样性。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaAkka参与者工具包上下文。ActorofVS系统。阿克特罗夫   java快速查看是否未选中所有复选框的方法   使用JLabel添加图片时遇到的java问题   java如何在SpringRestTemplate中自定义自动封送以生成/修改XML头(编码,DOCTYPE)   java Exchange Web服务(EWS)使用令牌凭据进行单点登录?   java无法从@Transaction中具有关系的两个表中删除   多线程处理我的代码只有在通过java完成处理后才能继续   java FileNotFoundException:[excel在本地计算机上的位置]文件名、目录名或卷标语法不正确   java JPanel不会显示在另一个JPanel之上   从Eclipse构建器运行Java程序   java根据状态更改记录器级别   在Java中,如何使用日志。e(或任何函数)列出代码中使用的所有变量   java 21点极小极大算法   java NullPointerException@Googlemap lambda表达式?(gMapsfx)   java如何运行。从转换的exe文件。使用不带Jre的Launch4J工具的jar文件   java将非实质性的Swing插件加载到Eclipse