syspremed / explobatch Goto Github PK
View Code? Open in Web Editor NEWA package for discovering and correcting for batch effect using an approach in Nyamundanda et al (2017).
A package for discovering and correcting for batch effect using an approach in Nyamundanda et al (2017).
If more than 7 batches are used, no colour is assigned for the remaining batches on PCA plots and so they are not plotted.
please use the recommended way of including depending packages while you build your package. as usethis::use_package
I got a very weird error when running exploBATCH.
Error: With R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install
Dose this mean that some dependency packages should be installed from Bioconductor and is not in my session?
Thanks in advance!
Error: With R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install.
Can you please fix it ?
Hello!
SPLS-DA and PLS-DA models built on our data + possible known batch effect show the models can accurately classify samples based to one of two batches (pR2Y = 0.05 & pQ2 = 0.05 based on 20 random permutations of response labels to estimate R2Y and Q2Y significance). However, expBATCH
finished after findBATCH
and I'm assuming because the findBATCH
function reported the batch as not significant. Could you comment on whether we should still remove the batch, even though it's not classified as significant by findBATCH
?
Thanks!
Jenya
Hi,
By default, expBATCH() seem to be using all the cores. Is there any way to limit the number of cores to use.
This as such is quite a useful option. However, I want to use this option because I want to select as many PCs as possible during the batch removal so that I can retain most of the data. However, if all the cores of my servers are used, it quickly runs out of memory beyond 9-10 PCs. I am suspecting the use of many cores is causing the use of huge amount of memory and if I can limit the number of cores (it is ok if it takes longer to run), this problem can be solved.
Any help would be appreciated, thanks.
Hello!
I successfully installed your tool and ran the following example from your manual:
expBATCH(D=Breast,batchCL=batchBreast,Conf=NA, mindim=2, maxdim=9,method="ppcca", SDselect=2)
However, when I tried using my own matrix (D
) and batchCL
, the following error was given:
Error in Covars[, i] - min(Covars[, i]) :
non-numeric argument to binary operator
It appears I did get the complete folder pcaBeforeCorrection
but all subsequent folders are empty.
Should I preprocess my matrix prior to passing it to expBATCH
? For example, log transformation, scaling, outlier removal, or are these steps all performed when calling expBATCH
?
Thanks for any input!
Jenya
Hello,
The dataset I'm working with has 2 batch effects, one caused by the plate used for mass spec and the second by the collection year of the samples. As I cannot pass a matrix for the batch effects, I'm trying to run expBATCH
2x:
Run 1
: input the original feature table and a vector of plate batches (set SDSelect = 2)
Run 2
: input 2020-06-25_pca_After_PPCCA_correction.txt
from Run 1 and a vector of year of collection batches (set SDSelect = 0)
For Run 1
, I obtained results for both correctComBat
and correctBATCH
. However, for Run 2
, only results for correctComBat
were generated which appear to have remove the 2nd batch effect. correctBATCH
returned an empty folder and the error:
Error in tcrossprod(x, y) :
requires numeric/complex matrix/vector arguments
Do you know what could be the issue? Thank you for the help!
Below you can find the PCA plots for ComBat & PPCCA correction:
Run 1
, pcaBeforeCorrection.png
(6 plates batch effect)2a) Run 1
, correctComBat pca_After_Combat_Correction.png
2b) Run 1
, correctBATCH 2020-06-24_pca_After_PPCCA_correction.png
Run 2
, ppcaBeforeCorrection.png
(4 years of collection batch effect, using 2020-06-24_ppccaCorrectedData.txt
as input feature table)4a) Run 2
, correctComBat pca_After_Combat_Correction.png
4b) Run 2
, correctBATCH failed
When running expBATCH()
with 9 or more batches, pcaBeforeCorrection()
will crash and ggplot2 will throw the following error message:
Error: Continuous value supplied to discrete scale
I analyzed the code a little bit, and here is the reason: For 9 or more features, we have cGsub=c(1:ngrps)
in line 60 of expBATCH.R
, which is an integer vector. We pass this vector as a color argument to aes()
in line 23 of pcaBeforeCorrection.R
via
fig1<-ggplot(data= sdat1, aes(x, y,colour=cGsub[batchCL])) + ...
ggplot2, however, wants this color argument to be a factor, so we can easily fix this bug by changing the above line of code (line 60 of expBATCH.R
) to
cGsub=factor(c(1:ngrps))
This solved the issue for me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.