Mercurial > repos > melissacline > ucsc_cancer_utilities
diff seg2matrix/CGData/GenomicMatrix.py @ 31:ab20c0d04f4a
add seg2matrix tool
author | jingchunzhu |
---|---|
date | Fri, 24 Jul 2015 13:10:11 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seg2matrix/CGData/GenomicMatrix.py Fri Jul 24 13:10:11 2015 -0700 @@ -0,0 +1,37 @@ + +import csv +import CGData +import CGData.BaseMatrix + +class GenomicMatrix(CGData.BaseMatrix.BaseMatrix): + + __format__ = { + "name" : "genomicMatrix", + "type" : "type", + "form" : "matrix", + "rowType" : "probeMap", + "colType" : "idMap", + "valueType" : "float", + "nullString" : "NA", + "links" : { + "dataSubType" : {} + } + } + + def __init__(self): + CGData.BaseMatrix.BaseMatrix.__init__(self) + + def init_blank(self, cols, rows): + super(GenomicMatrix, self).init_blank(cols=cols,rows=rows) + if 'cgdata' not in self: + self['cgdata'] = { 'type' : 'genomicMatrix' } + + def get_probe_list(self): + return self.get_row_list() + + def get_sample_list(self): + return self.get_col_list() + + def get_data_subtype(self): + return self.get('cgdata', {}).get('dataSubType', None) +