为一组表中的每个表检索一列,并将它们放在单个输出表中。
collect-columns的Python项目详细描述
收集列
此工具从一组表中的每个表中检索一列,并编译为一个表。 可选地,可以将相关gtf/gff文件中的其他属性添加到输出中 桌子。
安装
从pypi安装:pip install collect-columns
从github安装:
- 克隆存储库:
git clone https://github.com/biowdl/collect-columns.git
- 输入存储库:
cd collect-columns
- 使用pip安装:
pip install .
用法
collect-columns output_path input_files...
它假设所有的输入计数表都采用相同的格式。
默认情况下,格式假定为无标题和制表符分隔,并使用
第一列是特征标识符,第二列是感兴趣的值。
输出表将使用与输入表相同的分隔符,并包含
头球。feature
列将包含特征标识符、值
列将根据输入文件或给定的名称命名
通过-n
选项,该选项将名称列表作为参数。
为了使用不同的输入格式,可以提供以下选项:
option | arguments | definition |
---|---|---|
^{ | a number | The index of the column containing the feature identifiers. |
^{ | a number | The index of the column containing the values/counts. |
^{ | a character | The separator. |
^{ | Indicates that the table has a header. |
要从gtf/gff添加其他属性,可以提供以下选项:
option | arguments | definition |
---|---|---|
^{ | a list of words | The attributes to be added to the output table. |
^{ | a path | The gtf file from which the attributes will be retrieved. |
^{ | a word | The attribute used to map rows in the input tables to gtf record. Defaults to ^{ |
示例
htseq计数
使用htseq count的输出作为输入,执行以下命令:
collect-columns all.tsv s1.tsv s2.tsv
将生成如下表格:
feature | s1.tsv | s2.tsv |
---|---|---|
MSTRG.1 | 10 | 11 |
MSTRG.2 | 60 | 12 |
... | ... | ... |
纵梁
使用Stringtie丰度输出作为输入,以下命令:
collect-columns all.FPKM s1.abundance s2.abundance \
-c 7 \
-H \
-a ref_gene_id gene_name \
-g merged.gtf \
-n sample1 sample2
将生成如下表格:
feature | ref_gene_id | gene_name | sample1 | sample2 |
---|---|---|---|---|
MSTRG.1 | g_1 | gene_1 | 185151.953125 | 151.964231 |
MSTRG.2 | g_2 | gene_2 | 100160.070312 | 1160.030213 |
... | ... | ... | ... | ... |