Skip to content

KevinZ的小窝

Menu
  • Home
  • Categories
Menu

Hotspot-单细胞聚类算法

Posted on 2025年 9月 10日 by KevinZhou

官网链接:https://github.com/YosefLab/Hotspot

# 可本地运行的Hotspot上游

# 服务器运行Hotspot计算分析
import pickle
import scanpy as sc
import hotspot
import pandas as pd
import numpy as np
import diopy
import pickle
import matplotlib.pyplot as plt

# Load the saved results
with open("hotspot_results.pkl", "rb") as f:
    results = pickle.load(f)

# Access the objects
hs = results["hs"]

modules = hs.create_modules(
    min_gene_threshold=900, core_only=True, fdr_threshold=0.05)

hs.plot_local_correlations()
plt.gcf().savefig("min_gene900_local_correlations.pdf", bbox_inches="tight", dpi=300)

module_scores = hs.calculate_module_scores()

# Save results
modules.to_csv("modules.csv")
module_scores.to_csv("module_scores.csv")

results = {
    "hs": hs,
    "modules": modules,
    "module_scores": module_scores,
}

# Save all results
with open("hotspot_results.pkl", "wb") as f:
    pickle.dump(results, f)
2025 年 9 月
一 二 三 四 五 六 日
1234567
891011121314
15161718192021
22232425262728
2930  
« 8 月   10 月 »

俺家的猫~

胖达~

© 2026 KevinZ的小窝 |

粤ICP备2023017690号

|

粤公网安备 44010402003004号