Can you fix this in the pathview package? See my answer!
I am trying to use pathview() to overlay my gene expression onto KEGGS.. Something like this:

I have used this code:
pv.out <- pathview(gene.data = merge2, gene.idtype="ENSEMBL",pathway.id = "04110", species = "dre", out.suffix = "ensembl_Cell_cycle", kegg.native = T, same.layer=T)
And this is my dataframe structure:
> head(merge2)
List1_logFC_transformed
ENSDARG00000100344 -0.4250000
ENSDARG00000096038 -0.4250000
ENSDARG00000103955 -0.4250000
ENSDARG00000090824 -0.4250000
ENSDARG00000087743 -0.4250000
ENSDARG00000087699 -0.4250000
ENSDARG00000090734 -0.4250000
ENSDARG00000101977 -0.4250000
However, I am getting this error:
Error in UseMethod("select_") :
no applicable method for 'select_' applied to an object of class "c('OrgDb', 'AnnotationDb', 'envRefClass', '.environment', 'refClass', 'environment', 'refObject', 'AssayData')"
Note: None of the genes or compounds mapped to the pathway!
Argument gene.idtype or cpd.idtype may be wrong
.
Does anyone know why this might be? I had this working this morning... I am not clear why on a new machine this will no longer work! I cannot even get the example data set from the pathview() documentation, when this was working earlier!!
Thanks in advance
3 answers
I had the same problem today and not knowing why unloading dplyr package before pathview() helped me. (i.e.: detach("package:dplyr", unload=TRUE)).
Since it worked ealier on another machine, I don’t think the code has any problem. It is likely that your new machine has an outdated R/Bioconductor or problematic installation. Update to the latest version or reinstallation would work.
You may also use the pathview web server:
http://pathview.uncc.edu/
the server not includes pathview function but also a full pathway analysis workflow for multiple types of omics data and their integrated analysis. you can start with the examples.
I also run into the same problem. I think the solution is to name the right package/namespace within geneannot.map() from pathview, ie. AnnotationDbi::select(), to be not in conflict with select from dplyr!
in my version I changed line 52 in function geneannot.map() from
res <- try(suppressWarnings(select(db.obj, keys = in.ids,
keytype = in.type, columns = c(in.type, out.type))))
to
res <- try(suppressWarnings(AnnotationDbi::select(db.obj, keys = in.ids,
keytype = in.type, columns = c(in.type, out.type))))
Then everything works!
Log in to answer this question.