pycallingcards.plotting.signal_plot#

pycallingcards.plotting.signal_plot(signalmtx, fill_between=True, alpha=0.05, before=10000, after=10000, nbins=100, figsize=(8, 6), fontsize=10, color='red', textbelow=0, title='Log2(FC) Chip-seq Signal', save=False)[source]#

Plot the Chip-seq signal of peaks.

Parameters:
  • signalmtx (array) – The signal calculated from cc.pl.calculate_signal

  • fill_between (bool (default: True)) – Whether to fill with the range of signal values or not.

  • alpha (float (default: 0.05)) – The percentage of signals coverage in fill_between.

  • 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.

  • nbins (int (default: 100)) – The number of bins calculated.

  • figsize (Tuple[int, int] (default: (8, 6))) – The size of the figure.

  • font_size – The font of the words on the plot.

  • color (str (default: 'red')) – The color of the plot, the same as color in plt.plot.

  • textbelow (float (default: 0)) – The distance of the bottom text and the plot.

  • title (str (default: 'Log2(FC) Chip-seq Signal')) – The title of the plot.

  • save (bool (default: False)) – Could be bool or str indicating the file name it would be saved. If True, a default name will be given and the plot would be saved as a png file.

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")
>>> cc.pl.signal_plot(mtx, alpha = 0.05)