Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/export.broad.cls.R
In the discrete case, each cls can contain only one parameter, thus the argument must be a vector of labels. If you'd like control over which class gets assigned to 0, 1, 2... then use pass in a factor of your choosing & the levels of the factor will guide the class names.
1 2 | export.broad.cls(labels, file, continuous = FALSE, start.value = 0,
check.levels = TRUE)
|
labels |
the labels. see description. |
file |
the output file name. |
continuous |
are the labels continuous or discrete?
|
start.value |
most cls files start from 0, however you can change this if you like. |
check.levels |
logical: if |
There is some ambiguity in the way samples are assigned to classes.
eg:
2 2 1
# classA classB
1 0
The majority of tools would say the first sample belongs to class B (eg ScorebyClassComp),
others (eg GSEA) would say that the first sample is classA, and maps all instances of a
'1' to classA, and all instances of a '0' to the 2nd class. And others like PGSEA
enforce the levels c(1,2).
If check.levels=TRUE
, and labels is a factor
, then this checks
that the order of the levels matches the order of the samples.
In general, I try write non-ambiguous cls files, but sometimes it is unavoidable,
in which case set check.levels=FALSE
.
In the continuous case, you can have >= 1 parameter. either pass in a numeric vector; or a matrix/data.frame where each row represents a different parameter; or a list where each element is a vector, and each element represents a parameter.
none. creates a cls file.
update 2009-07-08: cls labels can't have spaces in them.
Mark Cowley, 2009-06-26
http://www.broadinstitute.org/cancer/software/genepattern/tutorial/gp_fileformats.html#cls
1 2 3 4 5 6 7 8 9 10 | cls <- c(rep("wt",5), rep("mut", 5))
f <- tempfile()
export.broad.cls(cls, f, FALSE, 0)
cls2 <- rnorm(10)
f2 <- tempfile()
export.broad.cls(cls2, f2, TRUE, 0)
cls3 <- factor(c("ClassB", "ClassA"), levels=c("ClassA", "ClassB"))
export.broad.cls(cls3, f2, FALSE, 0, check.levels=TRUE)
export.broad.cls(cls3, f2, FALSE, 0, check.levels=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.