pycallingcards.plotting.calculate_signal#
- pycallingcards.plotting.calculate_signal(peak_data, chipseq_signal, before=10000, after=10000, signaltype='mean', nbins=100)[source]#
Calculate the matrix of Chip-seq signal in each peak. This function uses pyBigWig, please install it before using.
- Parameters:
peak_data (
DataFrame
) – Peak_data file from cc.pp.callpeaks.chipseq_signal (
str
) – Chipseq signal file should be bigWig/bigBed file.before (
int
(default:10000
)) – The length(bp) calculated before the middle point of the peak.after (
int
(default:10000
)) – The length(bp) calculated after the middle point of the peak.signaltype (
Optional
[Literal
['mean'
,'median'
,'min'
,'max'
,'sum'
,'std'
]] (default:'mean'
)) – [‘mean’, ‘median’, ‘min’, ‘max’, ‘sum’ ,’std’]. Define the type of statistic to be used over the bin size range.nbins (
int
(default:100
)) – The number of bins calculated.
- Example:
>>> import pycallingcards as cc >>> exp_ccf = cc.datasets.SP1_K562HCT116_data(data = 'HCT116_SP1_ccf') >>> bg_ccf = cc.datasets.SP1_K562HCT116_data(data = 'HCT116_brd4_ccf') >>> peak_data = cc.pp.callpeaks(exp_ccf, bg_ccf, method = 'ccf_tools', reference = 'hg38', pvalue_cutoffbg = 0.0001, window_size = 2000, step_size = 500, pvalue_cutoffTTAA = 0.0000001, lam_win_size = None) >>> # If "https://www.encodeproject.org/files/ENCFF587ZMX/@@download/ENCFF587ZMX.bigWig" could not work, please download it and read the local path. >>> mtx = cc.pl.calculate_signal(peak_data,"https://www.encodeproject.org/files/ENCFF587ZMX/@@download/ENCFF587ZMX.bigWig")