首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >samtools相当慢

samtools相当慢
EN

Stack Overflow用户
提问于 2022-02-08 16:52:07
回答 1查看 65关注 0票数 2

我使用"samtools calmd“将MD标记添加回BAM文件。原始BAM的大小约为50 of (利用pacbio HIFI读取的全基因组序列)。我遇到的问题是“冷静”的速度非常慢!作业已经运行了12个小时,只生成了带有MD标记的600 MD。这样,50 In的BAM将需要30天才能完成!

下面是我用来添加MD标记的代码(非常正常):

代码语言:javascript
复制
rule addMDTag:
    input:
        rules.pbmm2_alignment.output        
    output: 
        strBAMDir + "/pbmm2/v37/{wcReadsType}/Tmp/rawReads{readsIndex}.MD.bam"               
    params:
        ref = strRef
    threads:
        16
    log:
        strBAMDir + "/pbmm2/v37/{wcReadsType}/Log/rawReads{readsIndex}.MD.log"
    benchmark:
        strBAMDir + "/pbmm2/v37/{wcReadsType}/Benchmark/rawReads{readsIndex}.MD.benchmark.txt"
    shell:
        "samtools calmd -@ {threads} {input} {params.ref} -bAr > {output}"

我使用的samtools版本是v1.10。

顺便说一句,我使用16个核心来运行calmd,但是,samtools仍然使用一个核心来运行它:

代码语言:javascript
复制
top - 11:44:53 up 47 days, 20:35,  1 user,  load average: 2.00, 2.01, 2.00
Tasks: 1723 total,   3 running, 1720 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.8%us,  0.3%sy,  0.0%ni, 96.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  529329180k total, 232414724k used, 296914456k free,    84016k buffers
Swap: 12582908k total,    74884k used, 12508024k free, 227912476k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                       
 93137 lix33     20   0  954m 151m 2180 R 100.2  0.0 659:04.13 samtools 

我能知道如何使镇静更快吗?还是有其他工具可以更有效地完成同样的工作?

非常感谢

EN

回答 1

Stack Overflow用户

发布于 2022-02-11 21:24:56

在与samtools维护团队协作之后,这个问题已经解决了。如果bam没有被分类的话,平静会非常慢。因此,始终确保在运行冷静之前已对BAM进行了排序。

详情见下文:

代码语言:javascript
复制
Are your files name sorted, and does your reference have more than one entry? 
If so calmd will be switching between references all the time, 
which means it may be doing a lot of reference loading and not much MD calculation.

You may find it goes a lot faster if you position-sort the input, and then run it through calmd.
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71037705

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档