All labs

Playground

Try anything in R or Python. Plots work too. Your code is not saved, so copy anything you want to keep.

# Python playground: write any Python and press Run (Ctrl/⌘ + Enter)
import math

expression = {"TP53": 12.4, "BRCA1": 8.1, "MYC": 15.7, "GAPDH": 220.0}
for gene, value in sorted(expression.items(), key=lambda kv: -kv[1]):
    print(f"{gene:6s} {value:7.1f}   log2 = {math.log2(value):5.2f}")

Python 3 with the standard library; numpy, pandas and matplotlib load automatically when you import them (the first import takes a few seconds).