用于制作美观且可重复的基因组浏览器快照的命令行工具
项目描述
pyGenomeTracks
独立程序和库,用于绘制美观的基因组浏览器轨迹
pyGenomeTracks旨在生成高度可定制的、高质量的基因组浏览器轨迹。目前,可以绘制
- bigwig
- bed/gtf(许多选项)
- bedgraph
- bedgraph矩阵(如TAD分离分数)
- epilogos
- 窄峰
- 链接(表示为弧线、三角形或正方形)
- Hi-C矩阵(三角形或正方形)
- fasta
- maf(多序列比对格式)
以下是pyGenomeTracks工作原理的示意图(来自Lopez-Delisle等. 2020的图形摘要)
pyGenomeTracks可以在有或没有Hi-C数据的情况下生成图表。以下是从Ramírez等. 2017的pyGenomeTracks输出示例
目录
安装
pyGenomeTracks 需要 python >=3.8。
推荐通过 conda 安装 pyGenomeTracks。
conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks
要获取特定版本,可以指定版本。例如
conda create -n pygenometracks -c bioconda -c conda-forge pygenometracks=3.5 python=3.7
然而,我们注意到 conda 安装可能相当慢,所以使用 mamba 可以有所帮助。首先需要创建环境并安装 mamba
conda create -n pygenometracks -c bioconda -c conda-forge mamba python=3.9
然后激活环境并使用 mamba 安装 pygenometracks
conda activate pygenometracks
mamba install -c conda-forge -c bioconda pygenometracks
或如果您需要特定版本
conda create -n pygenometracks -c bioconda -c conda-forge mamba python=3.7
conda activate pygenometracks
mamba install -c conda-forge -c bioconda pygenometracks=3.5
此外,也可以使用 pip 安装 pyGenomeTracks
pip install pyGenomeTracks
从版本 3.5 开始,pyGenomeTracks 使用 BEDTools,请务必安装它或将它加载到您的环境中。
使用
要运行 pyGenomeTracks,需要一个描述 tracks 的配置文件。创建此文件的最简单方法是使用程序 make_tracks_file
,该程序创建一个具有默认值的配置文件,可以轻松更改。格式如下
make_tracks_file --trackFiles <file1.bed> <file2.bw> ... -o tracks.ini
make_tracks_file
根据文件扩展名猜测文件类型。
然后,可以使用以下方式绘制区域
pyGenomeTracks --tracks tracks.ini --region chr2:10,000,000-11,000,000 --outFileName nice_image.pdf
结尾 --outFileName
定义了图像格式。如果使用 .pdf
,则结果图像为 pdf。选项是 pdf、png 和 svg。
其他可能参数的描述
options:
-h, --help show this help message and exit
--tracks TRACKS File containing the instructions to plot the tracks.
The tracks.ini file can be genarated using the
`make_tracks_file` program.
--region REGION Region to plot, the format is chr:start-end
--BED BED Instead of a region, a file containing the regions to
plot, in BED format, can be given. If this is the
case, multiple files will be created. It will use the
value of --outFileName as a template and put the
coordinates between the file name and the extension.
--width WIDTH figure width in centimeters (default is 40)
--plotWidth PLOTWIDTH
width in centimeters of the plotting (central) part
--height HEIGHT Figure height in centimeters. If not given, the figure
height is computed based on the heights of the tracks.
If given, the track height are proportionally scaled
to match the desired figure height.
--title TITLE, -t TITLE
Plot title
--outFileName OUTFILENAME, -out OUTFILENAME
File name to save the image, file prefix in case
multiple images are stored
--fontSize FONTSIZE Font size for the labels of the plot (default is 0.3 *
figure width)
--dpi DPI Resolution for the image in case the ouput is a raster
graphics image (e.g png, jpg) (default is 72)
--trackLabelFraction TRACKLABELFRACTION
By default the space dedicated to the track labels is
0.05 of the plot width. This fraction can be changed
with this parameter if needed.
--trackLabelHAlign {left,right,center}
By default, the horizontal alignment of the track
labels is left. This alignemnt can be changed to right
or center.
--decreasingXAxis By default, the x-axis is increasing. Use this option
if you want to see all tracks with a decreasing
x-axis.
--version show program's version number and exit
引用
如果您在分析中使用 pyGenomeTracks,可以引用以下论文
Fidel Ramírez, Vivek Bhardwaj, Laura Arrigoni, Kin Chung Lam, Björn A. Grüning, José Villaveces, Bianca Habermann, Asifa Akhtar & Thomas Manke. 高分辨率 TADs 揭示了苍蝇基因组组织的 DNA 序列。Nature Communications (2018) doi:10.1038/s41467-017-02525-w
Lopez-Delisle L, Rabbani L, Wolff J, Bhardwaj V, Backofen R, Grüning B, Ramírez F, Manke T. pyGenomeTracks:多变量基因组数据集的可重复绘图。Bioinformatics. 2020 Aug 3:btaa692. doi: 10.1093/bioinformatics/btaa692. Epub ahead of print. PMID: 32745185.
文档
我们的文档提供了示例,以及可能的参数完整列表和希望添加新 track 类型的开发者的指南。
外部用户
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。