基于可达性模式的单细胞表观基因组聚类
APEC的Python项目详细描述
APEC用户指南(v1.1.0)
(基于可达性模式的表观基因组聚类)
apec可以对来自scatac-seq、snatac-seq、sciatac-seq或任何其他相关实验的单细胞染色质可及性数据进行精细的细胞类型聚类。它还可以用于评估相关基因的表达,为每个细胞簇寻找差异的基序/基因,寻找超级增强子,并构建伪时间轨迹(通过调用monocle)。如果用户已经从其他映射管道(如cellranger)获取了每个峰值矩阵的片段计数,请从第一部分"从片段计数矩阵运行apec"运行apec。如果用户只有原始的fastq文件,请跳到第二部分"从原始数据获取片段计数矩阵"。
从片段计数矩阵运行AEPC
<H3>1。要求和安装1.1要求
apec需要linux系统(centos 7.3+或ubuntu 16.04+),以及python(2.7.15+或3.6.8+)。如果用户想用apec建立伪时间轨迹,请安装r(3.5.1)环境和monocle(2.10.0)。此外,APEC还需要以下软件:
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
注意:用户需要通过"perl/path to homer/configurehomer.pl-install hg19"和"perl/path to homer/configurehomer.pl-install mm10"下载Homer的基因组参考资料。
apec需要reference文件夹中的文件。但我们没有将引用文件上载到github,因为它们太大。用户可以从http://galaxy.ustc.edu.cn:30803/apec/" rel="nofollow">http://galaxy.ustc.edu.cn:30803/apec/下载所有参考文件。参考文件夹应包含以下文件: 用户可以通过以下方式安装apec: 由于兼容性问题(特别是对于rpy2),我们不建议使用conda环境。用户可以使用pyenv构建apec的子环境。如果用户希望调用paga(而不是monocle)来构造伪时间轨迹,请在python3环境中使用apec并安装以下软件包: 在ipython、jupyter笔记本或python脚本中,用户可以通过以下方式导入apec包: 用户可以使用ipython或jupyter中的"help()"查询apec的每个功能手册,例如: 用户需要准备一个项目文件夹(称为"$project"),其中包含矩阵、峰值、结果和图文件夹。请将"filtered_cells.csv"和"filtered_reads.mtx"放在matrix文件夹中,将"top_filtered_peaks.bed"放在peak文件夹中。以下是三个输入文件的说明: 使用以下代码按APEC算法对单元格进行群集: 输入参数: 输出文件: 然后用户可以绘制单元格的tsne、umap或相关热图: 输入参数: 输出文件: Tsne_by_apec_with_notes_label.pdf cell_cell_correlation_by_apec_with_notes_label.png 使用以下代码按chromvar算法对单元格进行聚类: 输入参数: 输出文件: 如果用户在"$project/matrix/filtered_cells.csv"的"notes"列中有真实的单元格类型,请使用以下代码计算ari、nmi和ami,以估计聚类算法的准确性。 输出的ari、nmi和ami值将直接显示在屏幕上。请确保filtered_cells.csv包含每个单元格的FACS标签。对于某些数据集,如造血细胞,在计算ari之前,用户应忽略所有"未知"细胞。 默认情况下,APEC使用Monocle从Accesson Matrix生成伪时间轨迹: 输入参数: 输出文件: 在python3环境中,用户还可以使用paga生成轨迹: 输出文件: 带有注释标签的伪时间轨迹pdf 输入参数: 输出文件: 用户还可以通过tss区域周围的峰值来评分基因: 输出文件: 获取差异访问: 获取差异基序/基因: 输入参数: 输出文件: 输入参数: 输出文件: 吉恩·福克索伊(Gene_Foxo1_on_Tsne_by_Apec.pdf) Motif_gata1_on_trailway_by_apec.pdf 注意:TSNE图上的绘图功能需要预先运行plot.plot_tsne()(见3.1),而轨迹上的绘图功能需要预先运行generate.monocle_tracky()(见3.4)。 输入参数: 输出文件: 以下所有软件都需要放在linux系统的全局环境中,以确保可以在任何路径/文件夹中调用它们。picard也是必需的,但是我们已经将它放入$apec/reference文件夹中,用户不需要安装它。我们建议用户采用这些软件的最新版本,但Meme(4.11.2版)除外。 用户只需将code_v1.1.0文件夹和reference文件夹复制到同一路径即可安装此部件。用户必须在代码v1.1.0/中直接运行apec prepare_steps.sh,因为每个程序都将自动调用引用文件。引用文件夹是必需的,但是我们没有将引用文件上载到github,因为它们太大。用户可以从http://galaxy.ustc.edu.cn:30803/apec/" rel="nofollow">http://galaxy.ustc.edu.cn:30803/apec/下载所有参考文件。参考文件夹应包含以下文件: 原始数据文件夹应包含将所有原始排序fastq文件放入。所有这些双端fastq文件都应命名为: 其中"_1"和"_2"表示对端排序的正向和反向读取。{type1,type2,…}可以是单元格类型或样本批次,例如{gm,k562,…},或{batch1,batch2,…},或任何其他不带下划线的单词"\u"或短划线"-"。
用户需要构建一个项目文件夹来存储结果。work、matrix、peak和figure文件夹将通过后续步骤自动生成,并放置在project文件夹中。 用户可以使用脚本apec prepare_steps.sh完成从原始数据到片段计数矩阵的过程。此脚本包括"修剪"、"映射"、"峰值调用"、"对齐读取计数矩阵"和"质量控制"等步骤。在我们的示例项目(即带有672个单元格的Project01)上运行此步骤将在8核32GB计算机上花费10到20个小时,因为序列映射步骤是最慢的步骤。 示例: 输入参数: 输出文件: 脚本apec_prepare_steps.sh将生成包含许多输出文件的work、peak、matrix和figure文件夹。这里,我们只介绍对用户有用的文件。对于我们的示例项目,所有这些结果都可以在通用计算机系统上复制。 (1)在工作文件夹中: 对于每个单元格,映射步骤可以在work文件夹中生成一个子文件夹(具有单元格名称)。每个子文件夹中都有几个有用的文件: (2)在峰值文件夹中: (3)在矩阵文件夹中: (4)在图文件夹中:hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
1.2安装并导入apec
pip install APEC==1.1.0.8
pip install scanpy anndata
from APEC import clustering,plot,generate
<H3>2。输入数据help(clustering.cluster_byAccesson)
<H3>3。亚太经合组织的职能(逐步)filtered_cells.csv: Two-column (separated by tabs) list of cell information ('name' and 'notes'):
The 'name' column stores cell names (or barcodes); the 'notes' column can be cell-type,
development stage, batch index or any other cell information, such as:
name notes
CD4-001 CD4
CD4-002 CD4
CD8-001 CD8
CD8-002 CD8
top_filtered_peaks.bed: Three-column list of peaks, which is a standard bed format file.
It is similar to the "peaks.bed" file in the CellRanger output of a 10X scATAC-seq dataset.
filtered_reads.mtx: Fragment count matrix in mtx format, where each row is a peak and each column represents a cell.
It is similar to the "matrix.mtx" file in the CellRanger output of a 10X scATAC-seq dataset.
The order of cells should be the same with "filtered_cells.csv", and the order of peaks should
be the same with "top_filtered_peaks.bed".
3.1按亚太经合组织分类
clustering.build_accesson('$project', ngroup=600)
clustering.cluster_byAccesson('$project', norm='zscore')
ngroup: Number of accessons, default=600.
nc: Number of cell clusters, set it to 0 if users want to predict cluster number by Louvain algorithm, default=0.
norm: Normalization method for accesson matrix, can be 'zscore' or 'probability', default='zscore'.
filter: Filter high dispersion accessons or not, can be 'yes' or 'no', default='yes'.
0
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
1
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
2
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
3
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
3.2按chromvar聚类(可选,模体分析所需)
4
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
5
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
6
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
3.3评价者e ari、nmi和ami用于聚类结果
7
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
3.4生成伪时间轨迹
8
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
9
Bedtools: http://bedtools.readthedocs.io/en/latest/content/installation.html
Meme 4.11.2: http://meme-suite.org/doc/download.html?man_type=web
Homer: http://homer.ucsd.edu/homer/
0
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
1
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
2
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
3.5产生基因表达
3
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
4
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
5
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
6
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
7
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
3.6为单元簇生成差异特征
8
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
9
hg19_RefSeq_genes.gtf, hg19_chr.fa, hg19_chr.fa.fai,
mm10_RefSeq_genes.gtf, mm10_chr.fa, mm10_chr.fa.fai,
JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt, tier1_markov1.norc.txt
0
pip install APEC==1.1.0.8
1
pip install APEC==1.1.0.8
3.7在tsne/轨迹图上绘制基序/基因
2
pip install APEC==1.1.0.8
3
pip install APEC==1.1.0.8
4
pip install APEC==1.1.0.8
3.8生成潜在的超级增强剂
5
pip install APEC==1.1.0.8
6
pip install APEC==1.1.0.8
7
pip install APEC==1.1.0.8
从原始数据中获取片段计数矩阵
(此部分仅在github上可用:https://github.com/qukunlab/apec)
<H3>1。要求和安装
8
pip install APEC==1.1.0.8
1.2安装
9
<H2>2。片段计数矩阵pip install APEC==1.1.0.8
2.1原始数据的安排
0
pip install scanpy anndata
2.2基质制备的简单操作
1
pip install scanpy anndata
2
pip install scanpy anndata
3
pip install scanpy anndata
4
pip install scanpy anndata
5
pip install scanpy anndata
6
pip install scanpy anndata
推荐PyPI第三方库