pycallingcards.plotting.draw_area_mu#

pycallingcards.plotting.draw_area_mu(chromosome, start, end, extend, peaks, insertions, reference, background=None, mdata=None, adata_CC='CC', name=None, key=None, insertionkey=None, figsize=(10, 3), plotsize=[1, 1, 2], bins=None, color='red', color_cc=None, color_peak=None, color_genes=None, color_background='lightgray', title=None, example_length=10000, peak_line=1, font_size=1, name_insertion1='Experiment Insertions', name_insertion2='Backgound Insertions', name_density1='Experiment Density', name_density2='Backgound Density', save=False)[source]#

Plot the specific area of the genome (Designed for mudata object). Plot the specific area of the genome. This plot contains three sections. The top section is a plot of insertions plot: one dot is one insertion and the height is log(reads + 1). The middle section is the distribution plot of insertions. If backgound is the input, the colored one would be the experiment inerstions/distribution and the grey one would be the backgound one. If backgound is not the input and mdata/name/key is provided, the colored one would be the inerstions/distribution for specific group and the grey one would be the whole data. The third section composes of reference genes and peaks.

Parameters:
  • chromosome (str) – The chromosome plotted.

  • start (int) – The start point of middle area. Usually, it’s the start point of a peak.

  • end (int) – The end point of middle area. Usually, it’s the end point of a peak.

  • extend (int) – The extend length (bp) to plot.

  • peaks (DataFrame) – pd.Dataframe of peaks

  • insertions (DataFrame) – pd.Datadrame of qbed

  • reference (Union[str, DataFrame]) – ‘hg38’, ‘mm10’, ‘sacCer3’ or pd.DataFrame of the reference data.

  • background (Optional[DataFrame] (default: None)) – Default is None. pd.DataFrame of qbed or None.

  • mdata (Optional[MuData] (default: None)) – Default is None. Input along with name and key. It will only show the insertions when the key of mdata is name.

  • name (Optional[str] (default: None)) – Default is None. Input along with mdata and key. It will only show the insertions when the key of mdata is name.

  • key (Optional[str] (default: None)) – Default is None. Input along with mdata and name. It will only show the insertions when the key of mdata is name.

  • insertionkey (Optional[str] (default: None)) – Default is None`(‘Barcodes’). Input along with `mdata and name. It will find the column insertionkey of the insertions file.

  • figsize (Tuple[int, int] (default: (10, 3))) – Default is (10, 3). The size of the figure.

  • plotsize (list (default: [1, 1, 2])) – Default is [1,1,2]. The relative size of the dot plot, distribution plot and the peak plot.

  • bins (Optional[int] (default: None)) – Default is None. The bins of histogram. I would automatically calculate if None.

  • color (Optional[Literal['blue', 'red', 'green', 'pruple']] (default: 'red')) – [‘blue’,’red’,’green’,’pruple’]. Default is red. The color of the plot. If color is not a valid color, color_cc, color_peak, and color_genes should be utilized.

  • color_cc (Optional[str] (default: None)) – Default is None. The color of qbed insertions. Used only when color is not a valid color.

  • color_peak (Optional[str] (default: None)) – Default is None. The color of peaks. Used only when color is not a valid color.

  • color_genes (Optional[str] (default: None)) – Default is None. The color of genes. Used only when color is not a valid color.

  • color_background (str (default: 'lightgray')) – The color of background.

  • title (Optional[str] (default: None)) – Default is None. The title of the plot.

  • example_length (int (default: 10000)) – Default is 10000. The length of example.

  • peak_line (int (default: 1)) – Default is 1. The total number of peak lines.

  • font_size (int (default: 1)) – Default is 10. The relative font of the words on the plot.

  • name_insertion1 (str (default: 'Experiment Insertions')) – The name for the top insertion part.

  • name_insertion2 (str (default: 'Backgound Insertions')) – The name for the bottom insertion part.

  • name_density1 (str (default: 'Experiment Density')) – The name for the top density part.

  • name_density2 (str (default: 'Backgound Density')) – The name for the bottom density part.

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

Example:

>>> import pycallingcards as cc
>>> mdata = cc.datasets.mousecortex_data(data="Mudata")
>>> cc.pl.draw_area_mu("chr3",34638588,34656047,400000,peak_data,qbed_data,"mm10",mdata = mdata,
        name = 'Astrocyte',key ='RNA:cluster',figsize = (30,7),peak_line = 4,color = "blue", title = "chr3_34638588_34656047")