4.2 如何在长时间分析中保持专注?

提示

No headings found on page

长时间的对话可能会引入错误,因为AI必须追踪许多之前的信息、输出和变量。

当上下文变得复杂时,AI可能会:

  • 混淆文件路径或变量名称

  • 混合来自不同分析步骤的结果

  • 生成看似合理但不正确的统计数据

  • 从活动记忆中丢失较早的输出

最安全的工作流程是保持每个分析会话短暂且专注


核心策略:一次分析=一个会话

与其在一个长时间对话中执行整个工作流程,不如:


一个长会话执行:

会话1:质量控制和预处理

质量控制 → 聚类 →

会话2:聚类

差异表达 → 富集分析 →

会话3:差异表达

可视化

会话4:路径富集

每个会话保持短暂、专注且上下文清晰。


实用提示

1. 每个分析步骤对应一场会话

为分析的每个主要阶段启动一个新会话。

示例工作流程:

会话1:质量控制和预处理 → 保存 adata_qc.h5ad

会话2:加载 adata_qc.h5ad → 聚类和注释 → 保存 adata_annotated.h5ad

第二个会话从干净的上下文开始。


2. 在主要步骤后保存检查点

始终保存中间结果。

# After QC
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_qc.h5ad")

# After clustering
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_clustered.h5ad")

# After annotation
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_annotated.h5ad")
# After QC
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_qc.h5ad")

# After clustering
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_clustered.h5ad")

# After annotation
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_annotated.h5ad")
# After QC
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_qc.h5ad")

# After clustering
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_clustered.h5ad")

# After annotation
adata.write_h5ad("/home/user/user_data/Project/checkpoints/adata_annotated.h5ad")
3. 以上下文摘要开始新会话

在新会话中继续工作时,从简短摘要开始。

Continuing a scRNA-seq analysis.

Previous session saved the annotated AnnData at:
/home/user/user_data/Project/adata_annotated.h5ad

Cell types assigned:
T cells, B cells, Macrophages, NK cells

Clustering resolution:
0.5 using the Leiden algorithm

Goal of this session:
Run differential expression between Treated and Control within each cell type

Continuing a scRNA-seq analysis.

Previous session saved the annotated AnnData at:
/home/user/user_data/Project/adata_annotated.h5ad

Cell types assigned:
T cells, B cells, Macrophages, NK cells

Clustering resolution:
0.5 using the Leiden algorithm

Goal of this session:
Run differential expression between Treated and Control within each cell type

Continuing a scRNA-seq analysis.

Previous session saved the annotated AnnData at:
/home/user/user_data/Project/adata_annotated.h5ad

Cell types assigned:
T cells, B cells, Macrophages, NK cells

Clustering resolution:
0.5 using the Leiden algorithm

Goal of this session:
Run differential expression between Treated and Control within each cell type

这提供了准确的上下文,而不是依赖AI的记忆。

4. 每次提示专注一个任务

避免在一个请求中组合多个步骤。

避免:运行差异表达,进行路径富集,创建热图,注释顶级基因,并保存所有内容。

将其拆分为步骤:运行差异表达。-> 执行路径富集。-> 创建可视化。

5. 将笔记本输出视为真实情况

始终信任实际的笔记本输出,而不是AI的聊天总结。

6. 当对话变长时重置会话

如果对话超过约15-20个交换,概述关键发现并启动一个新会话。

相关教程

科学正迈向新的飞跃。
加入我们,共同实现这一突破。

科学正迈向新的飞跃。
加入我们,共同实现这一突破。

科学正迈向新的飞跃。加入我们,共同实现这一突破。