langmead-lab / snapcount

R Package for interfacing with Snaptron for rapid querying of expression counts
MIT License
3 stars 1 forks source link

PSI and JIR high level functions will fail first time they're called with a "try-error", but work subsequently #6

Closed ChristopherWilks closed 5 years ago

ChristopherWilks commented 5 years ago

I've seen PSI and JIR fail, the first time they run and then work subsequent times on the same input SQB objects. Maybe this is some initialization issue since it only appears to happen the first time the jir/psi function is called?

Error:

Error in as.data.frame.default(x) :
  cannot coerce class ‘"try-error"’ to a data.frame
Calls: junction_inclusion_ratio ... merge.default -> merge -> as.data.frame -> as.data.frame.default
sb1 <- SnaptronQueryBuilder$new()
sb1<-sb1$from_url("http://snaptron.cs.jhu.edu/srav2/snaptron?regions=chr2:29446395-30142858&contains=1&rfilter=strand:-")
sb2 <- SnaptronQueryBuilder$new()
sb2<-sb2$from_url("http://snaptron.cs.jhu.edu/srav2/snaptron?regions=chr2:29416789-29446394&contains=1&rfilter=strand:-")
jir<-junction_inclusion_ratio(list(sb1),list(sb2))

PSI:

inclusion_group1 <- SnaptronQueryBuilder$new()
inclusion_group1 <- inclusion_group1$from_url("http://snaptron.cs.jhu.edu/srav2/snaptron?regions=chr1:94468008-94472172&exact=1&rfilter=strand:+")
inclusion_group2 <- SnaptronQueryBuilder$new()
inclusion_group2 <- inclusion_group2$from_url("http://snaptron.cs.jhu.edu/srav2/snaptron?regions=chr1:94472243-94475142&exact=1&rfilter=strand:+")
exclusion_group <- SnaptronQueryBuilder$new()
exclusion_group <- exclusion_group$from_url("http://snaptron.cs.jhu.edu/srav2/snaptron?regions=chr1:94468008-94475142&exact=1&rfilter=strand:+")

psi<-percent_spliced_in(list(inclusion_group1), list(inclusion_group2), list(exclusion_group), min_count=1)
ch4rr0 commented 5 years ago

This could also be tied to running the queries in parallel. I have gotten of the code that does so.

ChristopherWilks commented 5 years ago

I agree, looks like they're both working now the first time, thanks!