Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use expression/bquote functions with AnnotationTrack group/feature/id #54

Open
Billy-lm opened this issue Sep 2, 2021 · 0 comments
Open

Comments

@Billy-lm
Copy link

Billy-lm commented Sep 2, 2021

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.
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, ...)
MYBL1 binding sites
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant