[BioC] DEXSeq: Creating Sample
Martin Morgan
mtmorgan at fhcrc.org
Sun May 26 07:29:34 CEST 2013
On 05/25/2013 05:55 PM, Margaret Linan wrote:
> Hi-
>
> I tried to apply my files to the samples code given by the pasilla vignette
> and got an error. Note, the count.txt file has only two columns. Currently,
> I lack the information ( don't know how get it ), to accurately specify the
> condition= portion of the code below.
>
> samples=data.frame(condition=c(rep("treated", 3), rep("untreated",4)),
> row.names=(file.path("/home/mlinan", mustWork=TRUE), pattern="count.txt"),
> stringsAsFactors=TRUE, check.names=FALSE)
>
> Error: unexpected ',' in "samples=data.frame(condition=c(rep("treated", 3),
> rep("untreated",4)), row.names=(file.path("/home/mlinan", mustWork=TRUE),"
The error says that there is a ',' in a location in the command that you've
entered where one was not expected. Usually this is because of mis-placed
parentheses, but in this case you've written
row.names=(file.path("/home/mlinan", mustWork=TRUE), pattern="count.txt"),
but maybe meant to write
row.names=file.path("/home/mlinan", pattern="count.txt", mustWork=TRUE),
R allows one to write very dense code like this, but a useful strategy is to
develop complicated expressions by composing them from simpler lines that you
know work, e.g., verifying that file.path("/home/mlinan", pattern="count.txt",
mustWork=TRUE) returns something sensible, before trying the more complicated
instruction. (A common typo for me is to mis-spell 'mustWork=TRUE'; R then
returns a file path that doesn't work, because it doesn't recognize the
mis-spelled argument and tries to use 'TRUE' as part of the path). Be sure to
consult the help pages
?file.path
for details on how functions are to be used; the help pages may be intimidating
at first, but they end up being helpful.
It can be helpful to work from the R script files that most (though not all)
vignettes use. These are available from the package 'landing page'; I'm not sure
where the code chunk above is supposed to come from, but the DEXSeq landing page
is at
http://bioconductor.org/packages/release/bioc/html/DEXSeq.html
and the code used to generate the vignette is linked to that page, at
http://bioconductor.org/packages/release/bioc/vignettes/DEXSeq/inst/doc/DEXSeq.R
Actually, the vignette and script are installed with the package; the vignette
is accessible with
vignette(package="DEXSeq") ## discover available vignettes
vignette("DEXSeq") ## open the vignette
and the code in the vignette can be evaluated, in your own session, with
pdf = vignette("DEXSeq")$pdf ## path to vignette
script = sub(".pdf", ".R", pdf) ## path to script
source(script, echo=TRUE, max=Inf) ## evaluate all the code
Sometimes packages 'suggest' other packages that are used in the vignette, and
it is necessary to install those to evaluate the vignette code successfully.
Martin
>
> Any help is appreciated.
>
> Thanks,
> ML
> ASU Grad Student
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
--
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109
Location: Arnold Building M1 B861
Phone: (206) 667-2793
More information about the Bioconductor
mailing list