-
Notifications
You must be signed in to change notification settings - Fork 1
/
landscape_plot_util.py
90 lines (54 loc) · 1.67 KB
/
landscape_plot_util.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#written by Noah Friedman
import sys
import argparse
import os
import pandas as pd
import numpy as np
from plotnine import *
import matplotlib.pyplot as plt
from collections import Counter
sys.path.append('/ifs/work/taylorlab/friedman/')
def test_func(df):
print 'zeniba'
#plotnine.options.figure_size = (6.4, 4.8)
"""
x = (ggplot(df) +
geom_bar(
aes(x='hrd_cancer',y='brca_signature'), stat='identity'
)
+
facet_wrap('~biallelic_class') #the facet wrap is the ordering of subplots
)"""
x = (ggplot(df) +
aes(x='hrd_cancer',fill='cancer_type') +
geom_bar(position = "fill")
+
facet_wrap('~biallelic_class') #the facet wrap is the ordering of subplots
)
display(x)
def plot_df_by_individual_patient(df, manualXLabel):
"""x = (ggplot(df) +
aes(x='dmp_sample',fill='brca_signature') +
geom_bar(position = "stack")
+
facet_wrap('~biallelic_class') #the facet wrap is the ordering of subplots
+
theme(axis_text_x=element_text(rotation=90, hjust=1)) #rotate x labels so they are less obnoxious
)"""
x = (ggplot(df) +
aes(fill='labelSig', y='mean', x='sigLexicalOrder') +
geom_bar(stat="identity", position="fill")
+
#scale_x_discrete(labels= manualXLabel)
#+
facet_wrap('~biallelic_class', scales='free_x') #the facet wrap is the ordering of subplots
+
theme(axis_text_x=element_text(rotation=90, hjust=1)) #rotate x labels so they are less obnoxious
)
display(x)
def main():
parser = argparse.ArgumentParser(description='Arg parser for this script')
parser.add_argument('--argument', help='stub for parser argument', default='')
args = parser.parse_args()
if __name__ == '__main__':
main()