Entering edit mode
li lilingdu
▴
450
@li-lilingdu-1884
Last seen 6.6 years ago
Hi,
I used "rtracklayer' and ran into some problems in using
browserSession() function.
I traced back the code and found somthing might wrong in the "hguid"
slot of a "ucscSession" object.
Followin was the code I used.
========================================
library(rtracklayer)
#browserSession("ucsc")
##error!!!
Class<-"ucscSession"
ClassDef <- getClass(Class, where = topenv(parent.frame()))
value <- .Call("R_do_new_object", ClassDef, PACKAGE = "base")
value at url <- "http://genome.ucsc.edu/cgi-bin/"
value at views<-new.env()
handle<-getCurlHandle()
getURL("http://genome.ucsc.edu/cgi-bin/hgGateway", cookiefile =
tempfile(),curl = handle)
cart <- getURL("http://genome.ucsc.edu/cgi-bin/hgTracks", curl =
handle)
vlaue at hguid<-as.numeric(gsub(".*hguid=([^\n]*).*","\\1", cart))
#[1] NA
#Warning message:
#NAs introduced by coercion
grep("hguid",cart)
#integer(0)
========================================
As shown in the above result, "hguid" will be NA as will lead to the
subsequent underling code of browserSession("ucsc") to be failed.
How to fix this problem? Or this might related to 'cookie' or
'handle'?
Thanks!
----
LiGang