[英]Convert BED file to WIG file
Do you know any way to convert easily (either by R, or with other program) a BED file to WIG?您知道有什么方法可以轻松地(通过 R 或其他程序)将 BED 文件转换为 WIG?
Can you give me some guidelines?你能给我一些指导吗?
Take a look at the rtracklayer package and specifically at the following man pages:查看rtracklayer包,特别是以下手册页:
?import
?export
Here is a specific example of how I would convert .bed
to .wig
.这是我如何将
.bed
转换为.wig
的具体示例。 As @Paolo implied, it's a straight-forward procedure:正如@Paolo 暗示的那样,这是一个直接的过程:
library(rtracklayer) #bioconductor
bed_loaded <- import(con="~/Downloads/my_bed.bed.gz", format="bed") #no need to unzip .gz
# bed_loaded <- import.bed(con="~/Downloads/my_bed.bed") #if you unzip
export.wig(object=bed_loaded, con="~/Downloads/bed2wig.wig")
Note that you import
and export
both have methods (wig, bed, bigwig or bw, etc.).请注意,您的
import
和export
都有方法(wig、bed、bigwig 或 bw 等)。 You may directly use them without specifying the method but specifying format
argument.您可以直接使用它们而不指定方法但指定
format
参数。
This GitHub tutorial will be helpful.这个GitHub 教程会很有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.