Stringtie 计算转录组的 Raw Counts

Stringtie 自带一个脚本prepDE.py用于计算转录组的 Raw Counts,用法如下:

Usage: prepDE.py [options]

Generates two CSV files containing the count matrices for genes and
transcripts, using the coverage values found in the output of `stringtie -e`

Options:
  -h, --help            show this help message and exit
  -i INPUT, --input=INPUT, --in=INPUT
                        a folder containing all sample sub-directories, or a
                        text file with sample ID and path to its GTF file on
                        each line [default: ./]
  -g G                  where to output the gene count matrix [default:
                        gene_count_matrix.csv
  -t T                  where to output the transcript count matrix [default:
                        transcript_count_matrix.csv]
  -l LENGTH, --length=LENGTH
                        the average read length [default: 75]
  -p PATTERN, --pattern=PATTERN
                        a regular expression that selects the sample
                        subdirectories
  -c, --cluster         whether to cluster genes that overlap with different
                        gene IDs, ignoring ones with geneID pattern (see
                        below)
  -s STRING, --string=STRING
                        if a different prefix is used for geneIDs assigned by
                        StringTie [default: MSTRG]
  -k KEY, --key=KEY     if clustering, what prefix to use for geneIDs assigned
                        by this script [default: prepG]
  -v                    enable verbose processing
  --legend=LEGEND       if clustering, where to output the legend file mapping
                        transcripts to assigned geneIDs [default: legend.csv]

需要准备一个 2 列的文本文件,例如命名为all_gtf,以Tab键分隔,如:

sample1 sample1.gtf
sample2 sample2.gtf
...
  • 第 1 列,样本名称

  • 第 2 列,Stringtie 生成的 GTF 文件,要求运行 stringtie 的时候加-e参数

准备好后,运行:

$ prepDE.py -i all_gtf -v

不料却报以下错误:

Traceback (most recent call last):
  File "/ifs/miniconda3/bin/prepDE.py", line 284, in <module>
    geneDict.setdefault(geneIDs[i],{}) #gene_id
KeyError: 'ENST00000496112'

检查prepDE.py的源代码无果,正一筹莫展时,突然想到输入prepDE.pyTab键代码补全时,还显示有一个prepDE.py3文件的存在,于是抱着试试看的心态,运行:

$ prepDE.py3 -i all_gtf -v

没报错。。。焦急等待中。。。最后输出如下结果:

..writing transcript_count_matrix.csv
..writing gene_count_matrix.csv
All done.
  • transcript_count_matrix.csv,转录本水平定量结果;

  • gene_count_matrix.csv,基因水平定量结果。

今天遇到这个坑是由于程序的版本造成的,换 Python3 版本的程序prepDE.py3就好了。

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值