How to Import external HI-C map data?

1. From a matrix coordinate format text file

As shown below in example, in this format, first and second column is location on chromosome and third column is the respective value:

20000000    20000000    2692.0
20000000    20100000    885.0
20100000    20100000    6493.0
20000000    20200000    15.0
20100000    20200000    52.0
20200000    20200000    2.0
20000000    20300000    18.0
20100000    20300000    40.0
.
.
.
.
.
.

Hi-C maps data with the above format are available with this article and can be downlaoded here.


At first, we import gcMapExplorer.lib module

All neccessary modules are avaiable in gcMapExplorer.lib module

In [1]:
from gcMapExplorer import lib as gmlib

This module has methods to read and save ccmap file as shown below in the exmaple.

Remove old files if any present in output directories

In [2]:
%%bash

for f in ./cmaps/binContact/*; do
    [ -e "$f" ] && rm $f
done

for f in ./cmaps/CooMatrix/*; do
    [ -e "$f" ] && rm $f
done

for f in ./cmaps/homer/*; do
    [ -e "$f" ] && rm $f
done

We read Hi-C file as follows:

In [3]:
cooReader = gmlib.importer.CooMatrixHandler('./data/CooMatrixFormat/chr15_100kb.RAWobserved')

See also

Function gcMapExplorer.lib.importer.CooMatrixHandler() for more details.

Now, save the Hi-C map as ccmap:

We save imported Hi-C map in cmaps directory as chr15_100kb_Raw_from_text.ccmap file. To reduce the storage memory, map file is compressed in gzip format.

In [4]:
cooReader.save_ccmaps('cmaps/CooMatrix/chr15_100kb_Raw_from_text.ccmap', xlabels='chr15')
del cooReader       # Delete object and generated any temporary files
INFO:CooMatrixHandler: Reading file: [./data/CooMatrixFormat/chr15_100kb.RAWobserved]...

INFO:CooMatrixHandler:     ... Finished reading file: [./data/CooMatrixFormat/chr15_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 318258
INFO:genMapFromLists:Minimum base-pair: 20000000 and Maximum base-pair: 102500000 are present in input data
INFO:genMapFromLists:Shape of overall map: (1026, 1026)

INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr15_100kb_Raw_from_text.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr15_100kb_Raw_from_text.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr15_100kb_Raw_from_text.npbin] ...
INFO:save_ccmap:       Finished!!!

See also


Importing from a tar archive

If a Hi-C map data file is present inside a tar archive, the map file can be directly imported as follows:

In [5]:
tarfile = 'data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz'            # Input Tar archive
mapfile = '100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved' # Map file in archive
cooReader = gmlib.importer.CooMatrixHandler(mapfile, tarfile)

where, data/100kb_resolution_intrachromosomal.tar.gz is input tar archive and 100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved is a map file inside the archive.

Now, save the Hi-C map as ccmap: as already shown above.

In [6]:
cooReader.save_ccmaps('cmaps/CooMatrix/chr15_100kb_raw_from_archive.ccmap', xlabels='chr15')
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 318258
INFO:genMapFromLists:Minimum base-pair: 20000000 and Maximum base-pair: 102500000 are present in input data
INFO:genMapFromLists:Shape of overall map: (1026, 1026)

INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr15_100kb_raw_from_archive.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr15_100kb_raw_from_archive.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr15_100kb_raw_from_archive.npbin] ...
INFO:save_ccmap:       Finished!!!


Convert several files from a tar archive

100kb_resolution_intrachromosomal.tar.gz file contains six Hi-C map data files. Through a for loop, these files can be imported and saved. Path to these files in the tar archive are as follows:

100kb_resolution_intrachromosomal/chr1/MAPQGE30/chr1_100kb.RAWobserved
100kb_resolution_intrachromosomal/chr5/MAPQGE30/chr5_100kb.RAWobserved
100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved
100kb_resolution_intrachromosomal/chr20/MAPQGE30/chr20_100kb.RAWobserved
100kb_resolution_intrachromosomal/chr21/MAPQGE30/chr21_100kb.RAWobserved
100kb_resolution_intrachromosomal/chr22/MAPQGE30/chr22_100kb.RAWobserved

These file names have a pattern, and we utilize this pattern to form a name inside for loop.

In [7]:
tarfile = 'data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz'

chroms = [1, 5, 15, 20, 21, 22]      # List of chromosomes

# Loop for each chromosome
inputFileList = []
outputFileList = []
xlabels = []
for chrom in chroms:
    mapfile = '100kb_resolution_intrachromosomal/chr{0}/MAPQGE30/chr{0}_100kb.RAWobserved' .format(chrom)
    inputFileList.append(mapfile)

    output_file = 'cmaps/CooMatrix/chr{0}_100kb_RawObserved.ccmap' .format(chrom)     # Output file name
    outputFileList.append(output_file)

    xlabels.append( 'chr{0}'.format(chrom) )

cooReader = gmlib.importer.CooMatrixHandler(inputFileList, tarfile)
cooReader.save_ccmaps(outputFileList, xlabels=xlabels)
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr1/MAPQGE30/chr1_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr1/MAPQGE30/chr1_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 2435300
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 249200000 are present in input data
INFO:genMapFromLists:Shape of overall map: (2493, 2493)

INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr1_100kb_RawObserved.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr1_100kb_RawObserved.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr1_100kb_RawObserved.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr5/MAPQGE30/chr5_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr5/MAPQGE30/chr5_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 1533205
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 180800000 are present in input data
INFO:genMapFromLists:Shape of overall map: (1809, 1809)

INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr5_100kb_RawObserved.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr5_100kb_RawObserved.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr5_100kb_RawObserved.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 318258
INFO:genMapFromLists:Minimum base-pair: 20000000 and Maximum base-pair: 102500000 are present in input data
INFO:genMapFromLists:Shape of overall map: (1026, 1026)

INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr15_100kb_RawObserved.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr15_100kb_RawObserved.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr15_100kb_RawObserved.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr20/MAPQGE30/chr20_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr20/MAPQGE30/chr20_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 179488
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 62900000 are present in input data
INFO:genMapFromLists:Shape of overall map: (630, 630)

INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr20_100kb_RawObserved.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr20_100kb_RawObserved.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr20_100kb_RawObserved.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr21/MAPQGE30/chr21_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...
INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr21/MAPQGE30/chr21_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 60664
INFO:genMapFromLists:Minimum base-pair: 9400000 and Maximum base-pair: 48100000 are present in input data
INFO:genMapFromLists:Shape of overall map: (482, 482)


INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr21_100kb_RawObserved.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr21_100kb_RawObserved.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr21_100kb_RawObserved.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr22/MAPQGE30/chr22_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...
INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr22/MAPQGE30/chr22_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 59429
INFO:genMapFromLists:Minimum base-pair: 16000000 and Maximum base-pair: 51200000 are present in input data
INFO:genMapFromLists:Shape of overall map: (513, 513)


INFO:save_ccmap: Saving ccmap to file [cmaps/CooMatrix/chr22_100kb_RawObserved.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr22_100kb_RawObserved.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/CooMatrix/chr22_100kb_RawObserved.npbin] ...
INFO:save_ccmap:       Finished!!!

Now, in cmaps/CooMatrix directory, all files from archive are saved. These files can be used either with browser to visualize or for further analysis.

Convert to gcmap file

The contact map files can be converted to gcmap format file.

See also

In [8]:
tarfile = 'data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz'

chroms = [1, 5, 15, 20, 21, 22]      # List of chromosomes

# Loop for each chromosome
inputFileList = []
outputFileList = []
xlabels = []
for chrom in chroms:
    mapfile = '100kb_resolution_intrachromosomal/chr{0}/MAPQGE30/chr{0}_100kb.RAWobserved' .format(chrom)
    inputFileList.append(mapfile)

    output_file = 'cmaps/CooMatrix/chr{0}_100kb_RawObserved.ccmap' .format(chrom)     # Output file name
    outputFileList.append(output_file)

    xlabels.append( 'chr{0}'.format(chrom) )

cooReader = gmlib.importer.CooMatrixHandler(inputFileList, tarfile)
cooReader.save_gcmap('cmaps/CooMatrix/rawObserved_100kb.gcmap', xlabels=xlabels, coarsingMethod='sum', compression='lzf')
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr1/MAPQGE30/chr1_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr1/MAPQGE30/chr1_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 2435300
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 249200000 are present in input data
INFO:genMapFromLists:Shape of overall map: (2493, 2493)

INFO:addCCMap2GCMap: Opened file [cmaps/CooMatrix/rawObserved_100kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/CooMatrix/rawObserved_100kb.gcmap] for [chr1] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr1] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr1] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr1] ...
INFO:addCCMap2GCMap: Closed file [cmaps/CooMatrix/rawObserved_100kb.gcmap]...
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr5/MAPQGE30/chr5_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr5/MAPQGE30/chr5_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 1533205
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 180800000 are present in input data
INFO:genMapFromLists:Shape of overall map: (1809, 1809)

INFO:addCCMap2GCMap: Opened file [cmaps/CooMatrix/rawObserved_100kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/CooMatrix/rawObserved_100kb.gcmap] for [chr5] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr5] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr5] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr5] ...
INFO:addCCMap2GCMap: Closed file [cmaps/CooMatrix/rawObserved_100kb.gcmap]...
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr15/MAPQGE30/chr15_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 318258
INFO:genMapFromLists:Minimum base-pair: 20000000 and Maximum base-pair: 102500000 are present in input data
INFO:genMapFromLists:Shape of overall map: (1026, 1026)

INFO:addCCMap2GCMap: Opened file [cmaps/CooMatrix/rawObserved_100kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/CooMatrix/rawObserved_100kb.gcmap] for [chr15] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr15] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr15] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr15] ...
INFO:addCCMap2GCMap: Closed file [cmaps/CooMatrix/rawObserved_100kb.gcmap]...
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr20/MAPQGE30/chr20_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...

INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr20/MAPQGE30/chr20_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 179488
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 62900000 are present in input data
INFO:genMapFromLists:Shape of overall map: (630, 630)

INFO:addCCMap2GCMap: Opened file [cmaps/CooMatrix/rawObserved_100kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/CooMatrix/rawObserved_100kb.gcmap] for [chr20] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr20] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr20] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr20] ...
INFO:addCCMap2GCMap: Closed file [cmaps/CooMatrix/rawObserved_100kb.gcmap]...
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr21/MAPQGE30/chr21_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...
INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr21/MAPQGE30/chr21_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 60664
INFO:genMapFromLists:Minimum base-pair: 9400000 and Maximum base-pair: 48100000 are present in input data
INFO:genMapFromLists:Shape of overall map: (482, 482)


INFO:addCCMap2GCMap: Opened file [cmaps/CooMatrix/rawObserved_100kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/CooMatrix/rawObserved_100kb.gcmap] for [chr21] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr21] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr21] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr21] ...
INFO:addCCMap2GCMap: Closed file [cmaps/CooMatrix/rawObserved_100kb.gcmap]...
INFO:CooMatrixHandler: Extracting-Reading [100kb_resolution_intrachromosomal/chr22/MAPQGE30/chr22_100kb.RAWobserved] from [data/CooMatrixFormat/100kb_resolution_intrachromosomal.tar.gz]...
INFO:CooMatrixHandler:   ...Finished extracting and reading [100kb_resolution_intrachromosomal/chr22/MAPQGE30/chr22_100kb.RAWobserved]
INFO:genMapFromLists: Total number of data in input file: 59429
INFO:genMapFromLists:Minimum base-pair: 16000000 and Maximum base-pair: 51200000 are present in input data
INFO:genMapFromLists:Shape of overall map: (513, 513)


INFO:addCCMap2GCMap: Opened file [cmaps/CooMatrix/rawObserved_100kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/CooMatrix/rawObserved_100kb.gcmap] for [chr22] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr22] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr22] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr22] ...
INFO:addCCMap2GCMap: Closed file [cmaps/CooMatrix/rawObserved_100kb.gcmap]...

2. From HOMER Hi-C interaction matrix format

HOMER package contains modules to analyze genome wide interaction data. It creates Hi-C matrix in a specific format as shown in this link.

Covert to ccmap

An example input file human_INL_sample1_matrix_1Mb_raw.txt is present in data/HomerFormat directory. Below, we read it and convert it to .ccmap formats. The input file contains several chromosomes, therefore, several .ccmap files will be generated for each respective chromosome.

Ouput .ccmap files with suffix='_sample1' will be saved in cmaps/homer directory.

See also

Class gcMapExplorer.lib.importer.HomerInputHandler() for more details.

In [9]:
# Initialize
homer_reader = gmlib.importer.HomerInputHandler('data/HomerFormat/human_INL_sample1_matrix_1Mb_raw.txt')

# Convert and save
homer_reader.save_ccmaps('cmaps/homer', suffix='_sample1')

# Delete all temporary files, neccessary, automatically deleted
del homer_reader
INFO:HomerInputHandler: Getting chromosome list and resolution from Input Files ...
INFO:HomerInputHandler: Resolution: 1mb
INFO:HomerInputHandler: Following chromsomes found in input files:
                              chr1
                              chr2
                              chr3
                              chr4
                              chr5
                              chr6
                              chr7
                              chr8
                              chr9
                              chr10
                              chr11
                              chr12
                              chr13
                              chr14
                              chr15
                              chr16
                              chr17
                              chr18
                              chr19
                              chr20
                              chr21
                              chr22
                              chrMT
                              chrX
                              chrY
INFO:HomerInputHandler: Reading [data/HomerFormat/human_INL_sample1_matrix_1Mb_raw.txt] file ...
INFO:HomerInputHandler:           ... Finished reading [data/HomerFormat/human_INL_sample1_matrix_1Mb_raw.txt] file ...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr1_f77vvnvf.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr1_f77vvnvf.tmp]
INFO:genMapFromLists: Total number of data in input file: 40344
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 249000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (250, 250)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr1_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr1_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr1_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr2_vkkm8epw.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr2_vkkm8epw.tmp]
INFO:genMapFromLists: Total number of data in input file: 46886
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 243000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (244, 244)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr2_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr2_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr2_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr3_9ykqxl7v.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr3_9ykqxl7v.tmp]
INFO:genMapFromLists: Total number of data in input file: 33308
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 197000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (198, 198)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr3_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr3_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr3_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr4_2rrmxtgs.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr4_2rrmxtgs.tmp]
INFO:genMapFromLists: Total number of data in input file: 29054
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 191000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (192, 192)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr4_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr4_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr4_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr5_54n2e8ij.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr5_54n2e8ij.tmp]
INFO:genMapFromLists: Total number of data in input file: 26286
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 180000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (181, 181)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr5_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr5_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr5_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr6_52cmdvyx.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr6_52cmdvyx.tmp]
INFO:genMapFromLists: Total number of data in input file: 25032
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 171000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (172, 172)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr6_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr6_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr6_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr7_5ormk7rj.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr7_5ormk7rj.tmp]
INFO:genMapFromLists: Total number of data in input file: 20748
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 159000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (160, 160)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr7_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr7_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr7_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr8_fedpovvz.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr8_fedpovvz.tmp]
INFO:genMapFromLists: Total number of data in input file: 18371
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 146000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (147, 147)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr8_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr8_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr8_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr9_qbg3ysw1.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr9_qbg3ysw1.tmp]
INFO:genMapFromLists: Total number of data in input file: 11414
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 141000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (142, 142)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr9_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr9_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr9_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr10_van15vqd.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr10_van15vqd.tmp]
INFO:genMapFromLists: Total number of data in input file: 15560
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 135000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (136, 136)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr10_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr10_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr10_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr11_fnxjyqlz.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr11_fnxjyqlz.tmp]
INFO:genMapFromLists: Total number of data in input file: 15429
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 134000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (135, 135)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr11_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr11_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr11_1mb__sample1.npbin] ...

INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr12_5_4a9ygv.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr12_5_4a9ygv.tmp]
INFO:genMapFromLists: Total number of data in input file: 14928
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 133000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (134, 134)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr12_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr12_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr12_1mb__sample1.npbin] ...

INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr13_gaajxa0_.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr13_gaajxa0_.tmp]
INFO:genMapFromLists: Total number of data in input file: 8675
INFO:genMapFromLists:Minimum base-pair: 19000000 and Maximum base-pair: 115000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (116, 116)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr13_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr13_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr13_1mb__sample1.npbin] ...

INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr14_4vrfy9r7.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr14_4vrfy9r7.tmp]
INFO:genMapFromLists: Total number of data in input file: 7245
INFO:genMapFromLists:Minimum base-pair: 19000000 and Maximum base-pair: 107000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (108, 108)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr14_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr14_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr14_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr15_6ewiakeq.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr15_6ewiakeq.tmp]
INFO:genMapFromLists: Total number of data in input file: 6249
INFO:genMapFromLists:Minimum base-pair: 20000000 and Maximum base-pair: 102000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (103, 103)



INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr15_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr15_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr15_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr16__1yly3n6.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr16__1yly3n6.tmp]
INFO:genMapFromLists: Total number of data in input file: 5629
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 90000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (91, 91)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr16_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr16_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr16_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr17_nt5_zegm.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr17_nt5_zegm.tmp]
INFO:genMapFromLists: Total number of data in input file: 5650
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 81000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (82, 82)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr17_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr17_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr17_1mb__sample1.npbin] ...


INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr18_xcgf_1cx.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr18_xcgf_1cx.tmp]
INFO:genMapFromLists: Total number of data in input file: 5581
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 78000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (79, 79)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr18_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr18_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr18_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr19_4662o8wv.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr19_4662o8wv.tmp]
INFO:genMapFromLists: Total number of data in input file: 3012
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 59000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (60, 60)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr19_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr19_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr19_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr20_8g0vjmpm.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr20_8g0vjmpm.tmp]
INFO:genMapFromLists: Total number of data in input file: 3563
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 62000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (63, 63)




INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr20_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr20_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr20_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr21_y1cttm1r.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr21_y1cttm1r.tmp]
INFO:genMapFromLists: Total number of data in input file: 1266
INFO:genMapFromLists:Minimum base-pair: 9000000 and Maximum base-pair: 48000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (49, 49)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr21_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr21_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr21_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr22_yqqbttxz.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr22_yqqbttxz.tmp]
INFO:genMapFromLists: Total number of data in input file: 1222
INFO:genMapFromLists:Minimum base-pair: 16000000 and Maximum base-pair: 51000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (52, 52)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr22_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr22_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr22_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrMT_e250ze2w.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrMT_e250ze2w.tmp]
INFO:genMapFromLists: Total number of data in input file: 1
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 0 are present in input data
INFO:genMapFromLists:Shape of overall map: (1, 1)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chrMT_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrMT_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrMT_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrX_bdb_wu8f.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrX_bdb_wu8f.tmp]
INFO:genMapFromLists: Total number of data in input file: 20634
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 155000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (156, 156)





INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chrX_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrX_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrX_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrY_do37o7a1.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrY_do37o7a1.tmp]
INFO:genMapFromLists: Total number of data in input file: 18
INFO:genMapFromLists:Minimum base-pair: 3000000 and Maximum base-pair: 59000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (60, 60)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chrY_1mb__sample1.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrY_1mb__sample1.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrY_1mb__sample1.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:HomerInputHandler: Saved ['cmaps/homer/chr1_1mb__sample1.ccmap', 'cmaps/homer/chr2_1mb__sample1.ccmap', 'cmaps/homer/chr3_1mb__sample1.ccmap', 'cmaps/homer/chr4_1mb__sample1.ccmap', 'cmaps/homer/chr5_1mb__sample1.ccmap', 'cmaps/homer/chr6_1mb__sample1.ccmap', 'cmaps/homer/chr7_1mb__sample1.ccmap', 'cmaps/homer/chr8_1mb__sample1.ccmap', 'cmaps/homer/chr9_1mb__sample1.ccmap', 'cmaps/homer/chr10_1mb__sample1.ccmap', 'cmaps/homer/chr11_1mb__sample1.ccmap', 'cmaps/homer/chr12_1mb__sample1.ccmap', 'cmaps/homer/chr13_1mb__sample1.ccmap', 'cmaps/homer/chr14_1mb__sample1.ccmap', 'cmaps/homer/chr15_1mb__sample1.ccmap', 'cmaps/homer/chr16_1mb__sample1.ccmap', 'cmaps/homer/chr17_1mb__sample1.ccmap', 'cmaps/homer/chr18_1mb__sample1.ccmap', 'cmaps/homer/chr19_1mb__sample1.ccmap', 'cmaps/homer/chr20_1mb__sample1.ccmap', 'cmaps/homer/chr21_1mb__sample1.ccmap', 'cmaps/homer/chr22_1mb__sample1.ccmap', 'cmaps/homer/chrMT_1mb__sample1.ccmap', 'cmaps/homer/chrX_1mb__sample1.ccmap', 'cmaps/homer/chrY_1mb__sample1.ccmap'] files.

Convert from zip file to ccmap file

An example input zip file human_INL.zip is present in data/HomerFormat directory. This zip file contains two text files. Below, we read, combine and convert them to .ccmap formats. The input file contains several chromosomes, therefore, several .ccmap files will be generated for each respective chromosome.

Ouput .ccmap files with suffix='_combined' will be saved in cmaps/homer directory.

In [10]:
# Name of input ZIP file
inputCompressedFile = 'data/HomerFormat/human_INL.zip'

# List of files inside zip archive
files = ['human_INL_sample1_matrix_1Mb_raw.txt', 'human_INL_sample2_matrix_1Mb_raw.txt']

# Initialize
homer_reader = gmlib.importer.HomerInputHandler(files, inputCompressedFile)
homer_reader.save_ccmaps('cmaps/homer', suffix='_combined')

# Delete all temporary files, not neccessary, automatically deleted after
del homer_reader
INFO:HomerInputHandler: Getting chromosome list and resolution from Input Files ...
INFO:HomerInputHandler: Resolution: 1mb
INFO:HomerInputHandler: Following chromsomes found in input files:
                              chr1
                              chr2
                              chr3
                              chr4
                              chr5
                              chr6
                              chr7
                              chr8
                              chr9
                              chr10
                              chr11
                              chr12
                              chr13
                              chr14
                              chr15
                              chr16
                              chr17
                              chr18
                              chr19
                              chr20
                              chr21
                              chr22
                              chrMT
                              chrX
                              chrY
INFO:HomerInputHandler: Reading [human_INL_sample1_matrix_1Mb_raw.txt] file ...
INFO:HomerInputHandler:           ... Finished reading [human_INL_sample1_matrix_1Mb_raw.txt] file ...
INFO:HomerInputHandler: Reading [human_INL_sample2_matrix_1Mb_raw.txt] file ...
INFO:HomerInputHandler:           ... Finished reading [human_INL_sample2_matrix_1Mb_raw.txt] file ...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr1_3sk6otug.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr1_3sk6otug.tmp]
INFO:genMapFromLists: Total number of data in input file: 73792
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 249000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (250, 250)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr1_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr1_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr1_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr2_truhub8_.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr2_truhub8_.tmp]
INFO:genMapFromLists: Total number of data in input file: 84760
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 243000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (244, 244)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr2_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr2_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr2_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr3_aw9a_mmf.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr3_aw9a_mmf.tmp]
INFO:genMapFromLists: Total number of data in input file: 61102
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 197000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (198, 198)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr3_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr3_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr3_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr4_9beyxm8x.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr4_9beyxm8x.tmp]
INFO:genMapFromLists: Total number of data in input file: 52272
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 191000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (192, 192)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr4_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr4_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr4_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr5_3s7i8xdr.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr5_3s7i8xdr.tmp]
INFO:genMapFromLists: Total number of data in input file: 47594
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 180000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (181, 181)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr5_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr5_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr5_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr6_ky_ory9p.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr6_ky_ory9p.tmp]
INFO:genMapFromLists: Total number of data in input file: 46347
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 171000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (172, 172)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr6_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr6_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr6_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr7_i3bykuzk.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr7_i3bykuzk.tmp]
INFO:genMapFromLists: Total number of data in input file: 38192
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 159000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (160, 160)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr7_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr7_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr7_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr8_d9rpwhnf.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr8_d9rpwhnf.tmp]
INFO:genMapFromLists: Total number of data in input file: 34554
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 146000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (147, 147)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr8_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr8_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr8_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr9_jfoof4qc.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr9_jfoof4qc.tmp]
INFO:genMapFromLists: Total number of data in input file: 21457
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 141000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (142, 142)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr9_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr9_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr9_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr10_7yjs3x_z.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr10_7yjs3x_z.tmp]
INFO:genMapFromLists: Total number of data in input file: 29188
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 135000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (136, 136)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr10_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr10_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr10_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr11_wwpdr1zq.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr11_wwpdr1zq.tmp]
INFO:genMapFromLists: Total number of data in input file: 28920
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 134000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (135, 135)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr11_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr11_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr11_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr12_vtt8g0s9.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr12_vtt8g0s9.tmp]
INFO:genMapFromLists: Total number of data in input file: 27766
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 133000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (134, 134)


INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr12_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr12_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr12_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr13_v3q8__1n.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr13_v3q8__1n.tmp]
INFO:genMapFromLists: Total number of data in input file: 16584
INFO:genMapFromLists:Minimum base-pair: 19000000 and Maximum base-pair: 115000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (116, 116)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr13_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr13_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr13_1mb__combined.npbin] ...

INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr14_03luy2_j.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr14_03luy2_j.tmp]
INFO:genMapFromLists: Total number of data in input file: 13904
INFO:genMapFromLists:Minimum base-pair: 19000000 and Maximum base-pair: 107000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (108, 108)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr14_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr14_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr14_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr15_oqkuow8g.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr15_oqkuow8g.tmp]
INFO:genMapFromLists: Total number of data in input file: 12006
INFO:genMapFromLists:Minimum base-pair: 20000000 and Maximum base-pair: 102000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (103, 103)



INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr15_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr15_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr15_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr16_uo9j9gle.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr16_uo9j9gle.tmp]
INFO:genMapFromLists: Total number of data in input file: 10808
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 90000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (91, 91)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr16_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr16_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr16_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr17_lwa34i9w.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr17_lwa34i9w.tmp]
INFO:genMapFromLists: Total number of data in input file: 10918
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 81000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (82, 82)



INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr17_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr17_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr17_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr18_uk88aw7n.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr18_uk88aw7n.tmp]
INFO:genMapFromLists: Total number of data in input file: 10852
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 78000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (79, 79)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr18_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr18_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr18_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr19_g1xkdve7.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr19_g1xkdve7.tmp]
INFO:genMapFromLists: Total number of data in input file: 5892
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 59000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (60, 60)



INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr19_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr19_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr19_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr20_17aojv7z.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr20_17aojv7z.tmp]
INFO:genMapFromLists: Total number of data in input file: 6974
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 62000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (63, 63)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr20_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr20_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr20_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr21_rrw6x8vw.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr21_rrw6x8vw.tmp]
INFO:genMapFromLists: Total number of data in input file: 2474
INFO:genMapFromLists:Minimum base-pair: 9000000 and Maximum base-pair: 48000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (49, 49)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr21_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr21_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr21_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr22_ufsr5nr7.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr22_ufsr5nr7.tmp]
INFO:genMapFromLists: Total number of data in input file: 2436
INFO:genMapFromLists:Minimum base-pair: 16000000 and Maximum base-pair: 51000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (52, 52)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chr22_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr22_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chr22_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!




INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrMT_wyc60lnm.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrMT_wyc60lnm.tmp]
INFO:genMapFromLists: Total number of data in input file: 2
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 0 are present in input data
INFO:genMapFromLists:Shape of overall map: (1, 1)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chrMT_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrMT_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrMT_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrX_eyxkravm.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrX_eyxkravm.tmp]
INFO:genMapFromLists: Total number of data in input file: 37926
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 155000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (156, 156)



INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chrX_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrX_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrX_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrY_a249pvip.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrY_a249pvip.tmp]
INFO:genMapFromLists: Total number of data in input file: 29
INFO:genMapFromLists:Minimum base-pair: 3000000 and Maximum base-pair: 59000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (60, 60)

INFO:save_ccmap: Saving ccmap to file [cmaps/homer/chrY_1mb__combined.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrY_1mb__combined.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/homer/chrY_1mb__combined.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:HomerInputHandler: Saved ['cmaps/homer/chr1_1mb__combined.ccmap', 'cmaps/homer/chr2_1mb__combined.ccmap', 'cmaps/homer/chr3_1mb__combined.ccmap', 'cmaps/homer/chr4_1mb__combined.ccmap', 'cmaps/homer/chr5_1mb__combined.ccmap', 'cmaps/homer/chr6_1mb__combined.ccmap', 'cmaps/homer/chr7_1mb__combined.ccmap', 'cmaps/homer/chr8_1mb__combined.ccmap', 'cmaps/homer/chr9_1mb__combined.ccmap', 'cmaps/homer/chr10_1mb__combined.ccmap', 'cmaps/homer/chr11_1mb__combined.ccmap', 'cmaps/homer/chr12_1mb__combined.ccmap', 'cmaps/homer/chr13_1mb__combined.ccmap', 'cmaps/homer/chr14_1mb__combined.ccmap', 'cmaps/homer/chr15_1mb__combined.ccmap', 'cmaps/homer/chr16_1mb__combined.ccmap', 'cmaps/homer/chr17_1mb__combined.ccmap', 'cmaps/homer/chr18_1mb__combined.ccmap', 'cmaps/homer/chr19_1mb__combined.ccmap', 'cmaps/homer/chr20_1mb__combined.ccmap', 'cmaps/homer/chr21_1mb__combined.ccmap', 'cmaps/homer/chr22_1mb__combined.ccmap', 'cmaps/homer/chrMT_1mb__combined.ccmap', 'cmaps/homer/chrX_1mb__combined.ccmap', 'cmaps/homer/chrY_1mb__combined.ccmap'] files.

Convert to gcmap

An example input file human_INL_sample1_matrix_1Mb_raw.txt is present in data/HomerFormat directory. Below, we read it and convert it to .gcmap format. The input file contains several chromosomes, and all contact maps will be added to gcmap file.

Ouput human_INL_sample1_matrix_1Mb_raw.gcmap files will be saved in cmaps/homer directory.

In [11]:
# Initialize
homer_reader = gmlib.importer.HomerInputHandler('data/HomerFormat/human_INL_sample1_matrix_1Mb_raw.txt')

# Convert and save
homer_reader.save_gcmap('cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap',
                                                    coarsingMethod='sum', compression='lzf')

# Delete all temporary files, neccessary, automatically deleted
del homer_reader
INFO:HomerInputHandler: Getting chromosome list and resolution from Input Files ...
INFO:HomerInputHandler: Resolution: 1mb
INFO:HomerInputHandler: Following chromsomes found in input files:
                              chr1
                              chr2
                              chr3
                              chr4
                              chr5
                              chr6
                              chr7
                              chr8
                              chr9
                              chr10
                              chr11
                              chr12
                              chr13
                              chr14
                              chr15
                              chr16
                              chr17
                              chr18
                              chr19
                              chr20
                              chr21
                              chr22
                              chrMT
                              chrX
                              chrY
INFO:HomerInputHandler: Reading [data/HomerFormat/human_INL_sample1_matrix_1Mb_raw.txt] file ...
INFO:HomerInputHandler:           ... Finished reading [data/HomerFormat/human_INL_sample1_matrix_1Mb_raw.txt] file ...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr1_ozde0va4.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr1_ozde0va4.tmp]
INFO:genMapFromLists: Total number of data in input file: 40344
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 249000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (250, 250)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr1] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr1] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr1] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr1] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr2_cpdiirk7.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr2_cpdiirk7.tmp]
INFO:genMapFromLists: Total number of data in input file: 46886
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 243000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (244, 244)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr2] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr2] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr2] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr2] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr3_6rz30dtu.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr3_6rz30dtu.tmp]
INFO:genMapFromLists: Total number of data in input file: 33308
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 197000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (198, 198)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr3] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr3] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr3] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr3] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr4_eat16ys2.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr4_eat16ys2.tmp]
INFO:genMapFromLists: Total number of data in input file: 29054
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 191000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (192, 192)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr4] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr4] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr4] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr4] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr5_tg7a2qrx.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr5_tg7a2qrx.tmp]
INFO:genMapFromLists: Total number of data in input file: 26286
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 180000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (181, 181)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr5] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr5] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr5] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr5] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr6_82bba4ff.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr6_82bba4ff.tmp]
INFO:genMapFromLists: Total number of data in input file: 25032
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 171000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (172, 172)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr6] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr6] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr6] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr6] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr7_zykfac9h.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr7_zykfac9h.tmp]
INFO:genMapFromLists: Total number of data in input file: 20748
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 159000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (160, 160)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr7] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr7] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr7] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr7] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr8_gap1ob5e.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr8_gap1ob5e.tmp]
INFO:genMapFromLists: Total number of data in input file: 18371
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 146000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (147, 147)


INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr8] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr8] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr8] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr8] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr9_uehz864s.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr9_uehz864s.tmp]
INFO:genMapFromLists: Total number of data in input file: 11414
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 141000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (142, 142)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr9] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr9] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr9] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr9] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr10_he_lg6i2.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr10_he_lg6i2.tmp]
INFO:genMapFromLists: Total number of data in input file: 15560
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 135000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (136, 136)



INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr10] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr10] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr10] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr10] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr11_sgvef97s.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr11_sgvef97s.tmp]
INFO:genMapFromLists: Total number of data in input file: 15429
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 134000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (135, 135)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr11] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr11] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr11] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr11] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...

INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr12_t4cag_zp.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr12_t4cag_zp.tmp]
INFO:genMapFromLists: Total number of data in input file: 14928
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 133000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (134, 134)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr12] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr12] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr12] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr12] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr13_yw69ibjp.tmp]...


INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr13_yw69ibjp.tmp]
INFO:genMapFromLists: Total number of data in input file: 8675
INFO:genMapFromLists:Minimum base-pair: 19000000 and Maximum base-pair: 115000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (116, 116)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr13] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr13] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr13] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr13] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr14_0isd7_l1.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr14_0isd7_l1.tmp]
INFO:genMapFromLists: Total number of data in input file: 7245
INFO:genMapFromLists:Minimum base-pair: 19000000 and Maximum base-pair: 107000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (108, 108)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr14] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr14] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr14] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr14] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr15_2shc6o7t.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr15_2shc6o7t.tmp]
INFO:genMapFromLists: Total number of data in input file: 6249
INFO:genMapFromLists:Minimum base-pair: 20000000 and Maximum base-pair: 102000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (103, 103)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr15] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr15] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr15] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr15] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...


INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr16_vg29q2l6.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr16_vg29q2l6.tmp]
INFO:genMapFromLists: Total number of data in input file: 5629
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 90000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (91, 91)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr16] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr16] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr16] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr16] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr17_hioju8k0.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr17_hioju8k0.tmp]
INFO:genMapFromLists: Total number of data in input file: 5650
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 81000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (82, 82)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr17] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr17] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr17] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr17] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr18_6i32yh98.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr18_6i32yh98.tmp]
INFO:genMapFromLists: Total number of data in input file: 5581
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 78000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (79, 79)




INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr18] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr18] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr18] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr18] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr19_6vxo52rp.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr19_6vxo52rp.tmp]
INFO:genMapFromLists: Total number of data in input file: 3012
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 59000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (60, 60)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr19] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr19] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr19] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr19] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr20_75fs4w_z.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr20_75fs4w_z.tmp]
INFO:genMapFromLists: Total number of data in input file: 3563
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 62000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (63, 63)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr20] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr20] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr20] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr20] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr21_k7h2y6a8.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr21_k7h2y6a8.tmp]
INFO:genMapFromLists: Total number of data in input file: 1266
INFO:genMapFromLists:Minimum base-pair: 9000000 and Maximum base-pair: 48000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (49, 49)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr21] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr21] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr21] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr21] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chr22_lkz9p2ak.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chr22_lkz9p2ak.tmp]
INFO:genMapFromLists: Total number of data in input file: 1222
INFO:genMapFromLists:Minimum base-pair: 16000000 and Maximum base-pair: 51000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (52, 52)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chr22] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr22] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr22] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr22] ...




INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrMT_wrr9inav.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrMT_wrr9inav.tmp]
INFO:genMapFromLists: Total number of data in input file: 1
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 0 are present in input data
INFO:genMapFromLists:Shape of overall map: (1, 1)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chrMT] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chrMT] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chrMT] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chrMT] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrX_z02f32p7.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrX_z02f32p7.tmp]
INFO:genMapFromLists: Total number of data in input file: 20634
INFO:genMapFromLists:Minimum base-pair: 0 and Maximum base-pair: 155000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (156, 156)



INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chrX] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chrX] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chrX] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chrX] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...
INFO:CooMatrixHandler: Reading file: [/home/rajendra/deskForWork/scratch/chrY_kkzm18rx.tmp]...
INFO:CooMatrixHandler:     ... Finished reading file: [/home/rajendra/deskForWork/scratch/chrY_kkzm18rx.tmp]
INFO:genMapFromLists: Total number of data in input file: 18
INFO:genMapFromLists:Minimum base-pair: 3000000 and Maximum base-pair: 59000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (60, 60)

INFO:addCCMap2GCMap: Opened file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap] for [chrY] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chrY] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chrY] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chrY] ...
INFO:addCCMap2GCMap: Closed file [cmaps/homer/human_INL_sample1_matrix_1Mb_raw.gcmap]...

3. From Bin-Contact format

These types of files are present in following GEO data: * http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE61471 * http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE34453

This format contains a pair of file: * bin file:

cbin    chr from.coord  to.coord    count
1   2L  0   160000  747
2   2L  160000  320000  893
3   2L  320000  480000  1056
4   2L  480000  640000  1060
5   2L  640000  800000  978
6   2L  800000  960000  926
.
.
.
  • Contact file in list format

    cbin1   cbin2   expected_count  observed_count
    1   1   40.245201   21339
    1   2   83.747499   5661
    1   3   92.12501    1546
    1   4   93.401273   864
    1   5   87.265472   442
    .
    .
    .
    

Convert to ccmap

A pair of example input files nm_none_160000.bins and nm_none_160000.n_contact is present in data/binContactFormat directory. Below, we read it and convert it to .ccmap formats. The input file contains several chromosomes, therefore, several .ccmap files will be generated for each respective chromosome.

Ouput .ccmap files will be saved in cmaps/binContact directory.

In [12]:
# File names
binFile = 'data/binContactFormat/nm_none_160000.bins'
contactFile = 'data/binContactFormat/nm_none_160000.n_contact'

# Initialize
binContactReader = gmlib.importer.BinsNContactFilesHandler(binFile, contactFile)

# Save ccmaps
binContactReader.save_ccmaps('cmaps/binContact')
INFO:BinsNContactFilesHandler:  Chromosome Size:
                                                 4 : 1280000
                                                3L : 24640000
                                                2L : 23040000
                                                2R : 21280000
                                                 X : 22560000
                                                3R : 28000000

INFO:BinsNContactFilesHandler:  Chromosome Bins info:
                                                      4: {'min': 607, 'max': 614}
                                                     3L: {'min': 278, 'max': 431}
                                                     2L: {'min': 1, 'max': 144}
                                                     2R: {'min': 145, 'max': 277}
                                                      X: {'min': 615, 'max': 755}
                                                     3R: {'min': 432, 'max': 606}

INFO:BinsNContactFilesHandler: Generating temporary numpy array file [/home/rajendra/deskForWork/scratch/4_nep1xx58.npy] for 4 ...
INFO:BinsNContactFilesHandler: Finished.

INFO:BinsNContactFilesHandler: Generating temporary numpy array file [/home/rajendra/deskForWork/scratch/3L_381y543n.npy] for 3L ...
INFO:BinsNContactFilesHandler: Finished.

INFO:BinsNContactFilesHandler: Generating temporary numpy array file [/home/rajendra/deskForWork/scratch/2L_i102o8wq.npy] for 2L ...
INFO:BinsNContactFilesHandler: Finished.

INFO:BinsNContactFilesHandler: Generating temporary numpy array file [/home/rajendra/deskForWork/scratch/2R_52es74oc.npy] for 2R ...
INFO:BinsNContactFilesHandler: Finished.

INFO:BinsNContactFilesHandler: Generating temporary numpy array file [/home/rajendra/deskForWork/scratch/X_qr4pk394.npy] for X ...
INFO:BinsNContactFilesHandler: Finished.

INFO:BinsNContactFilesHandler: Generating temporary numpy array file [/home/rajendra/deskForWork/scratch/3R__984r6x9.npy] for 3R ...
INFO:BinsNContactFilesHandler: Finished.

INFO:BinsNContactFilesHandler: Reading contact file ...

INFO:BinsNContactFilesHandler:  Generating Hi-C Map for [2L] ...

INFO:genMapFromLists: Total number of data in input file: 20737
INFO:genMapFromLists:Minimum base-pair: 160000 and Maximum base-pair: 23040000 are present in input data
INFO:genMapFromLists:Shape of overall map: (145, 145)

INFO:BinsNContactFilesHandler: Finished

INFO:BinsNContactFilesHandler:  Generating Hi-C Map for [2R] ...

INFO:genMapFromLists: Total number of data in input file: 17689
INFO:genMapFromLists:Minimum base-pair: 160000 and Maximum base-pair: 21280000 are present in input data
INFO:genMapFromLists:Shape of overall map: (134, 134)

INFO:BinsNContactFilesHandler: Finished

INFO:BinsNContactFilesHandler:  Generating Hi-C Map for [3L] ...

INFO:genMapFromLists: Total number of data in input file: 23716
INFO:genMapFromLists:Minimum base-pair: 160000 and Maximum base-pair: 24640000 are present in input data
INFO:genMapFromLists:Shape of overall map: (155, 155)

INFO:BinsNContactFilesHandler: Finished

INFO:BinsNContactFilesHandler:  Generating Hi-C Map for [3R] ...

INFO:genMapFromLists: Total number of data in input file: 30625
INFO:genMapFromLists:Minimum base-pair: 160000 and Maximum base-pair: 28000000 are present in input data
INFO:genMapFromLists:Shape of overall map: (176, 176)

INFO:BinsNContactFilesHandler: Finished

INFO:BinsNContactFilesHandler:  Generating Hi-C Map for [4] ...

INFO:genMapFromLists: Total number of data in input file: 64
INFO:genMapFromLists:Minimum base-pair: 160000 and Maximum base-pair: 1280000 are present in input data
INFO:genMapFromLists:Shape of overall map: (9, 9)

INFO:BinsNContactFilesHandler: Finished

INFO:BinsNContactFilesHandler:  Generating Hi-C Map for [X] ...
INFO:genMapFromLists: Total number of data in input file: 19880
INFO:genMapFromLists:Minimum base-pair: 160000 and Maximum base-pair: 22560000 are present in input data
INFO:genMapFromLists:Shape of overall map: (142, 142)

INFO:BinsNContactFilesHandler: Finished

INFO:BinsNContactFilesHandler: Finished reading contact file.

INFO:BinsNContactFilesHandler:   Hi-C Maps Summary:
                                                  Chromosome    Size            Max.    Min.
                                                           4    (9, 9)  18961.0 1182.0
                                                          3L    (155, 155)      25431.0 3.0
                                                          2L    (145, 145)      24438.0 6.0
                                                          2R    (134, 134)      20234.0 1.0
                                                           X    (142, 142)      11447.0 1.0
                                                          3R    (176, 176)      22142.0 11.0

INFO:save_ccmap: Saving ccmap to file [cmaps/binContact/chr4_160kb.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr4_160kb.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr4_160kb.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:save_ccmap: Saving ccmap to file [cmaps/binContact/chr3L_160kb.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr3L_160kb.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr3L_160kb.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:save_ccmap: Saving ccmap to file [cmaps/binContact/chr2L_160kb.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr2L_160kb.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr2L_160kb.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:save_ccmap: Saving ccmap to file [cmaps/binContact/chr2R_160kb.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr2R_160kb.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr2R_160kb.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:save_ccmap: Saving ccmap to file [cmaps/binContact/chrX_160kb.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chrX_160kb.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chrX_160kb.npbin] ...
INFO:save_ccmap:       Finished!!!

INFO:save_ccmap: Saving ccmap to file [cmaps/binContact/chr3R_160kb.ccmap] and [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr3R_160kb.npbin] ...
INFO:save_ccmap: Compressing [/home/rajendra/workspace/genome_3d_organization/tutorials_modules/cmaps/binContact/chr3R_160kb.npbin] ...
INFO:save_ccmap:       Finished!!!

Convert to gcmap

A pair of example input files nm_none_160000.bins and nm_none_160000.n_contact is present in data/binContactFormat directory. Below, we read it and convert it to .gcmap formats. The input file contains several chromosomes, all contact map will be added to the output gcmap.

Ouput raw_160kb.gcmap files will be saved in cmaps/binContact directory.

In [13]:
# Save gcmap
binContactReader.save_gcmap('cmaps/binContact/raw_160kb.gcmap', coarsingMethod='sum', compression='lzf')
INFO:addCCMap2GCMap: Opened file [cmaps/binContact/raw_160kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/binContact/raw_160kb.gcmap] for [chr4] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr4] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr4] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr4] ...
INFO:addCCMap2GCMap: Closed file [cmaps/binContact/raw_160kb.gcmap]...
INFO:addCCMap2GCMap: Opened file [cmaps/binContact/raw_160kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/binContact/raw_160kb.gcmap] for [chr3L] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr3L] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr3L] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr3L] ...
INFO:addCCMap2GCMap: Closed file [cmaps/binContact/raw_160kb.gcmap]...
INFO:addCCMap2GCMap: Opened file [cmaps/binContact/raw_160kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/binContact/raw_160kb.gcmap] for [chr2L] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr2L] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr2L] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr2L] ...
INFO:addCCMap2GCMap: Closed file [cmaps/binContact/raw_160kb.gcmap]...
INFO:addCCMap2GCMap: Opened file [cmaps/binContact/raw_160kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/binContact/raw_160kb.gcmap] for [chr2R] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr2R] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr2R] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr2R] ...
INFO:addCCMap2GCMap: Closed file [cmaps/binContact/raw_160kb.gcmap]...
INFO:addCCMap2GCMap: Opened file [cmaps/binContact/raw_160kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/binContact/raw_160kb.gcmap] for [chrX] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chrX] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chrX] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chrX] ...
INFO:addCCMap2GCMap: Closed file [cmaps/binContact/raw_160kb.gcmap]...
INFO:addCCMap2GCMap: Opened file [cmaps/binContact/raw_160kb.gcmap] for reading writing..
INFO:addCCMap2GCMap: Adding data to [cmaps/binContact/raw_160kb.gcmap] for [chr3R] ...
INFO:addCCMap2GCMap:     ...Finished adding data for [chr3R] ...
INFO:addCCMap2GCMap: Generating downsampled maps for [chr3R] ...
INFO:addCCMap2GCMap:     ... Finished downsampling for [chr3R] ...
INFO:addCCMap2GCMap: Closed file [cmaps/binContact/raw_160kb.gcmap]...