-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClinicalMatrix.py
71 lines (53 loc) · 2.1 KB
/
ClinicalMatrix.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import cgDataV2.Exceptions
class ClinicalMatrix(object):
"""A ClinicalMatrix object contains the clinical data associated with
a given set of samples. In this matrix, the rows are samples and
the columns are clinical features. Missing values are denoted as blanks.
"""
# __format__ = {
# "name" : "clinicalMatrix",
# "type" : "type",
# "form" : "matrix",
# "rowType" : "idMap",
# "colType" : "clinicalFeature",
# "valueType" : "str",
# "nullString" : ""
# }
def __init__(self, clinicalMatrixMetadata):
"""Given a clinical matrix metadata object, load the
corresponding ClinicalMatrix object. Upon creation, the new
object is validated, and if it fails validation, a ValidationFailed
exception is thrown. """
pass
def __validate(self):
"""Validate this ClinicalMatrix, and throw a
ValidationFailed exception if unsuccessful. """
pass
def clinicalFeatureList(self):
"""Return the list of clinical features contained in this matrix"""
pass
def compareSampleIds(id1, id2):
"""Return the results of a lexical comparison between the two IDs"""
pass
def getValue(self, sampleId, clinicalFeature):
"""Get the data value for the indicated sample and clinical feature"""
pass
def nClinicalFeatures(self):
"""Return the number of clinical features in this matrix"""
pass
def nSamples(self):
"""Return the number of samples in this matrix"""
pass
def sampleList(self):
"""Return the list of samples represented in this matrix"""
pass
def setValue(self, sample, cliincalFeature, newValue):
"""Update the value stored for the indicated probe and sample
"""
pass
def sortClinicalMatrix(self, cmp=compareSampleIds):
"""Sort the clinical matrix according to the indicated comparison function"""
pass
def write(self, filename):
"""Write the CinicalMatrix object to the indicated filename"""
pass