Hi everyone. I want to know how to analysis genes data by using "Welch t test, Wilcoxon Mann Whitney test(WMW) and Significance of Analysis Microarray(SAM) " With r codes.
1
0
Entering edit mode
2.4 years ago
Minushi • 0

Hi everyone, This is my dataset and I only do the data loading part. Could you please help me to do the genes selection by using (Welch t-test, Wilcoxon Mann Whitney test(WMW), and Significance of Analysis Microarray(SAM))and add the Genes Symbol for the final answer. I am new to the r code. Please help me.

 # load series and platform data from GEO

gset <- getGEO("GSE116486", GSEMatrix =TRUE, AnnotGPL=TRUE)
if (length(gset) > 1) idx <- grep("GPL570", attr(gset, "names")) else idx <- 1
gset <- gset[[idx]]

# make proper column names to match toptable 
fvarLabels(gset) <- make.names(fvarLabels(gset))

# group membership for all samples
gsms <- "0000001000001111111110001111000001000001000110"
sml <- strsplit(gsms, split="")[[1]]

# log2 transformation
ex <- exprs(gset)
qx <- as.numeric(quantile(ex, c(0., 0.25, 0.5, 0.75, 0.99, 1.0), na.rm=T))
LogC <- (qx[5] > 100) ||
  (qx[6]-qx[1] > 50 && qx[2] > 0)
if (LogC) { ex[which(ex <= 0)] <- NaN
exprs(gset) <- log2(ex) }

exprs(gset) <- normalizeBetweenArrays(exprs(gset)) # normalize data
exprs(gset)
# assign samples to groups and set up design matrix
gs <- factor(sml)
groups <- make.names(c("AD case","Normal case"))
levels(gs) <- groups
gset$group <- gs
design <- model.matrix(~group + 0, gset)
colnames(design) <- levels(gs)

fit <- lmFit(gset, design)  # fit linear model
Genes parametric data-analysis • 2.5k views
ADD COMMENT
0
Entering edit mode

Your post title is a nightmare. Please read https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002202#s5 (Rule 5) and edit your title to be concise and specific.

ADD REPLY
0
Entering edit mode

The original publication for this GEO series used limma and found it necessary to make a number of batch and covariate corrections. That makes it unlikely that Welch t-tests, WMW or SAM would be adequate analysis methods.

ADD REPLY
0
Entering edit mode

Thank you for your comment.Could you please explain it more and give me some guidelines(how to applied these kind of methods).

ADD REPLY
0
Entering edit mode

Is anyone knows that definite code (link)for SAM?.Could you please help me.

ADD REPLY
1
Entering edit mode

Top level posts should be only for answers. If you have a clarification or another question, please edit your original question or make a new one. Also, just asking for code probably isn’t going to be received welll. Please show what you tried first, where you got stuck etc.

ADD REPLY
1
Entering edit mode
2.4 years ago
Steve ▴ 20

I found these statology links...

1) Explaining Welch t-test in R => https://www.statology.org/welch-t-test-in-r/

2) Explaining Wilcox-Mann-Whitney in R => https://www.statology.org/mann-whitney-u-test-r/

3) Here are all the R techniques => https://www.statology.org/r-guides/ The last link did not have anything with regard to SAM or microarrays... But I found a discussion on bioconductor regarding Limma and SAM.. https://support.bioconductor.org/p/5144/ But this discussion does not reveal any code. Neither does this one... https://stat.ethz.ch/pipermail/bioconductor/2005-March/008239.html

Heres the manual for the limma => http://www.bioconductor.org/packages//2.11/bioc/vignettes/limma/inst/doc/usersguide.pdf it does not mention a Welch t-test but it does have t-test... perhaps a parameter needs to be specified, like variance? Perhaps it automatically selects the best t-test based on mean and variance (that would be nice)....

All the best, Steve

ADD COMMENT
0
Entering edit mode

If we can get two-sample t-test values using this code, how can we use the "Welch t-test" using limma packages? Can anyone help me, please?

cts <- paste(groups[1], groups[2], sep="-")
cont.matrix <- makeContrasts(contrasts=cts, levels=design)
fit2 <- contrasts.fit(fit, cont.matrix)

fit2 <- eBayes(fit2, 0.01)
tT <- topTable(fit2, adjust="fdr", sort.by="B", number=1400)

tT <- subset(tT, select=c("ID","adj.P.Val","P.Value","t","B","logFC","Gene.symbol","Gene.title"))
new1<-write.table(tT, file=stdout(), row.names=F, sep="\t")
ADD REPLY
1
Entering edit mode

Sorry I'm updating my response... I found some reasoning about the limma t-test explained in this post... I'm not able to clarify what t-test it is using, but it seems to be doing something customized for microarrays .... using some kind of Bayesian technique,,,

How does limma t-test work? https://support.bioconductor.org/p/47765/

OBSERVATION: parametric vs non-parametric Outside the context of microarrays, the statisticians point of view - for parametric analysis only - is to always use Welch's t-test. it is a generalization of Student's t-test. Student's t-test seems pedagogical and is specific. Welch's t-test is more general, it can handle differences in variance, but both tests assume the distribution is normal..... which means both the Student's and Welchs test are parametric... (see discussion 'Always use Welch's t-test instead of Student's t-test' @ http://daniellakens.blogspot.com/2015/01/always-use-welchs-t-test-instead-of.html)

However, one of the tests you are doing is non-parametric (Wilcox Mann Whitney) meaning it doesn't make any assumptions about the shape of the distribution...

So I'm guessing you want to do the non-parametric, Wilcox Mann Whitney test first to see if the two distributions have the same shape..and then do either the Welch's test (if its normal) xor the t-test in the limma package (if its not normal).....

Best of Luck, Steve

ADD REPLY
0
Entering edit mode

This is not an answer to the to-level question you asked, is it? It should not be added as an answer in that case. If it's a follow up clarification on an answer, add it as a comment. If not, create a new question and add sufficient context so people can understand what's going on.

ADD REPLY
0
Entering edit mode

In that case I was trying to know can we applie welch t test for the same code with doing simple differences?.Because of that reason I taken that code. Sorry for my mistake, If I confused you.

ADD REPLY
1
Entering edit mode

I think there's a language barrier here. Add a comment to Steve's answer if you have a specific question on something they said. If not, open a new post and provide as much context as you can over there. Are these instructions clear?

ADD REPLY
0
Entering edit mode

Thank you so much. Your comment is very useful for me. I followed 1 st and 2nd link earlier. But I failed to implement that example codes to my code.If you have any idea about it?.Could you please help me...

ADD REPLY

Login before adding your answer.

Traffic: 1618 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