I am trying to generate bedGraph track file from GRanges object in R using rtracklayer
package.
I have found that export.bedGraph()
routine uses 'score' meta column of GRanges
object and can be supplemented with trackLine
argument of class GraphTrackLine
as track header. Constructor of new('GraphTrackLine', ...)
object requires color argument of type integer
(vector). I have provided argument value color=col2rgb("red")[,1]
and results output track header formatted as
track name=<name> description=<desc> color="0","255","0"
While IGV is able to open and present the same file, but UCSC Genome Browser 'MyData/Custom Tracks/Add custom track' fails with
Error File 'filename.bedGraph' - line 1 of custom input: variable needs to start with letter ',"255","0"'
Please help me to workaround color property format incompatibility.
Your question is pretty close to undecipherable. Please read the tutorial for posting to this support site, and reformat.
James, thank you for your interest. I have tried to highlight keys in question. Please be lenient with I'm not a native English speaker.