Parameter names must by syntactically valid names in R
1
0
Entering edit mode
k. brand ▴ 420
@k-brand-1874
Last seen 9.6 years ago
Dear BioCers, Anyone that could shed light on the error- "Parameter names must by syntactically valid names in R" -would be greatly appreciated. Google turned up were these relevant findings: https://stat.ethz.ch/pipermail/bioconductor/2008-March/021440.html -which suggested spaces in names could yield such errors. I failed to find such spaces in my targets file (fwd at bottom). http://rss.acs.unt.edu/Rdoc/library/base/html/make.names.html -indicated names should not begin with numbers or ".". Which they do not as far a i could find, atleast in my targets or sript. Of particular note is that identical code run 24 hrs earlier on a different machine succeeded without this error. Unfortunately i do not have sessionInfo from that session and wont be able gain it as such any time soon. What am i doing wrong (today and not yesterday!)? Look forward to any thoughts on this, cheers, Karl > targets <- read.delim("RNA_Targets_RE-ORDered&timeInRank&NoAnimal_L-E-S_c.txt") > Tissue <- factor(targets$Tissue) > Pperiod <- factor(targets$Pperiod) > Time <- factor(targets$Time) > design <- model.matrix(~0 + Tissue*Pperiod + Time, data=targets) > colnames(design) [1] "TissueC" "TissueR" "PperiodLO" [4] "PperiodSH" "Timeb" "Timec" [7] "Timed" "Timee" "Timef" [10] "Timeg" "Timeh" "Timei" [13] "Timej" "Timek" "Timel" [16] "Timem" "Timen" "Timeo" [19] "Timep" "TissueR:PperiodLO" "TissueR:PperiodSH" > fit <- lmFit(rma.pp, design) > cont.matrix <- makeContrasts(TissueR-TissueC, levels = design) Error in makeContrasts(TissueR - TissueC, levels = design) : Parameter names must by syntactically valid names in R > sessionInfo() R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] grDevices datasets splines graphics stats tcltk [7] utils methods base other attached packages: [1] mouse4302cdf_2.5.0 limma_3.2.1 affy_1.24.2 [4] Biobase_2.6.1 svSocket_0.9-48 TinnR_1.0.3 [7] R2HTML_1.59-1 Hmisc_3.7-0 survival_2.35-7 loaded via a namespace (and not attached): [1] affyio_1.14.0 cluster_1.12.1 grid_2.10.1 [4] lattice_0.17-26 preprocessCore_1.8.0 svMisc_0.9-56 [7] tools_2.10.1 > Targets file, "RNA_Targets_RE- ORDered&timeInRank&NoAnimal_L-E-S_c.txt": FileName Tissue Pperiod Time F01-Karl-Hyb3-PPL3-sample02.CEL R SH a F02-Karl-Hyb3-PPL3-sample03.CEL C SH a F03-Karl-Hyb3-PPL5-sample02.CEL R SH b F04-Karl-Hyb3-PPL5-sample03.CEL C SH b F05-Karl-Hyb3-PPL3-sample04.CEL R SH c F06-Karl-Hyb3-PPL3-sample05.CEL C SH c F07-Karl-Hyb3-PPL5-sample04.CEL R SH d F08-Karl-Hyb3-PPL5-sample05.CEL C SH d F09-Karl-Hyb3-PPL3-sample06.CEL R SH e F10-Karl-Hyb3-PPL3-sample07.CEL C SH e F11-Karl-Hyb3-PPL5-sample06.CEL R SH f F12-Karl-Hyb3-PPL5-sample07.CEL C SH f F13-Karl-Hyb3-PPL3-sample08.CEL R SH g F14-Karl-Hyb3-PPL3-sample09.CEL C SH g F15-Karl-Hyb3-PPL5-sample08.CEL R SH h F16-Karl-Hyb3-PPL5-sample09.CEL C SH h F17-Karl-Hyb3-PPL3-sample10.CEL R SH i F18-Karl-Hyb3-PPL3-sample11.CEL C SH i F19-Karl-Hyb3-PPL5-sample10.CEL R SH j F20-Karl-Hyb3-PPL5-sample11.CEL C SH j F21-Karl-Hyb3-PPL3-sample12.CEL R SH k F22-Karl-Hyb3-PPL3-sample13.CEL C SH k F23-Karl-Hyb3-PPL5-sample12.CEL R SH l F24-Karl-Hyb3-PPL5-sample13.CEL C SH l F25-Karl-Hyb3-PPL3-sample14.CEL R SH m F26-Karl-Hyb3-PPL3-sample15.CEL C SH m F27-Karl-Hyb3-PPL5-sample14.CEL R SH n F28-Karl-Hyb3-PPL5-sample15.CEL C SH n F29-Karl-Hyb3-PPL3-sample16.CEL R SH o F30-Karl-Hyb3-PPL3-sample17.CEL C SH o F31-Karl-Hyb3-PPL5-sample16.CEL R SH p F32-Karl-Hyb3-PPL5-sample17.CEL C SH p F33-Karl-Hyb1-PPL1-sample02.CEL R EQ a F34-Karl-Hyb1-PPL1-sample03.CEL C EQ a F35-Karl-Hyb1-PPL6-sample02.CEL R EQ b F36-Karl-Hyb1-PPL6-sample03.CEL C EQ b F37-Karl-Hyb1-PPL1-sample04.CEL R EQ c F38-Karl-Hyb1-PPL1-sample05.CEL C EQ c F39-Karl-Hyb1-PPL6-sample04.CEL R EQ d F40-Karl-Hyb1-PPL6-sample05.CEL C EQ d F41-Karl-Hyb1-PPL1-sample06.CEL R EQ e F42-Karl-Hyb1-PPL1-sample07.CEL C EQ e F43-Karl-Hyb1-PPL6-sample06.CEL R EQ f F44-Karl-Hyb1-PPL6-sample07.CEL C EQ f F45-Karl-Hyb1-PPL1-sample08.CEL R EQ g F46-Karl-Hyb1-PPL1-sample09.CEL C EQ g F47-Karl-Hyb1-PPL6-sample08.CEL R EQ h F48-Karl-Hyb1-PPL6-sample09.CEL C EQ h F49-Karl-Hyb1-PPL1-sample10.CEL R EQ i F50-Karl-Hyb1-PPL1-sample11.CEL C EQ i F51-Karl-Hyb1-PPL6-sample10.CEL R EQ j F52-Karl-Hyb1-PPL6-sample11.CEL C EQ j F53-Karl-Hyb1-PPL1-sample12.CEL R EQ k F54-Karl-Hyb1-PPL1-sample13.CEL C EQ k F55-Karl-Hyb1-PPL6-sample12.CEL R EQ l F56-Karl-Hyb1-PPL6-sample13.CEL C EQ l F57-Karl-Hyb1-PPL1-sample14.CEL R EQ m F58-Karl-Hyb1-PPL1-sample15.CEL C EQ m F59-Karl-Hyb1-PPL6-sample14.CEL R EQ n F60-Karl-Hyb1-PPL6-sample15.CEL C EQ n F61-Karl-Hyb1-PPL1-sample16.CEL R EQ o F62-Karl-Hyb1-PPL1-sample17.CEL C EQ o F63-Karl-Hyb1-PPL6-sample16.CEL R EQ p F64-Karl-Hyb1-PPL6-sample17.CEL C EQ p F65-Karl-Hyb2-PPL2-sample02.CEL R LO a F66-Karl-Hyb2-PPL2-sample03.CEL C LO a F67-Karl-Hyb2-PPL4-sample02.CEL R LO b F68-Karl-Hyb2-PPL4-sample03.CEL C LO b F69-Karl-Hyb2-PPL2-sample04.CEL R LO c F70-Karl-Hyb2-PPL2-sample05.CEL C LO c F71-Karl-Hyb2-PPL4-sample04.CEL R LO d F72-Karl-Hyb2-PPL4-sample05.CEL C LO d F73-Karl-Hyb2-PPL2-sample06.CEL R LO e F74-Karl-Hyb2-PPL2-sample07.CEL C LO e F75-Karl-Hyb2-PPL4-sample06.CEL R LO f F76-Karl-Hyb2-PPL4-sample07.CEL C LO f F77-Karl-Hyb2-PPL2-sample08.CEL R LO g F78-Karl-Hyb2-PPL2-sample09.CEL C LO g F79-Karl-Hyb2-PPL4-sample08.CEL R LO h F80-Karl-Hyb2-PPL4-sample09.CEL C LO h F81-Karl-Hyb2-PPL2-sample10.CEL R LO i F82-Karl-Hyb2-PPL2-sample11.CEL C LO i F83-Karl-Hyb2-PPL4-sample10.CEL R LO j F84-Karl-Hyb2-PPL4-sample11.CEL C LO j F85-Karl-Hyb2-PPL2-sample12.CEL R LO k F86-Karl-Hyb2-PPL2-sample13.CEL C LO k F87-Karl-Hyb2-PPL4-sample12.CEL R LO l F88-Karl-Hyb2-PPL4-sample13.CEL C LO l F89-Karl-Hyb2-PPL2-sample14.CEL R LO m F90-Karl-Hyb2-PPL2-sample15.CEL C LO m F91-Karl-Hyb2-PPL4-sample14.CEL R LO n F92-Karl-Hyb2-PPL4-sample15.CEL C LO n F93-Karl-Hyb2-PPL2-sample16.CEL R LO o F94-Karl-Hyb2-PPL2-sample17.CEL C LO o F95-Karl-Hyb2-PPL4-sample16.CEL R LO p F96-Karl-Hyb2-PPL4-sample17.CEL C LO p -- Karl Brand <k.brand at="" erasmusmc.nl=""> Department of Genetics Erasmus MC Dr Molewaterplein 50 3015 GE Rotterdam lab +31 (0)10 704 3409 fax +31 (0)10 704 4743 mob +31 (0)642 777 268
• 2.6k views
ADD COMMENT
0
Entering edit mode
Seth Falcon ★ 7.4k
@seth-falcon-992
Last seen 9.6 years ago
Hi Karl, On 2/1/10 8:54 AM, Karl Brand wrote: => Anyone that could shed light on the error- > > "Parameter names must by syntactically valid names in R" <snip> > Of particular note is that identical code run 24 hrs earlier on a > different machine succeeded without this error. Unfortunately i do not > have sessionInfo from that session and wont be able gain it as such any > time soon. Hmm, that part is curious, but I don't think we have enough information to comment usefully. <snip> > > colnames(design) > [1] "TissueC" "TissueR" "PperiodLO" > [4] "PperiodSH" "Timeb" "Timec" > [7] "Timed" "Timee" "Timef" > [10] "Timeg" "Timeh" "Timei" > [13] "Timej" "Timek" "Timel" > [16] "Timem" "Timen" "Timeo" > [19] "Timep" "TissueR:PperiodLO" "TissueR:PperiodSH" Those last two do not look like valid names to me. The ":" is not allowed in naked identifiers in R. You could try converting the ":" to "." or "_". Perhaps: colnames(design) <- sub(":", "_", colnames(design)) HTH, + seth -- Seth Falcon Bioconductor Core Team | FHCRC
ADD COMMENT
0
Entering edit mode
Thank you Seth, On 2/1/2010 6:51 PM, Seth Falcon wrote: > Hi Karl, > > On 2/1/10 8:54 AM, Karl Brand wrote: > => Anyone that could shed light on the error- >> >> "Parameter names must by syntactically valid names in R" > > <snip> > >> Of particular note is that identical code run 24 hrs earlier on a >> different machine succeeded without this error. Unfortunately i do not >> have sessionInfo from that session and wont be able gain it as such any >> time soon. > > Hmm, that part is curious, but I don't think we have enough information > to comment usefully. My bad: looks like some one (definitely not me, uhuh...) changed the code in the intervening period. > <snip> >> > colnames(design) >> [1] "TissueC" "TissueR" "PperiodLO" >> [4] "PperiodSH" "Timeb" "Timec" >> [7] "Timed" "Timee" "Timef" >> [10] "Timeg" "Timeh" "Timei" >> [13] "Timej" "Timek" "Timel" >> [16] "Timem" "Timen" "Timeo" >> [19] "Timep" "TissueR:PperiodLO" "TissueR:PperiodSH" > > Those last two do not look like valid names to me. The ":" is not > allowed in naked identifiers in R. I didn't know this. Strange (to me) that R outputs these identifiers for the columns with interaction; which obviously need relabeling. > You could try converting the ":" to "." or "_". Perhaps: > > colnames(design) <- sub(":", "_", colnames(design)) Worked a charm, though i did get this warning: Warning message: In contrasts.fit(fit, cont.matrix) : row names of contrasts don't match col names of coefficients So tried: > rownames(contrasts) <- colnames(coefficients) Which appear's to solve the problem (even though i dont realise the extent of the consequences of this action the output looked about right). Another disgruntled biologist assuaged. Big cheers, Karl > HTH, > > + seth > -- Karl Brand <k.brand at="" erasmusmc.nl=""> Department of Genetics Erasmus MC Dr Molewaterplein 50 3015 GE Rotterdam lab +31 (0)10 704 3409 fax +31 (0)10 704 4743 mob +31 (0)642 777 268
ADD REPLY

Login before adding your answer.

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