oncoprinter.OncoPrint#

class OncoPrint(genomic_data=None, patients_order=None, tracks_order=None, pieces=None, background_color='#BEBEBE', shrink=(0.8, 0.8), width=None, height=None, aspect=2.5, legend_kws=None, name=None, add_tracks_names='left', add_samples_names='bottom', add_mut_perc='right', add_tracks_counts='right', add_mut_counts='top', add_tracks_counts_size=0.2, add_tracks_counts_pad=0, add_mut_counts_size=0.2, add_mut_counts_pad=0.1)#

Bases: ClusterBoard

OncoPrint plot

The oncoprint plot is a visualization for genomics data in cancer research. It’s first introduced by the cBioPortal project. See https://www.cbioportal.org/oncoprinter for more details.

To use this class, import from oncoprinter

>>> from oncoprinter import OncoPrint
Parameters:
genomic_datapd.DataFrame
Genomics data, each column is:
  1. Sample ID

  2. Track name

  3. Alteration

patients_orderlist, optional

The order of samples, by default None

tracks_orderlist, optional

The order of tracks, by default None

piecesdict, optional

Custom pieces for each alteration, by default None See Piece for details

background_colorstr, optional, default: “#BEBEBE”

The background color

shrinktuple, optional, default: (0.8, 0.8)

The shrink ratio for each layer

width, heightfloat, optional

The size in inches to define the size of main canvas

aspectfloat, optional, default: 2.5

The aspect ratio of the main canvas

legend_kwsdict, optional

The options for legend, by default None See cat_legend for details

namestr, optional

The name of this OncoPrint

add_tracks_namesstr, optional, default: “left”

The position to add tracks names If None, will not add tracks names

add_samples_namesstr, optional, default: “bottom”

The position to add samples names If None, will not add samples names

add_mut_percstr, optional, default: “right”

The position to add mutation percentage If None, will not add mutation percentage

add_tracks_countsstr, optional, default: “right”

The position to add tracks mutation counts If None, will not add tracks mutation counts

add_mut_countsstr, optional, default: “top”

The position to add mutation counts If None, will not add mutation counts

add_tracks_counts_sizefloat, optional, default: 0.2

The size of tracks mutation counts

add_tracks_counts_padfloat, optional, default: 0

The padding of tracks mutation counts

add_mut_counts_sizefloat, optional, default: 0.2

The size of mutation counts

add_mut_counts_padfloat, optional, default: 0.1

The padding of mutation counts

add_clinical_data(data, plot='bar', size=None, pad=0.1, **kwargs)#
add_heatmap_data(data, size=0.2, pad=0.1, **kwargs)#
clinical_plots = {'bar': <class 'marsilea.plotter.bar.Numbers'>, 'stack_bar': <class 'marsilea.plotter.bar.StackBar'>}#
property samples_order#
property tracks_order#