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

get_gene_expression doesn't work if genes are provided as factors #237

Open
rdmorin opened this issue Jul 26, 2023 · 1 comment
Open

get_gene_expression doesn't work if genes are provided as factors #237

rdmorin opened this issue Jul 26, 2023 · 1 comment
Assignees

Comments

@rdmorin
Copy link
Collaborator

rdmorin commented Jul 26, 2023

When get_gene_expression is run with a vector of Hugo_Symbol or Ensembl_ID provided as factors (instead of a character vector) it doesn't work properly. Behind the scenes the factor levels (as numeric values) are used in the grep instead of the actual gene names. This should be an easy fix. I suggest we explicitly cast the genes vector to a character vector in the function using as.character().

Here's the output I see if I provide Hugo_Symbol directly from the bundled wright_genes data frame.

grep -w -F -e Hugo_Symbol -e 103 -e 161 -e 108 -e 102 -e 137 -e 82 -e 97 -e 91 -e 98 -e 184 -e 100 -e 171 -e 146 -e 147 -e 157 -e 11 -e 53 -e 18 -e 92 -e 99 -e 175
@Kdreval Kdreval self-assigned this Jul 26, 2023
@rdmorin
Copy link
Collaborator Author

rdmorin commented Dec 18, 2023

Still an open issue? Maybe we need to drop this grep-based support entirely.

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

2 participants