Question: rtracklayer colorByStrand - is it possible to add quotes?
0
gravatar for Janet Young
17 months ago by
Janet Young730
Fred Hutchinson Cancer Research Center, Seattle, WA, USA
Janet Young730 wrote:

Hi there,

I'm using rtracklayer's export function to get a bed file, and then I upload that file manually to the UCSC genome browser via my web browser. 

I am using the trackLine/colorByStrand function - it seems to be almost working fine, but not quite. It would be great if the colorByStrand option could put quotes around the color specifications.  Hopefully the code below shows the issue.

Thanks,

Janet

 

library(rtracklayer)
gr <- GRanges(seqnames="chr1", ranges=IRanges(start=c(1000,2000), width=100), strand=c("+","-") )
myColors <- cbind(col2rgb("red"),col2rgb("blue"))
myTrack <- new("BasicTrackLine", name="gr", description="gr", colorByStrand=myColors )
myTrack 
# track name=gr description=gr colorByStrand=255,0,0 0,0,255 
export(gr, "gr.bed", "BED", trackLine=myTrack )

### I get an error when I upload that to UCSC browser. Error looks like this:
# Error File 'gr.bed' - line 1 of custom input: variable needs to start with letter '0,0,255'

### the UCSC error goes away if I add quotes around the colors in the track line, like this
# track name=gr description=gr colorByStrand="255,0,0 0,0,255" 

sessionInfo()

R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.4

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rtracklayer_1.38.3   GenomicRanges_1.30.3 GenomeInfoDb_1.14.0  IRanges_2.12.0       S4Vectors_0.16.0     BiocGenerics_0.24.0 

loaded via a namespace (and not attached):
 [1] lattice_0.20-35            matrixStats_0.53.1         XML_3.98-1.10              Rsamtools_1.30.0          
 [5] Biostrings_2.46.0          GenomicAlignments_1.14.2   bitops_1.0-6               grid_3.4.3                
 [9] zlibbioc_1.24.0            XVector_0.18.0             Matrix_1.2-12              BiocParallel_1.12.0       
[13] tools_3.4.3                Biobase_2.38.0             RCurl_1.95-4.10            DelayedArray_0.4.1        
[17] compiler_3.4.3             SummarizedExperiment_1.8.1 GenomeInfoDbData_0.99.0   
rtracklayer • 327 views
ADD COMMENTlink modified 17 months ago • written 17 months ago by Janet Young730
Answer: rtracklayer colorByStrand - is it possible to add quotes?
0
gravatar for Michael Lawrence
17 months ago by
United States
Michael Lawrence11k wrote:

Thanks, should be fixed in devel, 1.39.10. Btw, potential bugs are often better reported as a GitHub issue.

ADD COMMENTlink written 17 months ago by Michael Lawrence11k
Answer: rtracklayer colorByStrand - is it possible to add quotes?
0
gravatar for Janet Young
17 months ago by
Janet Young730
Fred Hutchinson Cancer Research Center, Seattle, WA, USA
Janet Young730 wrote:

Thanks, Michael - appreciate it. Yes, I'll start using github instead for stuff like this.   

Maybe the github pages are worth a mention on http://www.bioconductor.org/help/support/posting-guide/  ?         

ADD COMMENTlink written 17 months ago by Janet Young730
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 289 users visited in the last hour