Entering edit mode
Dear all,
I am trying to find a way to convert a bed
to .bigBed
file in R using the rtracklayer Bioconductor package.
I have heard that it is possible to do the conversion, but I have not found any other way apart from Kent Utilities.
Any help or guidance is highly appreciated. Thank you for your time
Thank you, James, for the guidance. I have learnt a lot, but I am struggling heavily to export a .bigBed file. I am running from error to error.
Here is a link to the file that I am trying to convert to.bigBed and this is what I am doing
The size of each chromosome is
I am not sure why these ranges are out of bounds, and then when I try to export it to bigBed, it's a disaster.
Any hint or clue on how to move on, is highly appreaciated
If you use
rtracklayer
(importBed
is not a function inrtracklayer
), it should be a simple one-liner. Using the example data from?export.bb
, as I don't have a bed file handyIt's not clear to me why you are doing all that conversion to a
data.frame
and back. There are any number of ways you can modify aGRanges
object directly, so coercing to and from other data formats is probably not necessary. I also don't use the tidyverse as a general rule, as it's usually IMO a repackaging of things that you could already do, but more easily. For exampleIs, if I understand correctly, the same as
And more to the point, you can just do
Also, the error you get from the validity test is telling you that there are almost 5000 sequences on chromosome 5 that are past the length (18585056) that you specified for that chromosome. Either your chromosome length is wrong, or the bed file is wrong.
The final error looks like a tidyverse collision to me. I am 99.999% sure that there is no function
t
used inexport.bb
that has a color specification.Thank you so much, James. I have already learnt a lot. I ll study your reply and come back. Thank you again for your time