| |
Methods defined here:
- __init__(self, data, numGenes, classSizes, geneNet, geneNetSize, numTopNetworks, netMap)
- addUnclassified(self, unclassifiedVector)
- Takes unclassified data vector and saves it
- classify(self)
- Returns 0 or 1.
The netStart and netEnd
are where in the rank templates and unclassified rank vector the
gene network you are interested in is located.
Update: you can now set numTopNetworks in the constructor.
Passing here should be deprecated.
- classify_network(self, network_index)
- Returns a tuple that contains
(classified class [0 or 1], class one percent match,
class two percent match)
uses C classify function
- crossValidate(self, k=10)
- Runs the C-based cross validation
K-Fold testing of the given data, returns Matthews correlation coefficient.
- getNetworkRankSize(self, network_idx)
- Returns the size of a network segment of
a rank based data structure (template or matrix)
- getNetworkRankStart(self, network_id)
- Returns the starting index of a network segment of
a rank based data structure (template or matrix)
- getNetworkStart(self, network_id)
- Maps the gene network( relative to its position in geneNetSize)
to the starting location of its data matrix entries.
i.e finding the starting location of the gene indices in the
data matrix tables for the 3rd gene would be getNetworkStart(3)
- getRankConservation(self)
- Returns a list of lists that contains the rank conservation score
for each class and gene network
[
rcs for
[gn1.class1,gn1.class2],
[gn2.class1,gn2.class2],
...,
[gnn.class1,gn2.class2]
]
- getRankDifference(self, numNets=None)
- Returns a list of tuples containing (sum of matches, gene_index, distance) in sorted order
- getRankMatchingScores(self)
- Returns a list of lists {(2 * num genenetworks) x (number of samples)}
containing the rank matching scores
which describe how well a sample matches a template.
[
rms of rt.c1.gN1 vs [c1.sa1.gN1, c1.sa2,gN1, ... c2.san.gN1],
rt.c2.gN1 vs [c1.sa1.gN1, c1.sa2,gN1, ... c2.san.gN1],
...,
rt.c2.gNn vs [c1.sa1.gNn, c1.sa2,gNn, ... c2.san.gNn],
]
- getRankMatrix(self)
- Returns the rankMatrix as a list of Bools
[
[class1.sample1.genenet1.gene1, sample1.genenet1.gene2 , ... sample1.gnN,gN]
[class1.sample2.genenet1.gene1, sample2.geneNet1.gene2, ...]
...
[class2.samplen.genenet1.gene1, ...]
]
- getRankTemplates(self)
- Returns the rank templates for class1 class2
[
[class 1 rt by geneNetwork order]
[class 2 rt by geneNetwork order]
]
- getTopNetworks(self)
- returns a list of the top networks(by name) as determined by get rank difference
- getUnclassifiedRankTemplate(self, geneNetwork)
- Builds the rank template for the unclassified vector
for the subset defined by the gene network at genestart
that goes to geneEnd
- nChooseTwo(self, n)
- testAll(self)
- Some testing for debugging purposes
- train(self)
- This is the method that performs the training from the provided data
- vecToList(self, vector, numRows)
- Takes a vector and turns it into a list of lists with the inner lists
having len(numRows)
|