大规模单细胞数据的神经网络可扩展可视化
neuralee的Python项目详细描述
- 自由软件:麻省理工学院许可证
- 文档:https://neuralee.readthedocs.io。
这是Neurale的适用版本。
- 数据集加载和预处理模块修改自 scVI。
- 定义NualAlee类和一些辅助函数,主要用于CUDA 计算,除了熵亲和力计算 在CPU上计算得更快。
- 给出了基于matlab的通用弹性嵌入算法。 来自Max Vladymyrov。
- 添加一些帮助复制的笔记本演示。
安装
- 安装Python3.7。
- 安装PyTorch。如果你有NVIDIA的GPU,一定要 安装支持它的pytorch版本。尼亚莱跑得快多了 有一个离散的GPU。
- 通过PIP或从Github安装Neurale:
pip install neuralee
git clone git://github.com/HiBearME/NeuralEE.git
cd NeuralEE
python setup.py install --user
教程
fromneuralee.datasetimportCortexDatasetfromneuralee.embeddingimportNeuralEEimporttorch# detect whether to use GPU.device=torch.device('cuda'iftorch.cuda.is_available()else'cpu')# 1 load dataset.cortex_dataset=CortexDataset(save_path='../data/')# 2 preprocess dataset. logarithm transformation, genes subsample and standard scale.cortex_dataset.log_shift()cortex_dataset.subsample_genes(558)cortex_dataset.standardscale()# 3 embedding.# 3.1 not using mini-batch trick, if dataset is not large.# 3.1.1 calculate weights matrixcortex_dataset.affinity()# 3.1.2 initialize NeuralEE class.NEE=NeuralEE(cortex_dataset,device=device)# 3.1.3.1 elastic embedding.results=NEE.EE()# 3.1.3.2 NeuralEE.results_Neural=NEE.fine_tune()# 3.2 introduce mini-batch trick.# 3.2.1 calculate weights matrix on each batch.cortex_dataset.affinity_split(N_small=0.25)# 3.2.2 initialize NeuralEE class.NEE=NeuralEE(cortex_dataset,device=device)# 3.2.3 elastic embedding.results_Neural_with4batches=NEE.fine_tune()
有关更详细的教程和原始论文结果的复制,请访问 notebook 文件夹。
示例
血液学
大脑大