umi_tools使用

首先保存两个网址:

umi_tools github网址:https://github.com/CGATOxford/UMI-tools

umi_tools 官方网址:https://umi-tools.readthedocs.io/en/latest/

1. 提取UMI信息到readname

umi_tools extract --bc-pattern=NNNNNNN --bc-pattern2=NNNNNNN \
        -I ./V300056107_L01_1069_1.fq.gz \
        -S ./test.extract.reconcile.1.pe_1.fq \
        --read2-in=./V300056107_L01_1069_2.fq.gz \
        --read2-out=./test.extract.reconcile.1.pe_2.fq \
        --ignore-read-pair-suffixes

       还可以加一个“--reconcile-pairs”,如果是在rawdata处开始做 extract的时候,这个是没必要的。

报错1.

Read pairs do not match
F300002275L1C001R0030000002/1 != F300002275L1C001R0030000002/2

这种不是真正的不匹配,而是umi_tools的一个bug。

可以用 --ignore-read-pair-suffixes 参数来忽略 “/”及以后的内容。

通过master branch 安装的umi_tools有这个“--ignore-read-pair-suffixes”参数,

原来那个umi_tools的问题,是这个工具与相应的python版本不对应的问题。 
https://github.com/CGATOxford/UMI-tools/issues/431      #这是umi_tools项目组成员的解答

报错2. 如果出现:

Read pairs do not match
F300002275L1C001R0030000005 != F300002275L1C001R0030000013

说明这是fq1和fq2里面的reads不是一一对应的,readname也对应不上。

它在输出文件中只会输出配对的reads处理后的结果,其他不配对的,全都在标准错误中输出。

这时候可以加“--reconcile-pairs”,这样就允许read1和read2中的read name不匹配。

问题3:umi_tools 跑得太慢的问题:
https://github.com/CGATOxford/UMI-tools/issues/257

解决方法是: 输出文件不要加“.gz”格式后缀。

我试过,加了gz后缀,耗时8小时左右,不加,差不多40分钟。

=====================================================================================

我从一开始用python2,然后换到python3.7, 最后换到python3.6

CTTGCAAGTCACTAGAGTGGTGCAGCCTATTTTTTAAAAGTCGTGTGTGTCCTCTTACCCAGTACTTCCTCTTCATATGCACCTTCCGCGCTGCTACAGC
CTTGCATTTACTGCAGGGGAAATAGTTGACATAAAGATGTACTTGCGTATTAGGCACTCCGATTTCAAAGATTTACTCGTATATTGGTCAAAGATATACT

@F300002275L1C001R0030000002/1_CTTGCAACTTGCAT
GTCACTAGAGTGGTGCAGCCTATTTTTTAAAAGTCGTGTGTGTCCTCTTACCCAGTACTTCCTCTTCATATGCACCTTCCGCGCTGCTACAGC

@F300002275L1C001R0030000002/2_CTTGCAACTTGCAT
TTACTGCAGGGGAAATAGTTGACATAAAGATGTACTTGCGTATTAGGCACTCCGATTTCAAAGATTTACTCGTATATTGGTCAAAGATATACT

2. 去低质量、含Nreads, mapping, sort, index: 略

3. dedup (类似picard的markdup)

umi_tools dedup -I ./test.coordinate.sort.bam \
        --output-stats=deduplicated \
        -S ./test.marked_duplicates.directional.bam \
        --method directional --paired

注: --method 参数有5种可选值;作者认为directional是最好的:https://github.com/CGATOxford/UMI-tools/issues/435

        --paired 参数对于PE reads来说必不可少,否则它会只输出read2,不输出read1.

dedup太慢解决方法:https://github.com/CGATOxford/UMI-tools/issues/340

The biggest thing you can do here to improve things is not generate the stats    #也就是不要--output-stats=deduplicated 这个参数。

结果比较:

coordinate.sort.bam     38078276        #before_dedup
marked_duplicates.adjacency.bam 35220427        #adjacency
marked_duplicates.cluster.bam   35219515        #cluster
marked_duplicates.directional.bam       35219616        #directional,作者团队成员推荐这个
marked_duplicates.percentile.bam        35483003        #percentile
marked_duplicates.unique.bam    35483001        #unique
marked_duplicates.picard.bam    34350858        #picard
 

UMI序列设置:

In the default basic mode we specify the location of barcodes and UMIs in a read using a simple string. Ns specify the location of bases to be treated as UMIs, Cs as bases to treated as cell barcode and Xs as bases that are neither and that should be retained on the read. By default this pattern is applied to the 5’ end of the read, but we can tell extract to look on the 3’ end of the read using --3-prime

https://umi-tools.readthedocs.io/en/latest/regex.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值