Export .ccmap as text fileΒΆ

Presently only COO list format is implemented in gcMapExplorer.ccmap.export_ccmap function. In COO format, lists of (row, column, value) as three tab seprated columns are written in output file.

See also

Module gcMapExplorer.ccmap.export_ccmap()

In [1]:
import gcMapExplorer.lib as gmlib
In [2]:
# Input files and path
inputPath='normalized/'
files=  ['chr5_100kb_normKR.ccmap', 'chr15_100kb_normKR.ccmap',
         'chr20_100kb_normKR.ccmap', 'chr21_100kb_normKR.ccmap']

#Output files and path
outputPath = 'export/'
outputs=['chr5_100kb.txt',    'chr15_100kb.txt',  'chr20_100kb.txt',  'chr21_100kb.txt']


for i, o in zip(files, outputs):
    ccmap = gmlib.ccmap.load_ccmap(inputPath+i)
    gmlib.ccmap.export_cmap(ccmap, outputPath+o, doNotWriteZeros=True)