Help with designing limma contrast matrix
1
0
Entering edit mode
6.1 years ago
zizigolu ★ 4.3k

Hi,

I need to do differential expression between biopsy taken before and after enduring exercises. I made my target file so:

> head(targets)
                    Sample_ID     Condition
1  PARTICIPANT_1_Pre-training  Pre-training
2 PARTICIPANT_1_Post-training Post-training
3  PARTICIPANT_2_Pre-training  Pre-training
4 PARTICIPANT_2_Post-training Post-training
5  PARTICIPANT_3_Pre-training  Pre-training
6 PARTICIPANT_3_Post-training Post-training

Based on this lab http://www.bioconductor.org/help/course-materials/2005/BioC2005/labs/lab01/estrogen/

by

cont.matrix <- makeContrasts(Condition="Post-training-Pre-training",levels=design)

But gives me this error

Error in makeContrasts(Condition = "Post-training-Pre-training", levels = design) : The levels must by syntactically valid names in R, see help(make.names). Non-valid names: Post-training,Pre-training

Then how are compare pre and post training?

limma software error • 7.4k views
ADD COMMENT
1
Entering edit mode

You need to create vector called "design" example

> design <- model.matrix(~ 0+factor(c(1,2)))

So 1 will for Pre-training and 2 will be for post training. Then rerun the above code Also you can refer https://www.bioconductor.org/packages/3.7/bioc/vignettes/limma/inst/doc/usersguide.pdf

ADD REPLY
0
Entering edit mode
targets <- readTargets("targets.txt")
colnames(targets) <- c("Sample_ID", "Condition")
targets

library(splines)
X <- ns(targets$Condition, df= 2)

Error in (1 - h) * qs[i] : non-numeric argument to binary operator

ADD REPLY
1
Entering edit mode

create this

> design <- model.matrix(~ 0+factor(c(1,2)))

Then this

>cont.matrix <- makeContrasts(Condition="Post-training-Pre-training",levels=design)
ADD REPLY
0
Entering edit mode

Thank you

Saying

rror in makeContrasts(Condition = "Post-training-Pre-training", levels = design) : 
  The levels must by syntactically valid names in R, see help(make.names).  Non-valid names: Post-training,Pre-training
ADD REPLY
1
Entering edit mode

A syntactically valid name consists of letters, numbers and the dot or underline characters and starts with a letter or the dot not followed by a number.

Change Post-training Pre-training to Post_training Pre_training from every where in code as well target file

ADD REPLY
0
Entering edit mode

Thanks a lot, the error was fixed by changing - to _ as you suggested.

Just a big doubt; Please look at my design

> cont.matrix <- makeContrasts(Post_training="Post_trainingFemal-Post_trainingMale",Pre_training="Pre_trainingFemal-Pre_trainingMale",levels=design)

A skeletal muscle biopsy was obtained from each participant before the first session and after the last session of the exercise training program. RNA from these biopsies was used for microarray gene expression profiling using Affymetrix human whole genome microarrays.

• Did this endurance training program have any significant effects on gene expression?

I did not account for gender

Do you think I am right in comparison?

ADD REPLY
0
Entering edit mode

makeContrasts(Post_training="Post_trainingFemal-Post_trainingMale",Pre_training="Pre_trainingFemal-Pre_trainingMale"

You are comparing pre or post session gene expression or female vs male gene expression?

In case of comparision of Pre and Post you can group the male and female for pre and post session and do Gene expression for female male for Pre vs Post(4 way analysis) In case you are comparing Female vs male then you should not take into account pre or post condition

ADD REPLY
0
Entering edit mode
2.9 years ago

Rename design column names (Post-training & Pre-training) i.e.

colnames(design) <- c("PostTraining", "PreTraining")
ADD COMMENT

Login before adding your answer.

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