org.genepattern.io.expr.cls
Class ClsWriter
java.lang.Object
org.genepattern.io.expr.cls.ClsWriter
- public class ClsWriter
- extends java.lang.Object
Writer for cls files. CLS files are simple files created to load class
information into GeneCluster. These files use spaces to separate the fields.
- The first line of a CLS file contains numbers indicating the number of
samples and number of classes. The number of samples should correspond to the
number of samples in the associated RES or GCT data file.
- Line format: (number of samples) (space) (number of classes) (space) 1
- For example: 58 2 1
- The second line in a CLS file contains names for the class numbers. The
line should begin with a pound sign (#) followed by a space.
- Line format: # (space) (class 0 name) (space) (class 1 name)
- For example: # cured fatal/ref.
- The third line contains numeric class labels for each of the samples.
The number of class labels should be the same as the number of samples
specified in the first line.
- Line format: (sample 1 class) (space) (sample 2 class) (space) ...
(sample N class)
- For example: 0 0 0 ... 1
|
Method Summary |
java.lang.String |
checkFileExtension(java.lang.String pathname)
|
void |
write(ClassVector cv,
java.io.OutputStream os)
Writes an ClassVector instance to a file. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClsWriter
public ClsWriter()
checkFileExtension
public java.lang.String checkFileExtension(java.lang.String pathname)
write
public void write(ClassVector cv,
java.io.OutputStream os)
throws java.io.IOException
- Writes an
ClassVector instance to a file. The correct file
extension will be added to the file name if it does not already exist.
- Parameters:
cv - the class vectoros - the output stream
- Throws:
java.io.IOException - if an I/O error occurs during writing