通知perkinelmer reader-python接口读取perkinelmer通知软件的输出

pythologist的Python项目详细描述


#pythogist

*读取和分析细胞图像数据。*


该软件通常从Jupyter笔记本上运行,并提供图像数据挂钩,以便用户能够灵活地执行他们设计的或在主要文献中找到的分析。

[大型图像分析出版物列表](https://github.com/jas在weirate/pythogist/wiki/list of large scale image analysis publications上)



pythogist基于[**irisspatialfeatures**(https://github.com/gusef/irisspatialfeatures)(c.d.carey,d.gusenleitner,m.lipshitz,et al.血。2017)https://doi.org/10.1182/blood-2017-03-770719,采用python编程语言实现。

pythogist add的特点是:

*一个通用的cellprojectgeneric存储类,以及组织不同数据类型导入的经典继承约定。
*一个可变的celldataframe类,可用于切片和组合项目。
*广告功能基于细胞-细胞接触或细胞接近度的细胞二元特征。
*基于细胞分割或笛卡尔坐标上的热图可定制图像。
*通过子逻辑语法指定细胞群,以快速选择相互排斥的表型或二进制。RY功能
*一组质量检查函数,用于识别导入数据中的潜在问题。

\//github.com/jason weirate/pythogist)]
*`pythogist reader`cellproject存储对象[[读取文档](https://jason weirate.github.io/pythogist reader/)][[源](https://github.com/jason weirate/pythogist reader)]
*`pythogist test images`示例数据[[源](https://github.com/jason weirate/pythogist test images)]
*`pythogist image utilities`处理图像的帮助函数[[阅读文档](https://jason weirate.github.io/pythogist image utilities/)][[来源](https://github.com/jason weirate/pythogist image utilities)]

启动

要在当前Drectory中以用户身份启动具有所需软件的Jupyter Lab笔记本,可以使用以下命令

`docker run--rm-p 8888:8888--user$(id-u):$(id-g)-v$(pwd):/work vacation/pythogist:latest`

T 8888作为您的用户和组。

任何测试数据示例在此环境中都应该可以正常工作。

将使用您自己的用户名/组名和ID的ER映像.*

````
$docker build-t pythogist:latest--build arg user=$user name\
--build arg group=$groupname\
--build arg user=$user id\
--构建arg group-id=$groupid。
``

**现在启动docker映像。**

````
$docker run--rm-p 8885:8888-v$(pwd):/home/$username/work pythogist:latest
```

,其中,`$username`,`$userid`,`$groupid`对应于您的使用r/group name/id.




````
>$pip install pythowogist
````


>公共任务



>阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读阅读使示例文件夹包含一个或更多的图像导出,可以从ast文件夹名。

`` python
来自pythogist_test_images导入testimages
来自pythogist_reader.formats.inform.sets导入cellprojectinform
将matplotlib.pyplot导入为plt

获取测试数据集的路径
path=testimages().raw('irisspatialfeatures')
cr创建将保存项目的存储对象
cpi=cellprojectinform('pythoogist.h5',mode='w')
_ iter():
中断
打印(f.frame_name)
plt.imshow(f.cell_map_image(),origin='upper')
plt.show()
`````

>;mel2_7
>;
>;![MEL2_7_cell_map](https://github.com/jason-weirate/pythogist/blob/master/images/meL2_7_cell_map.png?raw=true)

与上面类似,该项目被组织到样本文件夹中,每个样本文件夹中的每个图像都有一个定义肿瘤和浸润边缘的*tif*文件。它们的形式为每张图像的"image name prefix">;"u tumor.tif"和"image name prefix">;"u investive_margin.tif"。tif是一个充满肿瘤的区域,在其他地方是透明的。"侵入边缘.tif"是一条已知宽度的画线。` steps`用于在每个方向将边距扩大到多个像素,以建立侵入性边距区域。在这里,我们还会在读入期间重命名一些标记,以清除二进制特性上阈值化的语法。



``python
from pythology_test_images import testimages
from pythology_reader.formats.inform.custom import cellprojectinformlinearea

t数据集
path=testimages().raw('irisspatialfeatures')
指定将读取的数据作为h5对象存储的位置
cpi=cellprojectinformlinearea('test.h5',mode='w')
读取数据(动态存储到h5对象中)
cpi.read路径(path,
sample懔name懔index=-1,
verbose=true,
steps=76,
project懔name懔irisspatialfeatures',
microns懔u per懔pixel=0.496)
对于cpi中的f,frame懔iter():
break
print(f.frame懔name)
print("手绘边距")
plt.imshow(f.get懔image(f.get_data('custom_images').\
设置_index('custom_label').loc['drawind','image_id'],origin='upper')
plt.show()
打印('hand drawind tumor area')
plt.imshow(f.get_image(f.get_data('custom_images').\
设置_index('custom_label').loc['area','image_id']),origin='upper')
plt.show()
print('相互排斥的边缘、肿瘤和基质')
plt.imshow(f.get_image(f.get_data('regions')。\
设置_index('region_label').loc['margin','image_id',),origin='upper')
plt.show()
plt.imshow(f.get_image(f.get_data('regions')。\
设置_index('region_label').loc','image_id']、origin='upper')
plt.show()
plt.imshow(f.get_image(f.get_data('regions').\
set_index('region_label').loc['matroma','image_id']、origin='upper')
plt.show()
`````
>;mel2_2
>;
>;手绘边距
>;
>;
>;![mel2_u drawer_u line](https://github.com/jason-weirate/pythogist/blob/master/images/mel2_u drawer.png?raw=真)
>;
>;手绘肿瘤区域
>;
>;![MEL2_2;u绘制线](https://github.com/jason-weirate/pythogist/blob/master/images/meL2_2;u area.png?raw=真)
>;
>;相互排斥的边缘、肿瘤和基质
>;
>;![mel2_u margin](https://github.com/jason-weirate/pythogist/blob/master/images/mel2_u margin.png?原始=真)
>;![mel2_u tumor](https://github.com/jason-weirate/pythogist/blob/master/images/mel2_u tumor.png?原始=真)
>;![mel2_u基质](https://github.com/jason-weirate/pythogist/blob/master/images/mel2_u基质.png?raw=true)


informcustommask
将matplotlib.pyplot导入为plt
path=testimages().raw('irisspatialfeatures')
cpi=cellprojectinformcustommask('test.h5',mode='w')
cpi.read路径(path,
microns/u-pixel=0.496,
sample-name-index=-1,
verbose=true,
custom_mask_name="tumor",
other_mask_name="not-tumor")
cpi.frame_iter()中f的值:
rs=f.get_data("regions").set_index("region_label")
rs.index中r的值:
print(r)
plt.imshow(f.get_image(rs.loc[r]['image_id'),origin上面的")
plt.show()
中断
````
>;mel2
>;
>;肿瘤
>;
>;![Mel2_u肿瘤](https://github.com/jason-weirate/pythogist/blob/master/images/Mel2_u肿瘤-b.png?raw=真)
>;
>;不是肿瘤
>;
>;![mel2_u not_u tumor](https://github.com/jason-weirate/pythogist/blob/master/images/mel2_u not-tumor-b.png?









``python
`` python
cdf=cpi.cdf
cdf.db=cpi
cdf.qc
cdf.qc(verbose=true.print_results()
`` ` ` ` `
` ` ` ` ` `
<
`<
/>` ` ` ` ` ` ` `<
/>` ` ` ` `=
检查微米每像素属性
pass
microns per pixel为0.496

通过
良好的一致性。
问题计数:0/2
==
帧名称和帧ID之间是否存在1:1的对应关系?
通过
良好的一致性。
问题计数:0/4
==
项目名称与项目ID之间是否存在1:1的对应关系?
通过
良好的一致性。
问题计数:0/1
==
多个样本中是否存在相同的帧名?
通过
帧名都在它们自己的样本中
问题计数:0/4
==
是否列出了相同的表型并遵循互斥规则?
传递
表型调用和表型标签遵循预期规则
===
所有图像中是否包含相同的表型?
通过
一致的表型
问题计数:0/4
===
所有图像上是否包含相同的评分名称?
通过
一致的计分卡名称
问题计数:0/4
==
相同的区域在图像和跨图像中是否相同?
通过
一致区域
发布计数:0/5
==
列出的相同区域是否匹配有效区域标签
通过
区域和区域标签是否遵循预期规则
==
==
我们是否有任何区域大小小到应该考虑排除的程度?
警告
[
"数据中包含非常小的非零区域['irisspatialfeatures'、'mel2'、'mel2'7'、{'margin':495640、'tumor':947369、'stroma':116}]"
]
问题计数:1/2
````



调用"cartesian"之前设置的细胞表型是可绘制的表型。

``python
from pythology\u test\u images import testimages
from plotnine import*
proj=testimages().project('irisspatialfeatures')
cdf=testimages().celldataframe('irisspat'ialfeatures')
cdf.db=proj
cart=cdf.cartesian(verbose=true,step_pixels=50,max_distance_pixels=75)
df,cols=cart.rgb_dataframe(red='cd8+',green='sox10+')
shape=cdf.iloc[0]['frame_shape']
(ggplot(df aes(x='frame_x',y='frame_y',fill='color_s
+geom-point(shape='h',size=4.5,color='77777777',笔划=0.2)
+geom-vline(xintercept=-1,color="55555555")
+geom-vline(xintercept=shape[1],color="5555555555")
+geom-gline(yintercept=-1,color="5555555555")
+geom-gline(yintercept=-1,color="55555555")
+geom-geom-gline(yintercept=-1,yintercept=-1,color="1,color="cept=形状[0],颜色="555555")
+facet_wrap('f框架名称')
+缩放填充手册(cols,guide=false)
+主题bw()
+主题(图大小=(8,8))
+主题(纵横比=形状[0]/形状[1])
+缩放反转()
`````

>;![密度示例](https://github.com/jason-weirate/pythogist/blob/master/images/density_plots.png?raw=true)


ChannLyGraceScript(<)BR/>子=CH.Lo[ [(CHIVHOLDDY值)],(CH [ChhannLayLabel]='PDL1')] BR/>(GUTRAP(子,AES(x= Bin),y=‘计数’))BR/> + GeOnMeBar(STAT=‘身份’)
+ FACETHOLD("框架名")
+ GEOMYVVLIN(AES)(IrSimulalPosits)
CDF.dB= PROJintercept="阈值',color="red')
+theme\u bw()
+ggtitle('pdl1的阈值化\n图像像素强度')

````

*原始组件图像不可用于irisspatialfeatures示例,因此像素强度是模拟的,不一定匹配t用于设置原始阈值的阈值。*

>;![直方图示例](https://github.com/jason-weirate/pythogist/blob/master/images/histogram_example.png?raw=true)

')
cdf=cpi.cdf
cdf.db=cpi
sub=cdf.loc[cdf['frame_name']='mel2_7'].dropna()
cont=sub.contacts().threshold('cd8+','cd8+/contact').contacts().threshold('sox10+','sox10+/contact')
cont=cont.threshold('cd8+','sox10+/contact',
positive_label='cd8+接触',
负的标签='cd8+'。\
阈值('sox10+','cd8+/接触',
正的标签='sox10+接触',
负的标签='sox10+')
模式=[
{子集逻辑:sl(表型=['other'),
边缘颜色:(50,50,50255),
"分水岭步骤":0,
"填充颜色":(0,0,0255)
},
{"子集逻辑":sl(表型=['sox10+']),
"边缘颜色":(166206272255),
"分水岭步骤":0,
"填充颜色":(0,0,0,0)

{"子集逻辑":sl(表型=['cd8+'],
"边缘颜色":(253191111255),
"分水岭步骤":0,
"填充颜色":(0,0,0)
},
{"子集逻辑":sl(表型=['cd8+接触'),
"边缘颜色":(253191111255),
"分水岭步骤":0,
"填充颜色":(255127,0255)
},
{"子集"_逻辑:SL(表型=['SOX10+contact'],
'边缘颜色':(1662062727255),
'分水岭步骤':0,
'填充颜色':(31120180255)
}
]
SIO=cont.分割图像().构建分割图像(模式,背景=(0,0,0255))
SIO.写入路径("测试边缘",overwrite=true)
````

>;mel2_7
>;
>;![可视化联系人](https://github.com/jason-weirate/pythogist/blob/master/images/mel2_7-contacts.png?raw=true)

*图像被放大和裁剪以更好地显示轮廓。*


\
`` python
合并,失败=cdf1.m人体工效学评分(cdf2,on=['sample'name','frame'name','x','y','y']]
```




`显示二元‘得分'叫声’的名称
```python
>cdf.得分
`````````
>>
>>
>
``python
cdf。表型
```

>;['cd8+','other',"SOX10+"]



``python
cdf.region
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
/><>`<` ` `肿瘤")
塌陷。表型
```

>
>;['sox10+','非肿瘤']






将一个区域命名为

将*肿瘤*重命名为*肿瘤*

```python
更名为cdf.ren重命名```区域('肿瘤,'肿瘤')
```
>
>
`python
renamed=cdf.rename\u得分的调用({'pdl1(opal 52"'pdl1'})
````







使*细胞*进入*细胞PDl1+*和*细胞PDl1-*

```巨蟒``python
``生生生生的阈值(‘细胞’和‘pdl1’'pdl1’)
`````




``巨蟒````巨蟒`>

>
>



>



cd68_cd163=raw.threshold('cd68','cd163')。\
threshold('cd68 cd163+','pdl1')。\
阈值('cd68 cd163-','pdl1')
````

/>###获取每个样本的计数

生成当前表型的计数和分数,并将其导出到csvD创建一个新的CellDataFrame,它具有一个额外的二进制特性,代表与"T细胞"表型细胞的接触。

``python
cdf=cdf.contacts().threshold('t cell')
````

follow命令创建一个新的CellDataFrame,它具有一个额外的二进制特性,代表在75微米的"T细胞"表型细胞内或外。

``python
cdf=cdf.nearestneighbors().threshold('T细胞','T细胞/在75微米内,'distance_mn=75)
```

create感兴趣的功能之间的单元-单元接触图像

``python

`````

sspatialfeatures)]

*jupyter笔记本:[测试irisspatialfeatures输出](https://github.com/jason weirate/pythogist/blob/master/notebooks/test%20测试%20irisspatialfeatures%20outputs.ipynb)


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

推荐PyPI第三方库


热门话题
java Android Espresso如何检查字符串是否缩写   java jar从cmd写入文件,但不能双击   Grails中的java onetomany映射|我可以在复合键中使用生成的值吗?   java HttpsURLConnection在尝试添加Cookie时已连接   java在Netbeans中不能有同名的包和类   如何在格式化字段自动更改无效输入(Swing)Java时触发事件   用户输入后java JTextArea未更新   java试图用新字符替换字符串中的特定字符   java类加载器在Linux上显示错误路径   java mySQL远程数据库未连接   java如果接口需要MyObject对象,如何返回错误对象?   java无法解析在MainActivity之外调用安卓类时的符号   java如何将应用程序文件正确添加到appium所需的功能?   Java中浮点数组的数据对齐算法