open2c / coolpuppy

A versatile tool to perform pile-up analysis on Hi-C data in .cool format.
MIT License
77 stars 11 forks source link

APA score #128

Closed BenxiaHu closed 1 year ago

BenxiaHu commented 1 year ago

hello, thanks for developing the coolpuppy tool. it is very helpful. I have one question: what does APA score mean? would you like to explain it? Best,

image
Phlya commented 1 year ago

Hello, by default it's the mean of the central 3x3 square of the pileup, which would typically be observed/expected enrichment, and indicative of average dot strength. Hope this helps.

BenxiaHu commented 1 year ago

thanks. when I ran coolpup.py

coolpup.py 10000.mcool::/resolutions/10000 loop_coolpuppy.txt --features_format bedpe --expected 10000_expected.tsv -o 10kb_cooluppy

do you think observed/expected enrichment is log(observed/expected) value or not?

Phlya commented 1 year ago

The plots is probably displayed in log scale, but the values are not.

BenxiaHu commented 1 year ago

thanks. how to show log(observed/expected)? add this paramter --scale log

BenxiaHu commented 1 year ago

image

the scale in the right of the heatmap is too large (0.083-12). looks weird.

Phlya commented 1 year ago

The colour is log scaled, that's why it looks like this. In the CLI you can't do it, sorry, only using python API.

BenxiaHu commented 1 year ago

okay. I am trying to use API

ImportError: cannot import name 'plotpup' from 'coolpuppy' (/python38/lib/python3.8/site-packages/coolpuppy/init.py)

I can import coolpuppy, but not from coolpuppy import plotpup. do you know what causes such issue?

Phlya commented 1 year ago

Maybe you are using old coolpuppy?

Phlya commented 1 year ago

Could you please post the full error?

BenxiaHu commented 1 year ago

I just upgraded the coolpuppy to 1.0.0

here is the new error. plotpup.py --input_pups _significant_Short_10kb_cooluppy significant_Median_10kb_cooluppy \

                    significant_Long_10kb_cooluppy --rownames Short Median Long --colnames test \
       --output significant_diff_10kb_cooluppy_mustache.pdf --scale log

ValueError: Multiple pileups for one of the conditions, ensure unique correspondence for each col/row combination

Phlya commented 1 year ago

Yes, you need to specify what goes along rows vs columns. For example, I think you need --rows features.

BenxiaHu commented 1 year ago

thanks. that works. I have another question, given that I split the chromatin loops into 3 classes based on the loop length, do you think that I need to --rescale to rescale pileups to the same shape and size. based on my knowledge, the long-range loops should show lower contact frequencey compared to short-range loops. but my results look weird. I am not sure whether the coolpup.py causes this phenomenon

BenxiaHu commented 1 year ago

is there any paramter to do fold enrichment of the center piexl over the nearby bins?

Phlya commented 1 year ago

Try --norm_corners 3, for example.

BenxiaHu commented 1 year ago

it works. but the value is > 2. do you think the result makes sense?

Phlya commented 1 year ago

Well, without seeing the result, sounds good, makes sense. You have >2-fold enrichment of O/E interactions relative to background.

Phlya commented 1 year ago

Makes sense to me!

BenxiaHu commented 1 year ago

but usually the fold enrichment is greater than 1 but less than 2.

Phlya commented 1 year ago

It really depends on your data, resolution, regions you chose... For specific situations I had enrichment >10.