经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 程序设计 » R语言 » 查看文章
R语言版本的bedtools--bedtoolsr
来源:cnblogs  作者:GenomeX  时间:2021/2/22 9:06:44  对本文有异议

bedtools是一款非常强大的用于处理bed,vcf,gff等格式数据的工具,该软件由犹他大学的Quinlan实验室开发。但是目前bedtools主要提供的是在linux,unxi等操作系统环境下的“命令行”运行方式,然而,对于想要使用R语言进行bedtools命令操作的科研人员来说就显得比较麻烦。今天,我就给大家介绍一款由北卡罗来纳大学教堂山分校开发的R语言版本的bedtools--bedtoolsr。话不多说,直接上干货。

  • 安装bedtoolsr
  1. install.packages("devtools")
  2. devtools::install_github("PhanstielLab/bedtoolsr") # 首次使用需要安装
  • 加载bedtoolsr
  1. library(bedtoolsr)
  • 生成测试数据
  1. A.bed <- data.frame(chr = c("chr1", "chr1", "chr3"), start = c(10, 100, 50), end = c(40, 150, 110))
  2. B.bed <- data.frame(chr = c("chr1", "chr5"), start = c(20, 60), end = c(35, 80))
  3. print(A.bed)
  4. # chr start end
  5. #1 chr1 10 40
  6. #2 chr1 100 150
  7. #3 chr3 50 110
  8. print(B.bed)
  9. # chr start end
  10. #1 chr1 20 35
  11. #2 chr5 60 80
  • 调用方法,这里主要介绍两种。bedtoolsr的函数跟bedtools的方法几乎是一一对应的。甚至函数名,参数名几乎都一样。因此,可以即便是新手,也可以快速入手bedtoolsr。下面以intersect方法为例,讲解调用方法。
  1. #调用方法一
  2. bt.intersect(a = A.bed, b = B.bed)
  3. #output
  4. # V1 V2 V3
  5. #1 chr1 20 35
  6. #调用方法二
  7. bedtoolsr::bt.intersect(a = A.bed, b = B.bed)
  8. #output
  9. # V1 V2 V3
  10. #1 chr1 20 35
  11. #intersect所有参数
  12. # a,
  13. # b,
  14. # wa = NULL,
  15. # wb = NULL,
  16. # loj = NULL,
  17. # wo = NULL,
  18. # wao = NULL,
  19. # u = NULL,
  20. # c = NULL,
  21. # C = NULL,
  22. # v = NULL,
  23. # ubam = NULL,
  24. # s = NULL,
  25. # S = NULL,
  26. # f = NULL,
  27. # F = NULL,
  28. # r = NULL,
  29. # e = NULL,
  30. # split = NULL,
  31. # g = NULL,
  32. # nonamecheck = NULL,
  33. # sorted = NULL,
  34. # names = NULL,
  35. # filenames = NULL,
  36. # sortout = NULL,
  37. # bed = NULL,
  38. # header = NULL,
  39. # nobuf = NULL,
  40. # iobuf = NULL,
  41. # output = NULL
  • bedtoolsr中所有的函数
函数名 函数名 函数名
bt.annotate bt.bamtobed bt.bamtofastq
bt.bed12tobed6 bt.bedpetobam bt.bedtobam
bt.closest bt.cluster bt.closest
bt.cluster bt.complement bt.coverage
bt.expand bt.fisher bt.flank
bt.genomecov bt.getfasta bt.groupby
bt.igv bt.intersect bt.jaccard
bt.links bt.makewindows bt.map
bt.maskfasta bt.merge bt.multicov
bt.multiinter bt.nuc bt.overlap
bt.pairtobed bt.pairtopair bt.random
bt.reldist bt.sample bt.shift
bt.shuffle bt.slop bt.sort
bt.spacing bt.split bt.subtract
bt.summary bt.tag bt.unionbedg
bt.window

原文链接:http://www.cnblogs.com/rxzhang/p/14420355.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号