Problem with DESeq : \"Error in FUN(newX[, i], ...) : could not find function \"locfunc\"\"
3
0
Entering edit mode
Guest User ★ 13k
@guest-user-4897
Last seen 10.3 years ago
Dear Madam or Sir, I am a post-doctorant working on NGS data (from ChIP seq to RNAseq) but I have problems when I use DESeq for differential analysis. When I want to estimate dispersion I have this error message: "Error in FUN(newX[, i], ...) : could not find function "locfunc" Here is an example of the problem : # first I just load a matrix of 20000 rows and I select 8 columns > data = read.csv("H3K27me3-ensembl-59-gene-bodies-counts.txt", sep="\t") > cols = c(grep("BN", colnames(data)), grep("SHR", colnames(data))) > data=data[,cols] > head(data) liver.H3K27me3.BN.male.bio1 liver.H3K27me3.BN.male.bio2 liver.H3K27me3.BN.male.bio3 liver.H3K27me3.BN.male.bio4 ENSRNOG00000005665 3 3 11 11 ENSRNOG00000023458 99 74 105 104 ENSRNOG00000031533 56 34 48 36 ENSRNOG00000032223 0 1 0 0 ENSRNOG00000040189 0 0 0 0 ENSRNOG00000005894 3496 3874 3657 4008 liver.H3K27me3.SHR.male.bio1 liver.H3K27me3.SHR.male.bio2 liver.H3K27me3.SHR.male.bio3 ENSRNOG00000005665 2 6 5 ENSRNOG00000023458 41 113 110 ENSRNOG00000031533 19 52 50 ENSRNOG00000032223 1 2 1 ENSRNOG00000040189 0 0 0 ENSRNOG00000005894 1588 2990 3058 liver.H3K27me3.SHR.male.bio4 ENSRNOG00000005665 9 ENSRNOG00000023458 99 ENSRNOG00000031533 47 ENSRNOG00000032223 0 ENSRNOG00000040189 0 ENSRNOG00000005894 3732 # then I use DESeq to perform a differential analysis > library(DESeq) Loading required package: BiocGenerics Loading required package: parallel Attaching package: ???BiocGenerics??? The following objects are masked from ???package:parallel???: clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap, parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB The following object is masked from ???package:stats???: xtabs The following objects are masked from ???package:base???: anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, do.call, duplicated, eval, evalq, Filter, Find, get, intersect, is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, rownames, sapply, setdiff, sort, table, tapply, union, unique, unlist Loading required package: Biobase Welcome to Bioconductor Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'. Loading required package: locfit locfit 1.5-9.1 2013-03-22 Loading required package: lattice Welcome to 'DESeq'. For improved performance, usability and functionality, please consider migrating to 'DESeq2'. > strain = factor(rep(c("BN", "SHR"), each=4)) > cds = newCountDataSet(data, strain) > cds=estimateSizeFactors(cds) Error in FUN(newX[, i], ...) : could not find function "locfunc" > traceback() 6: FUN(newX[, i], ...) 5: apply(counts, 2, function(cnts) exp(locfunc((log(cnts) - loggeomeans)[is.finite(loggeomeans)]))) 4: estimateSizeFactorsForMatrix(counts(object), locfunc) 3: .local(object, ...) 2: estimateSizeFactors(cds) 1: estimateSizeFactors(cds) > ?locfunc No documentation for ???locfunc??? in specified packages and libraries: you could try ?????locfunc??? I already try to find an answer by copy and past this error message on google but I didn't find anything. So I have follow bioconductor advice, I install R again, DESeq again, I check if the package were up to date... but after that nothing change, there is still this error message. The thing is : I never had this problem with my previous computer when I was performing such analysis on such kind of data. Thank you for any halp you could provide! Camille BENOIST -- output of sessionInfo(): R version 3.1.0 (2014-04-10) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252 LC_NUMERIC=C [5] LC_TIME=French_France.1252 attached base packages: [1] parallel stats graphics grDevices utils datasets methods base other attached packages: [1] DESeq_1.16.0 lattice_0.20-29 locfit_1.5-9.1 Biobase_2.24.0 BiocGenerics_0.10.0 BiocInstaller_1.14.2 loaded via a namespace (and not attached): [1] annotate_1.42.0 AnnotationDbi_1.26.0 DBI_0.2-7 genefilter_1.46.0 geneplotter_1.42.0 GenomeInfoDb_1.0.2 [7] grid_3.1.0 IRanges_1.22.6 RColorBrewer_1.0-5 RSQLite_0.11.4 splines_3.1.0 stats4_3.1.0 [13] survival_2.37-7 tools_3.1.0 XML_3.98-1.1 xtable_1.7-3 -- Sent via the guest posting facility at bioconductor.org.
DESeq DESeq • 4.2k views
ADD COMMENT
0
Entering edit mode
@camille-benoist-6533
Last seen 10.3 years ago
I just saw another warning: when R starts, I can read at the end: Warning: namespace ‘DESeq’ is not available and has been replaced by .GlobalEnv when processing object ‘cds’ Ragards, Camille Benoist 2014-05-04 18:20 GMT+02:00 Benoist [guest] <guest@bioconductor.org>: > > Dear Madam or Sir, > > I am a post-doctorant working on NGS data (from ChIP seq to RNAseq) but I > have problems when I use DESeq for differential analysis. When I want to > estimate dispersion I have this error message: > "Error in FUN(newX[, i], ...) : could not find function "locfunc" > > Here is an example of the problem : > > # first I just load a matrix of 20000 rows and I select 8 columns > > data = read.csv("H3K27me3-ensembl-59-gene-bodies-counts.txt", sep="\t") > > cols = c(grep("BN", colnames(data)), grep("SHR", colnames(data))) > > data=data[,cols] > > head(data) > liver.H3K27me3.BN.male.bio1 liver.H3K27me3.BN.male.bio2 > liver.H3K27me3.BN.male.bio3 liver.H3K27me3.BN.male.bio4 > ENSRNOG00000005665 3 3 > 11 11 > ENSRNOG00000023458 99 74 > 105 104 > ENSRNOG00000031533 56 34 > 48 36 > ENSRNOG00000032223 0 1 > 0 0 > ENSRNOG00000040189 0 0 > 0 0 > ENSRNOG00000005894 3496 3874 > 3657 4008 > liver.H3K27me3.SHR.male.bio1 > liver.H3K27me3.SHR.male.bio2 liver.H3K27me3.SHR.male.bio3 > ENSRNOG00000005665 2 > 6 5 > ENSRNOG00000023458 41 > 113 110 > ENSRNOG00000031533 19 > 52 50 > ENSRNOG00000032223 1 > 2 1 > ENSRNOG00000040189 0 > 0 0 > ENSRNOG00000005894 1588 > 2990 3058 > liver.H3K27me3.SHR.male.bio4 > ENSRNOG00000005665 9 > ENSRNOG00000023458 99 > ENSRNOG00000031533 47 > ENSRNOG00000032223 0 > ENSRNOG00000040189 0 > ENSRNOG00000005894 3732 > > # then I use DESeq to perform a differential analysis > > library(DESeq) > Loading required package: BiocGenerics > Loading required package: parallel > > Attaching package: ‘BiocGenerics’ > > The following objects are masked from ‘package:parallel’: > > clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, > clusterExport, clusterMap, parApply, parCapply, > parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB > > The following object is masked from ‘package:stats’: > > xtabs > > The following objects are masked from ‘package:base’: > > anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, > do.call, duplicated, eval, evalq, Filter, Find, > get, intersect, is.unsorted, lapply, Map, mapply, match, mget, order, > paste, pmax, pmax.int, pmin, pmin.int, > Position, rank, rbind, Reduce, rep.int, rownames, sapply, setdiff, > sort, table, tapply, union, unique, unlist > > Loading required package: Biobase > Welcome to Bioconductor > > Vignettes contain introductory material; view with > 'browseVignettes()'. To cite Bioconductor, see > 'citation("Biobase")', and for packages 'citation("pkgname")'. > > Loading required package: locfit > locfit 1.5-9.1 2013-03-22 > Loading required package: lattice > Welcome to 'DESeq'. For improved performance, usability and > functionality, please consider migrating to 'DESeq2'. > > > > strain = factor(rep(c("BN", "SHR"), each=4)) > > cds = newCountDataSet(data, strain) > > cds=estimateSizeFactors(cds) > Error in FUN(newX[, i], ...) : could not find function "locfunc" > > > > traceback() > 6: FUN(newX[, i], ...) > 5: apply(counts, 2, function(cnts) exp(locfunc((log(cnts) - > loggeomeans)[is.finite(loggeomeans)]))) > 4: estimateSizeFactorsForMatrix(counts(object), locfunc) > 3: .local(object, ...) > 2: estimateSizeFactors(cds) > 1: estimateSizeFactors(cds) > > ?locfunc > No documentation for ‘locfunc’ in specified packages and libraries: > you could try ‘??locfunc’ > > > I already try to find an answer by copy and past this error message on > google but I didn't find anything. > So I have follow bioconductor advice, I install R again, DESeq again, I > check if the package were up to date... but after that nothing change, > there is still this error message. > The thing is : I never had this problem with my previous computer when I > was performing such analysis on such kind of data. > > Thank you for any halp you could provide! > > Camille BENOIST > > -- output of sessionInfo(): > > R version 3.1.0 (2014-04-10) > Platform: x86_64-w64-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 > LC_MONETARY=French_France.1252 LC_NUMERIC=C > [5] LC_TIME=French_France.1252 > > attached base packages: > [1] parallel stats graphics grDevices utils datasets methods > base > > other attached packages: > [1] DESeq_1.16.0 lattice_0.20-29 locfit_1.5-9.1 > Biobase_2.24.0 BiocGenerics_0.10.0 BiocInstaller_1.14.2 > > loaded via a namespace (and not attached): > [1] annotate_1.42.0 AnnotationDbi_1.26.0 DBI_0.2-7 > genefilter_1.46.0 geneplotter_1.42.0 GenomeInfoDb_1.0.2 > [7] grid_3.1.0 IRanges_1.22.6 RColorBrewer_1.0-5 > RSQLite_0.11.4 splines_3.1.0 stats4_3.1.0 > [13] survival_2.37-7 tools_3.1.0 XML_3.98-1.1 > xtable_1.7-3 > > -- > Sent via the guest posting facility at bioconductor.org. > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
Hi Camille, I'm not sure about this error. You could try reinstalling DESeq? Also, we recommend using DESeq2, which is available as a separate Bioconductor package: http://www.bioconductor.org/packages/release/bioc/html/DESeq2.html Mike On May 4, 2014 5:15 PM, "Camille BENOIST" <camil.benoist@gmail.com> wrote: > I just saw another warning: > when R starts, I can read at the end: > > Warning: namespace ‘DESeq’ is not available and has been replaced by > .GlobalEnv when processing object ‘cds’ > > Ragards, > > Camille Benoist > > > 2014-05-04 18:20 GMT+02:00 Benoist [guest] <guest@bioconductor.org>: > > > > > Dear Madam or Sir, > > > > I am a post-doctorant working on NGS data (from ChIP seq to RNAseq) but I > > have problems when I use DESeq for differential analysis. When I want to > > estimate dispersion I have this error message: > > "Error in FUN(newX[, i], ...) : could not find function "locfunc" > > > > Here is an example of the problem : > > > > # first I just load a matrix of 20000 rows and I select 8 columns > > > data = read.csv("H3K27me3-ensembl-59-gene-bodies-counts.txt", sep="\t") > > > cols = c(grep("BN", colnames(data)), grep("SHR", colnames(data))) > > > data=data[,cols] > > > head(data) > > liver.H3K27me3.BN.male.bio1 > liver.H3K27me3.BN.male.bio2 > > liver.H3K27me3.BN.male.bio3 liver.H3K27me3.BN.male.bio4 > > ENSRNOG00000005665 3 > 3 > > 11 11 > > ENSRNOG00000023458 99 > 74 > > 105 104 > > ENSRNOG00000031533 56 > 34 > > 48 36 > > ENSRNOG00000032223 0 > 1 > > 0 0 > > ENSRNOG00000040189 0 > 0 > > 0 0 > > ENSRNOG00000005894 3496 > 3874 > > 3657 4008 > > liver.H3K27me3.SHR.male.bio1 > > liver.H3K27me3.SHR.male.bio2 liver.H3K27me3.SHR.male.bio3 > > ENSRNOG00000005665 2 > > 6 5 > > ENSRNOG00000023458 41 > > 113 110 > > ENSRNOG00000031533 19 > > 52 50 > > ENSRNOG00000032223 1 > > 2 1 > > ENSRNOG00000040189 0 > > 0 0 > > ENSRNOG00000005894 1588 > > 2990 3058 > > liver.H3K27me3.SHR.male.bio4 > > ENSRNOG00000005665 9 > > ENSRNOG00000023458 99 > > ENSRNOG00000031533 47 > > ENSRNOG00000032223 0 > > ENSRNOG00000040189 0 > > ENSRNOG00000005894 3732 > > > > # then I use DESeq to perform a differential analysis > > > library(DESeq) > > Loading required package: BiocGenerics > > Loading required package: parallel > > > > Attaching package: ‘BiocGenerics’ > > > > The following objects are masked from ‘package:parallel’: > > > > clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, > > clusterExport, clusterMap, parApply, parCapply, > > parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB > > > > The following object is masked from ‘package:stats’: > > > > xtabs > > > > The following objects are masked from ‘package:base’: > > > > anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, > > do.call, duplicated, eval, evalq, Filter, Find, > > get, intersect, is.unsorted, lapply, Map, mapply, match, mget, order, > > paste, pmax, pmax.int, pmin, pmin.int, > > Position, rank, rbind, Reduce, rep.int, rownames, sapply, setdiff, > > sort, table, tapply, union, unique, unlist > > > > Loading required package: Biobase > > Welcome to Bioconductor > > > > Vignettes contain introductory material; view with > > 'browseVignettes()'. To cite Bioconductor, see > > 'citation("Biobase")', and for packages 'citation("pkgname")'. > > > > Loading required package: locfit > > locfit 1.5-9.1 2013-03-22 > > Loading required package: lattice > > Welcome to 'DESeq'. For improved performance, usability and > > functionality, please consider migrating to 'DESeq2'. > > > > > > > strain = factor(rep(c("BN", "SHR"), each=4)) > > > cds = newCountDataSet(data, strain) > > > cds=estimateSizeFactors(cds) > > Error in FUN(newX[, i], ...) : could not find function "locfunc" > > > > > > > traceback() > > 6: FUN(newX[, i], ...) > > 5: apply(counts, 2, function(cnts) exp(locfunc((log(cnts) - > > loggeomeans)[is.finite(loggeomeans)]))) > > 4: estimateSizeFactorsForMatrix(counts(object), locfunc) > > 3: .local(object, ...) > > 2: estimateSizeFactors(cds) > > 1: estimateSizeFactors(cds) > > > ?locfunc > > No documentation for ‘locfunc’ in specified packages and libraries: > > you could try ‘??locfunc’ > > > > > > I already try to find an answer by copy and past this error message on > > google but I didn't find anything. > > So I have follow bioconductor advice, I install R again, DESeq again, I > > check if the package were up to date... but after that nothing change, > > there is still this error message. > > The thing is : I never had this problem with my previous computer when I > > was performing such analysis on such kind of data. > > > > Thank you for any halp you could provide! > > > > Camille BENOIST > > > > -- output of sessionInfo(): > > > > R version 3.1.0 (2014-04-10) > > Platform: x86_64-w64-mingw32/x64 (64-bit) > > > > locale: > > [1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 > > LC_MONETARY=French_France.1252 LC_NUMERIC=C > > [5] LC_TIME=French_France.1252 > > > > attached base packages: > > [1] parallel stats graphics grDevices utils datasets methods > > base > > > > other attached packages: > > [1] DESeq_1.16.0 lattice_0.20-29 locfit_1.5-9.1 > > Biobase_2.24.0 BiocGenerics_0.10.0 BiocInstaller_1.14.2 > > > > loaded via a namespace (and not attached): > > [1] annotate_1.42.0 AnnotationDbi_1.26.0 DBI_0.2-7 > > genefilter_1.46.0 geneplotter_1.42.0 GenomeInfoDb_1.0.2 > > [7] grid_3.1.0 IRanges_1.22.6 RColorBrewer_1.0-5 > > RSQLite_0.11.4 splines_3.1.0 stats4_3.1.0 > > [13] survival_2.37-7 tools_3.1.0 XML_3.98-1.1 > > xtable_1.7-3 > > > > -- > > Sent via the guest posting facility at bioconductor.org. > > > > [[alternative HTML version deleted]] > > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
@kylieharrall-7546
Last seen 9.7 years ago

I ran into the same issue as Camille. In my case, the issue was solved by deleting everything in the global environment ( rm(list=ls()) ). 

ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 3 months ago
EMBL European Molecular Biology Laborat…

I reproduced Kylie's and Camille's problem on a recent R/Bioc-devel with

library(DESeq)
example(estimateSizeFactors)
median <- NULL
example(estimateSizeFactors)

and the error occurs in the function estimateSizeFactorsForMatrix which is defined in DESeq and eventually called by the above.

With DESeq2, the same does not happen. There is a difference in how the methods for estimateSizeFactors are implemented in the two packages, which apparently affect the evaluation order. In DESeq, the evaluation appears to happen in a context where symbols in the global environment can mask the stats namespace...

 

ADD COMMENT

Login before adding your answer.

Traffic: 558 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6