You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to ask for some tricks on the use of expression/bquote functions with group/feature/id elements in the AnnotationTrack. Rather than setting normal names (characters) to these elements, sometimes we way want to plot with some complex strings including superscripts, subscripts, Greek alphabets, etc.
For my case, I intend to set p-values for some peak regions detected. When I tried with simple characters, everything is fine. AT = AnnotationTrack(range = TF_binding_site, genome = "hg38", id = paste0("p=10^-", mcols(TF_binding_site)$p_value)) plotTracks(AT, ...)
But when I tried to make the use of expression/bquote functions like this: AT = AnnotationTrack(range = TF_binding_site, genome = "hg38", id = as.expression(sapply(mcols(TF_binding_site)$p_value, function(var) bquote(p == 10^-.(var))))) plotTracks(AT, ...)
I got errors as: Error in h(simpleError(msg, call)) : error in evaluating the argument 'f' in selecting a method for function 'split': cannot coerce class '"expression"' to a data.frame
Are there any solutions for this?
Thanks a lot in advance!
Mu
The text was updated successfully, but these errors were encountered:
Hi,
I would like to ask for some tricks on the use of expression/bquote functions with group/feature/id elements in the AnnotationTrack. Rather than setting normal names (characters) to these elements, sometimes we way want to plot with some complex strings including superscripts, subscripts, Greek alphabets, etc.
![MYBL1 binding sites](https://user-images.githubusercontent.com/54601689/131806831-162cacb7-68a6-42f6-95d7-1f4e36b5c620.png)
For my case, I intend to set p-values for some peak regions detected. When I tried with simple characters, everything is fine.
AT = AnnotationTrack(range = TF_binding_site, genome = "hg38", id = paste0("p=10^-", mcols(TF_binding_site)$p_value))
plotTracks(AT, ...)
But when I tried to make the use of expression/bquote functions like this:
AT = AnnotationTrack(range = TF_binding_site, genome = "hg38", id = as.expression(sapply(mcols(TF_binding_site)$p_value, function(var) bquote(p == 10^-.(var)))))
plotTracks(AT, ...)
I got errors as:
Error in h(simpleError(msg, call)) : error in evaluating the argument 'f' in selecting a method for function 'split': cannot coerce class '"expression"' to a data.frame
Are there any solutions for this?
Thanks a lot in advance!
Mu
The text was updated successfully, but these errors were encountered: