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

Error in density.default #27

Open
royfrancis opened this issue May 25, 2017 · 6 comments
Open

Error in density.default #27

royfrancis opened this issue May 25, 2017 · 6 comments

Comments

@royfrancis
Copy link

I get this error when I use mean.only=T.

> dfc <- ComBat(dat=df, batch=bt, mod=combmod, par.prior=TRUE, prior.plots=T, mean.only=T)
Using the 'mean only' version of ComBat
Found 4 batches
Adjusting for 8 covariate(s) or covariate level(s)
Standardizing Data across genes
Fitting L/S model and finding priors
Error in density.default(invgam) : 
  need at least 2 points to select a bandwidth automatically

It seems to work fine when mean.only=F. I was wondering if you could provide some insight into what might be wrong.

sessionInfo R version 3.3.3 (2017-03-06) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] parallel stats4 grid stats graphics grDevices
[7] utils datasets methods base

other attached packages:
[1] sva_3.22.0 genefilter_1.56.0
[3] mgcv_1.8-17 nlme_3.1-131
[5] pvca_1.14.0 IHW_1.2.0
[7] ellipse_0.3-8 viridis_0.4.0
[9] viridisLite_0.2.0 pheatmap_1.0.8
[11] Rtsne_0.13 extrafont_0.17
[13] tidyr_0.6.3 edgeR_3.16.5
[15] limma_3.30.13 DESeq2_1.14.1
[17] SummarizedExperiment_1.4.0 Biobase_2.34.0
[19] GenomicRanges_1.26.4 GenomeInfoDb_1.10.3
[21] IRanges_2.8.2 S4Vectors_0.12.2
[23] BiocGenerics_0.20.0 Cairo_1.5-9
[25] gplots_3.0.1 RColorBrewer_1.1-2
[27] ggplot2_2.2.1 dplyr_0.5.0
[29] stringr_1.2.0

@wevanjohnson
Copy link
Contributor

wevanjohnson commented May 25, 2017 via email

@royfrancis
Copy link
Author

All covariate groups had samples, minimum 5. All levels in all factors have an equal number of samples. Decreasing covariates or changing covariates did not fix the issue. The issue persists with any number of genes. 10, 100, 1000 and different sets of genes etc. In all cases, setting mean.only=F made it work.

@wevanjohnson
Copy link
Contributor

wevanjohnson commented May 26, 2017 via email

@royfrancis
Copy link
Author

royfrancis commented May 26, 2017

Couldn't attach .rds or zipped rds. So I am attaching txt files of count data and metadata. All samples and metadata included. But only first 6 genes are included.

combmod <- model.matrix(~family+lane+condition,data=metadata)
ComBat(dat=count_data, batch=metadata$ext, mod=combmod, par.prior=TRUE, prior.plots=T,mean.only=T)

Let me know if this works for you.

count_data.txt
meta_data.txt

@romunov
Copy link

romunov commented Mar 31, 2021

Ping? :)

@wevanjohnson
Copy link
Contributor

wevanjohnson commented Apr 1, 2021 via email

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

3 participants