Skip to content

Commit 19a2974

Browse files
committed
add missing examples
1 parent b413a00 commit 19a2974

File tree

5 files changed

+68
-0
lines changed

5 files changed

+68
-0
lines changed

examples/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Gallery / Examples
2+
===================
3+
4+
General-purpose examples for GDSCTools library.

examples/plot_association.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Association between a Drug and a Feature
3+
=========================================
4+
5+
Boxplot association
6+
"""
7+
8+
9+
10+
#####################################################
11+
#
12+
from gdsctools import ANOVA, ic50_test
13+
gdsc = ANOVA(ic50_test)
14+
gdsc.set_cancer_type('breast')
15+
df = gdsc.anova_one_drug_one_feature(1047, 'TP53_mut', show=True)

examples/plot_elastic_tuning.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Tuning alpha (elastic net case)
3+
=========================================
4+
5+
Elastic net requires tune an alpha parameter.
6+
"""
7+
8+
9+
10+
#####################################################
11+
#
12+
from gdsctools import *
13+
ic = IC50(gdsctools_data("IC50_v5.csv.gz"))
14+
gf = GenomicFeatures(gdsctools_data("genomic_features_v5.csv.gz"))
15+
en = ElasticNet(ic, gf)
16+
en.tune_alpha(1047, N=40, l1_ratio=0.1)
17+
18+

examples/plot_ic50_hist.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Histogram of the IC50 from v17 data set
3+
=========================================
4+
5+
histogram of the IC50
6+
"""
7+
8+
9+
10+
#####################################################
11+
#
12+
from gdsctools import IC50, ic50_v17
13+
r = IC50(ic50_v17)
14+
r.hist()

examples/plot_volcano.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Analyse all associations (drug/feature)
3+
=========================================
4+
5+
Volcano plot (all associations)
6+
"""
7+
8+
9+
10+
#####################################################
11+
#
12+
from gdsctools import ANOVA, ic50_test
13+
gdsc = ANOVA(ic50_test)
14+
results = gdsc.anova_all()
15+
results.volcano()
16+
17+

0 commit comments

Comments
 (0)