OncoPlot Extractor

OncoPlot Extractor provides python3.x library to read standard oncoplots also known as mutation matrix. This library allows you to export the data extracted as pandas.DataFrame so the data can be forth modified with toolkit offered by pandas. Two main modules that this package contains are OncoPlotExtractor and OncoPlotCreator.

Modules

oncoplot_extractor.main module

oncoplot_extractor.plotter module

Base file containing OncoPlotCreator

class oncoplot_extractor.plotter.OncoplotCreator(df: pandas.core.frame.DataFrame, cell_size: int = 60, workbook: openpyxl.workbook.workbook.Workbook = <openpyxl.workbook.workbook.Workbook object>, offset: int = 10)

Bases: object

Creates an oncoplot from a dataframe containing respective rows and columns with hexcolor data

Parameters
  • df – pandas dataframe containing hexcolor data [pandas.DataFrame]

  • cell_size – size of each cell in pixels [int]

  • workbook – openpyxl workbook object [openpyxl.Workbook]

  • offset – number of rows to offset inserted data [int]

Example

opc = OncoplotCreator(df=my_df, cell_size=60, workbook=wb, offset=10)
opc.gen_base_oncoplot()
opc.save(filename="my_oncoplot.xlsx")
CELL_SIZE: int
DF: pandas.core.frame.DataFrame
OFFSET: int
OUT_PATH: str = None
WORKBOOK: openpyxl.workbook.workbook.Workbook
WORKSHEET: <property object at 0x7fc742afcae0>
gen_base_oncoplot()

Generates base oncoplot from self.DF expects self.DF to be loaded to self.WS

gen_stack_plot(row_position: Optional[int] = None, column_position: int = 2, filter_colors: list = []) None

generates stacked barplot on top of base oncoplot :param row_position: row where the base of stackplot lies [int] (default: None) :param column_position: first column position [int] (default: 2) :param filter_colors: list of colors to filter out [list]

save(filename: str) None

saves generated workbook to file :param filename: filename to save workbook to [str]

More Modules