Drug comparison#

  1. Import Comparison class from kinex

from kinex import Comparison
  1. Initialize a Comparison object

comp = Comparison()

Compare multiple experiments with each other#

  1. Specify the path to your enrichment tables

data_path = "path/to/your/tables"

Note

The directory should have multiple .csv files that contain enrichment analysis result tables from kinex

├── tables
    ├── table0.csv
    ├── table1.csv
    ├── table2.csv
    └── table3.csv
  1. Perform the comparison

fig = comp.get_comparison(data_path=data_path, method='mds')

Note

Supported methods are UMAP, MDS and t-SNE.

  1. Show the graph

fig.show()

Note

You can update your figure (marker point, axis, legend, etc.) using Plotly’s functions: https://plotly.com/python/creating-and-updating-figures

  1. You can optionally save the plot in a desired format

Compare an experiment to the existing collection of drug profiles#

  1. Read the enrichment analysis result table

input_data = pd.read_csv('tables/table1.csv', index_col=0)

Note

The table should contain dominant_enrichment_value_log2 and dominant_p_value_log10_abs columns

dominant_enrichment_value_log2  dominant_p_value_log10_abs
                     0.868162                    0.821932
                    -0.785398                    0.707911
                        ...                         ...
                    -1.551978                    0.795959
                    -2.986266                    1.521982

[303 rows x 4 columns]
  1. Perform the comparison

fig = comp.get_comparison(input_data=input_data, method='tsne')

Note

Supported methods are UMAP, MDS, and t-SNE

  1. Show the graph

Note

Each point represents a sample, which in this context means a unique combination of drug, concentration, the duration of the treatment, the cell line used, and the running index of replicate. The origin point (0, 0) represents the effect of vehicle control, i.e. no changed kinase activities. If you hover over each point you can see the sample’s name.

fig.show()

Save the plot in a desired format#

  • .html

fig.write_html("path/to/file.html")
  • .svg

fig.write_image("images/fig1.svg")
  • .pdf

fig.write_image("images/fig1.pdf")
  • .png

fig.write_image("images/fig1.png")
  • .jpeg

fig.write_image("images/fig1.jpeg")