Limma - 0 downreg and upreg values
1
0
Entering edit mode
sop • 0
@29ff9d75
Last seen 3 months ago
South Korea

Hello, I am running my GeoMx Data with Standr, and it includes the "limma" package.

I am incorporating the codes from these two websites,

https://davislaboratory.github.io/GeoMXAnalysisWorkflow/articles/GeoMXAnalysisWorkflow.html#differential-expression-analysis-with-limma-voom-pipeline

https://ucdavis-bioinformatics-training.github.io/2018-June-RNA-Seq-Workshop/thursday/DE.html

and some parts are showing errors or unexpected results.

Despite the error below, I was able to run the next part of the limma DE gene analysis, but the result was 0 downreg and 0 upreg genes.

I suppose it may be due to the error below. It would be very much appreciated if someone could help.

The data structure may be a little different to scRNAseq data, since it is an spe object (SpatialExperiment class).

#Differential expression analysis with limma-voom pipeline

>library(edgeR)
>library(limma)

>HNdge <- SE2DGEList(HNspe_ruv)
>HNdesign <- model.matrix(~0 + biology + ruv_W1 + ruv_W2, data = colData(HNspe_ruv))

>mm <- model.matrix(~0 + Disease_status, data = colData(HNspe_ruv))
>y <- voom(mm, plot = F)

Error in approxfun(l, rule = 2, ties = list("ordered", mean)) : need at least two non-NA values to interpolate

fit <- lmFit(y, mm)
contr <- makeContrasts(groupI5.6 - groupC.6, levels = colnames(coef(fit)))
tmp <- contrasts.fit(fit, contr)
tmp <- eBayes(tmp)
top.table <- topTable(tmp, sort.by = "P", n = Inf)

HNcontr.matrix <- makeContrasts(
   BvT = Healthy - Disease,
   levels = colnames(HNdesign))


HNv <- voom(HNdge_all, HNdesign, plot = TRUE)

voom:mean-variance trend

include your problematic code here with any corresponding output

y <- voom(mm, plot = F)

please also include the results of running the following in an R session

Error in approxfun(l, rule = 2, ties = list("ordered", mean)) : need at least two non-NA values to interpolate

sessionInfo( )

R version 4.4.1

package.version("limma") "3.60.3"

```

GeoMx limma DifferentialExpression • 593 views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 14 hours ago
United States

You are running voom on a design matrix rather than using your count data. Please re-read the help page for `voom', or more closely follow the vignette you point to (which uses the filtered count data).

0
Entering edit mode

Yes I have changed it to a design matrix and it has worked. Thank you very much!

I have encountered a different problem now,

mm <- model.matrix(~0 + biology, data = colData(HNspe_ruv)) y <- voom(HNdge, plot = F) fit <- lmFit(y, mm)

contr <-makeContrasts(CN - HN, levels = colnames(HNdesign))

it ran through fine up until here, but then the code below is saying that the number of rows does not match. Should I compare the number of rows btw "fit" and "contr"?

How would I fix this mismatch of number of rows?

fit_contr <- contrasts.fit(fit, contrasts = contr)

Error in contrasts.fit(fit, contrasts = contr_nevus) : Number of rows of contrast matrix must match number of coefficients in fit

ADD REPLY
0
Entering edit mode

You should inspect the column names of your model matrix. It's unlikely that the column names are CN and HN.

ADD REPLY
0
Entering edit mode

The column name is biology, and the categories in that column is CN and HN. If it only accept column names, how do I compare a certain category from a column to a certain category from the same column?

ADD REPLY
0
Entering edit mode

You don't compare categories within a column of a design matrix. Categorical variables should be expanded automatically by R into 'dummy variables' that contain zeros and ones only.

> d.f <- data.frame(biology = rep(c("CN","HN"), each = 3))
> model.matrix(~0 + biology, d.f)
  biologyCN biologyHN
1         1         0
2         1         0
3         1         0
4         0         1
5         0         1
6         0         1
attr(,"assign")
[1] 1 1
attr(,"contrasts")
attr(,"contrasts")$biology
[1] "contr.treatment"

You will need to provide the design and contrasts matrices, as it's not clear to me what they are.

ADD REPLY

Login before adding your answer.

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