I appreciate the new suggestions. I was able to remove the 'h', but have 5 plots and I now think it's probably better for me to just have one plot as explained with new information and idea below:
I have reduced the contrasts (removed 80hr-6h) to:
contrasts <- makeContrasts("hr6-hr0","hr24-hr0","hr48-hr0","hr72-hr0","hr80-hr0",levels = exptDesign)
Hence, the new contrasts:
contrasts
Contrasts
Levels hr6-hr0 hr24-hr0 hr48-hr0 hr72-hr0 hr80-hr0
hr0 -1 -1 -1 -1 -1
hr6 1 0 0 0 0
hr24 0 1 0 0 0
hr48 0 0 1 0 0
hr72 0 0 0 1 0
hr80 0 0 0 0 1
exprs.row has 28 rows and an example corresponding to one ranked gene in the loop (code in the first post) is as follows:
exprs.row
hr0 hr0 hr6 hr6 hr24 hr24 hr48 hr48 hr72 hr72 hr0 hr0 hr6
8.983808 9.157047 9.128908 9.029095 9.060012 8.962301 9.291968 9.309716 10.226955 9.950621 8.553083 8.907762 9.093225
hr6 hr24 hr24 hr48 hr48 hr72 hr72 hr80 hr80 hr0 hr0 hr6 hr6
8.984623 9.015506 8.989505 9.184224 9.019390 9.947579 9.941535 9.995935 10.010917 8.778475 8.847193 8.762086 8.743280
hr72 hr72
10.095114 9.926371
According to my replicate information, different time points has the following
0hr(1:2, 11:12, 23:24)
6hr(3:4, 13:14, 25:26)
24hr(5:6, 15:16)
48hr(7:8, 18:19)
72hr(9:10, 19:20, 27:28)
80hr(21:22)
If want to just have a single plot (per gene), I guess I need to average the exprs.row according to my replicate info, and then just plot time points against the averaged exprs.row to show a profile through the different time points (0, 6, 24, 48, 72 and 80h). I'm not sure if this is correct and how to write the codes for this new idea.
Apologies for the initial confusion.
Could you include output for X and mc. If you are having a labeling problem make sure to check your colnames after every step and especially before reassigning them
I am not totally sure what you mean with "label on the curves". The code does not handle plotting "curve labels" explicitly. You are plotting an affy expression set, correct? I recommend you post an image of how your plot looks, and mark in the plot where you want labels to appear. It might be best to control your plot options explicitly, see for example documentation of
legendand alsoaxis,par, andtext.Thanks everyone. I have added more information as requested. My figure example is here: http://s23.postimg.org/bqcp67jaj/Rplot01_page_1.jpg
It's as if I'm plotting the wrong things. I just want to show how the other time profiles are different from hr0 for each ranked gene and perhaps, I do not really need to label the profile graphs and should just get rid of the 'h' that appears as labels. Any suggestions will be welcome.
mc and X are as follows:
Check that your
pch_valueis changing after every iteration. Also an alternative way could be to create a vector of values ahead of time and then dopch=pch_vector[j]