plotSingleCellCopyNumberCalls {CopyNumberPlots} | R Documentation

## plotSingleCellCopyNumberCalls

### Description

Plot the segments representing the copy number calls from a single-cell CNV data file. The file must be an HDF5 file with the same format as the ones produced by 10X CellRanger software.

### Usage

    plotSingleCellCopyNumberCalls(karyoplot, cnv.file, reorder=TRUE, cn.colors=NULL, track.margin=0, r0=0, r1=1, ...)

### Arguments

`karyoplot` | A karyoplote object
`cnv.file` | (an HDF5 file) The path to an HDF5 file containing the single-cell CNV data.
`reorder` | (logical) If TRUE, the cells will be plotted inthe order specified by the hirearchical clustering tree embedded in the HDF5 file. If FALSE the cells will be plotted in the order they are stored in the file. (defaukts to TRUE)
`cn.colors` | (colors) The colors assigned to gains and losses. `getCopyNumberColors` is used to determine them. If NULL, the default color scheme is used. (defaults to NULL)
`track.margin` | (numeric) This is the margin between the cells CN, in portion of the total per cell space. (deafults to 0)
`r0` | (numeric) (karyoploteR parameter) r0 and r1 define the vertical range of the data panel to be used to draw this plot. They can be used to split the data panel in different vertical ranges (similar to tracks in a genome browser) to plot differents data. If NULL, they are set to the min and max of the data panel, it is, to use all the available space. (defaults to NULL)(defaults to 0)
`r1` | (numeric) (karyoploteR parameter) r0 and r1 define the vertical range of the data panel to be used to draw this plot. They can be used to split the data panel in different vertical ranges (similar to tracks in a genome browser) to plot differents data. If NULL, they are set to the min and max of the data panel, it is, to use all the available space. (defaults to NULL)(defaults to 1)
`...` | The ellipsis operator can be used to specify any additional graphical parameters. Any additional parameter will be passed to the internal calls to karyoploteR functions.

### Details

This function will open the HDF5 file, extract the CNV values for each cell and plot them as a different colored segments using `plotCopyNumberCalls`. By default cells will be reordered and plotted according the hierarchical clustering tree embedded in the file. If reorder is FALSE or the tree is not present, cell will be plotted in the order they are stored in the file.

### Value

Invisibly returns the karyoplot object representing the plot. With it it is possible to add other elements to the plot using standrad karyoploteR functions. The returned pbject will have an additional "latest.plot" element with a list containing: the number of cells, the hierarchical clustering tree, the bin size used to partition the genome, the windows representing such partitioning, the number of bins per chromosome and a GRAnges with the regions where no cell had any data, the no-call regions.

### Note

If the file is open by any other application the function will fail.

### Examples

    kp <- plotKaryotype(plot.type=4, genome="hg38")
    #NOT RUN - Using 10X example data from https://www.10xgenomics.com/resources/datasets/
    #plotSingleCellCopyNumberCalls(kp, "breast_tissue_D_2k_cnv_data.h5")

[Package CopyNumberPlots version 1.4.0 Index]