Open Hami7407 opened 2 years ago
Dear Hami,
in my hands, with the example data from the vignette, the command works properly and produces one file containing two tracks. However, the tracks have the same name; is that the cause of your problem?
Have a nice day,
-- Charles
hmm... I only can download CAGE Tag cluster file which are not divided into two strands even though I export the data after split them into two. When I open the file, it has only positive numbers.
I thought I don't have to specify which strand I want to download if I use export.bedGraph command. Could you help me with this? It was all working with the CAGEr previous version.
Thank you,
Best
Can you try something like:
trkBG <- split(trk, strand(trk), drop = TRUE)
trkBG[['+']]@trackLine@name <- paste0(trkBG[['+']]@trackLine@name, " +")
trkBG[['-']]@trackLine@name <- paste0(trkBG[['-']]@trackLine@name, " -")
trkBG[['+']]@trackLine@description <- paste0(trkBG[['+']]@trackLine@description, ", + strand")
trkBG[['-']]@trackLine@description <- paste0(trkBG[['-']]@trackLine@description, ", - strand")
rtracklayer::export.bedGraph(trkBG, "myBedGraphTrack.bedGraph")
If it works I will correct the documentation and try to add a function for such strand splitting.
Thank you for the suggestion! However, it only gives me + strand... somehow I can't download minus strand
Sorry for the issues!
Can you double-check that the minus-strand information is present in the data you send to the UCSC browser? On my computer, with CAGEr's example data I have:
$ grep track myBedGraphTrack.bedGraph
track name="Zf.30p.dome (TC)+" description="Zf.30p.dome (CAGE Tag Clusters (TC))" visibility=full type=bedGraph
track name="Zf.30p.dome (TC)-" description="Zf.30p.dome (CAGE Tag Clusters (TC))" visibility=full type=bedGraph
Also, if I remember well the previous version of CAGEr was exporting the plus and minus strand in separate files. You can still do that too with something like:
rtracklayer::export.bedGraph(trkBG[['+']], "myBedGraphTrackPlus.bedGraph")
rtracklayer::export.bedGraph(trkBG[['-']], "myBedGraphTrackMinus.bedGraph")
trkBG <- split(trk, strand(trk), drop = TRUE) trkBG[['+']]@trackLine@name <- paste0(trkBG[['+']]@trackLine@name, " +") trkBG[['-']]@trackLine@name <- paste0(trkBG[['-']]@trackLine@name, " -") trkBG[['+']]@trackLine@description <- paste0(trkBG[['+']]@trackLine@description, ", + strand") trkBG[['-']]@trackLine@description <- paste0(trkBG[['-']]@trackLine@description, ", - strand") rtracklayer::export.bedGraph(trkBG, "myBedGraphTrack.bedGraph")
Sorry, I checked again with UCSC browser and minus strand exists! so the last code you gave me works!
Thank you
Hello, I am trying to export to the BedGraph File.
However, I only receive tag cluster file not divided into two strands.
This is what I did
Same thing happens when I used rtracklayer::export.bedGraph(trk, "Adult_brain_1S.bedGraph")
How can I get a bedGraph file of two different strands?
Thank you