calling bedtools from R
1
4
Entering edit mode
9.7 years ago
yasjas ▴ 70

good morning,

is there any function to call bedtools from R rather than do it from the shell and then bring the files to R?

Thanks

R BEDTOOLS • 6.8k views
ADD COMMENT
4
Entering edit mode
Instead of using bedtools you could also have a look into the GenomicRanges bioconductor library.
ADD REPLY
8
Entering edit mode
9.7 years ago
PoGibas 5.1k

Yes, there are many ways.

You can invoke system commands using system. Or you can use fread from data.table package (adding my simple example).

library(data.table)
cmd <- "bedtools closest -a FileA -b FileB"
df <- fread(cmd)
ADD COMMENT
3
Entering edit mode

pipe() is useful too.

ADD REPLY
2
Entering edit mode

Thank you for your replies it worked!!!!!

ADD REPLY
1
Entering edit mode

I had no idea one could use fread for that. Thanks!

ADD REPLY

Login before adding your answer.

Traffic: 1313 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6