export.broad.cls: Export a cls file for GenePattern. Export a cls file for...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/export.broad.cls.R

Description

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.

Usage

1
2
export.broad.cls(labels, file, continuous = FALSE, start.value = 0,
  check.levels = TRUE)

Arguments

labels

the labels. see description.

file

the output file name.

continuous

are the labels continuous or discrete? TRUE/FALSE, respectively.

start.value

most cls files start from 0, however you can change this if you like.

check.levels

logical: if TRUE, then the order of the levels must match the order of the samples (ie avoid the ambiguous cls files )

Details

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.

Value

none. creates a cls file.

Note

update 2009-07-08: cls labels can't have spaces in them.

Author(s)

Mark Cowley, 2009-06-26

References

http://www.broadinstitute.org/cancer/software/genepattern/tutorial/gp_fileformats.html#cls

See Also

import.gsea.cls

Examples

 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)

drmjc/metaGSEA documentation built on Aug. 8, 2020, 1:53 p.m.