Skip to content

3. Example

Ivan Kozin edited this page May 12, 2024 · 6 revisions

Download data

For example usage of CTADo we donwloaded data:

  1. 4DNFIL6BHWZL
  2. 4DNFIHXCPUAP

As long as the files are too big to be uploaded to GitHub, you will need to download them separately. To follow the example code, save the data in folder data/.

Note:

  • CTADo supports input Hi-C data in .cool and .mcool format.
  • You have to chose resolution, window, flank and get binsize yourself. For this example we provided them: resolution = 100000, window = 400000, binsize = 100000, flank = 200000

Normalization & Downsampling the data

cooler info data/4DNFIL6BHWZL.mcool::resolutions/100000
cooler info data/4DNFIHXCPUAP.mcool::resolutions/100000

Based on information in "sum" column, select the lowest one - 103022826.

Then perform downsampling:

cooltools random-sample data/4DNFIL6BHWZL_rs.mcool::resolutions/100000 data/4DNFIL6BHWZL_rs.mcool -c 103022826
cooltools random-sample data/4DNFIHXCPUAP_rs.mcool::resolutions/100000 data/4DNFIHXCPUAP_rs.mcool -c 103022826

And balancing the data:

cooler balance data/4DNFIL6BHWZL_rs.mcool::resolutions/100000
cooler balance data/4DNFIHXCPUAP_rs.mcool::resolutions/100000

Create cooler insulation table:

Cooler insulation table is a table with TADs boundaries.

python -c 'from src.calculate_intensity_change import get_boundaries; get_boundaries("data/4DNFIL6BHWZL_rs.mcool", 100000, 400000)'
python -c 'from src.calculate_intensity_change import get_boundaries; get_boundaries("data/4DNFIHXCPUAP_rs.mcool", 100000, 400000)'

Note:

Files would be saved to data/ with the name format <chr>_<window>_boundaries.csv

Perform CTADO

python CTADO.py data/4DNFIL6BHWZL_rs.mcool data/4DNFIHXCPUAP_rs.mcool 100000 400000 200000 100000 data/4DNFIL6BHWZL_rs.mcool_400000_boundaries.csv data/4DNFIHXCPUAP_rs.mcool_400000_boundaries.csv -od ctado_test -nc 10 

The final result contain:

  • intensity_change_result.csv
  • table merge
  • table split
  • folder graphics/ with graphics in it

Clone this wiki locally