public class Clustering
extends Object
Clustering
class represents a
clustering (i.e., grouping or partitioning) of a collection of genes.Modifier and Type | Field and Description |
---|---|
protected java.util.Vector<Cluster> |
clusters
A collection of clusters
|
protected java.util.Vector<String> |
experiments
A collection of experiment names
|
protected java.util.Vector<Gene> |
genes
A collection of genes
|
Constructor and Description |
---|
Clustering(String fileName)
Creates an initially empty
Clustering . |
Modifier and Type | Method and Description |
---|---|
java.util.Vector<String> |
getExperimentNamesFromFile(String fileName)
Returns a collection of experiment names for which there is data in the specified file.
|
java.util.Vector<Gene> |
getGeneInformationFromFile(String fileName)
Returns a collection of
Genes based on data in the specified file. |
int |
getNumClusters()
Returns the number of clusters in this
Clustering . |
int |
getNumExperiments()
Returns the number of experiments in this
Clustering . |
int |
getNumGenes()
Returns the total number of genes in this
Clustering . |
static void |
main(String[] args)
The
main method creates an initially empty Clustering from a tab-delimited text file of gene and experiment data. |
String |
toString()
Returns a
String representation of all Clusters in this Clustering . |
protected java.util.Vector<String> experiments
protected java.util.Vector<Gene> genes
protected java.util.Vector<Cluster> clusters
public Clustering(String fileName)
Clustering
.
A set of genes and experiments are determined from the specified String
representing the name of a file.
Genes and experiments are read-in from the tab-delimited file. Initially, the constructed
Clustering
is empty.
fileName
- the name of a tab-delimited text file containing gene and experiment datapublic int getNumExperiments()
Clustering
.public int getNumGenes()
Clustering
.public int getNumClusters()
Clustering
.public java.util.Vector<String> getExperimentNamesFromFile(String fileName)
The method assumes that the first line of the specified file
contains a tab-delimited list of experiment names. The first
two tokens on the first line do not correspond to experiment
names and are ignored. Thus, if the first line of the file
contains "m+2" tab-delimited tokens, then the line contains
"m" experiment names. A Vector
containing the
names of the experiments is returned.
fileName
- the name of a tab-delimited text file with gene and experiment datapublic java.util.Vector<Gene> getGeneInformationFromFile(String fileName)
Genes
based on data in the specified file.
The method assumes that the specified file is tab-delimited.
The method assumes that the first line of the specified file
is a header line that does not contain any gene information.
Starting with the second line of the file and continuing until
the end of the file, the method assumes that each line is a
tab-delimited collection of gene information, including
the gene's name, function, and expression values.
A Vector
of Gene
objects is returned.
fileName
- the name of a tab-delimited text file with gene and experiment dataGenes
as extracted from the specified filepublic String toString()
String
representation of all Clusters
in this Clustering
.toString
in class Object
String
represenation of this Clustering
public static void main(String[] args)
main
method creates an initially empty Clustering
from a tab-delimited text file of gene and experiment data.args
- an array of Strings
representing any command line arguments