33"""
44
55import pandas as pd
6- from anndata import read_h5ad
7- from .common import subplotLabel , getSetup
6+
7+ from ..factorization import correct_conditions , pf2
8+ from ..imports import import_cytokine
9+ from .common import getSetup , subplotLabel
810from .commonFuncs .plotFactors import (
9- plot_condition_factors ,
10- plot_eigenstate_factors ,
1111 plot_geneSet_factors ,
12- plot_factor_weight ,
1312 plot_geneSetScore ,
14- plot_geneSetScoreDot
13+ plot_geneSetScoreDot ,
1514)
16- from ..factorization import correct_conditions
17- from ..imports import import_cytokine ,import_pf2Cytokine30
18- from ..factorization import pf2
1915
20- #plots gene component factors for specifc subset of genes
16+
17+ # plots gene component factors for specifc subset of genes
2118def samples_only (X ) -> pd .DataFrame :
2219 """Obtain samples once only with corresponding observations"""
2320 samples = X .obs
@@ -34,20 +31,29 @@ def makeFigure():
3431 # Add subplot labels
3532 subplotLabel (ax )
3633 X = import_cytokine ()
37-
3834
39- X = pf2 (X , 15 ,regularize_A = True , regParam = 5e-1 )
40-
35+ X = pf2 (X , 15 , regularize_A = True , regParam = 5e-1 )
36+
4137 X .uns ["Pf2_A" ] = correct_conditions (X )
42-
43- immune_suppressive = ["FOXP3" ,"TIGIT" ,"ICOS" ,"IL2RA" ,"PDCD1" ,"TGFB1" ,"SOCS3" ,"PD1" , "LAG3" ,"TNFRSF18" ,"CTLA4" ]
44- immune_activating = ["GZMA" ,"GZMAB" , "PRF1" ]
45- plot_geneSet_factors (X ,ax [0 ],immune_suppressive , False )
46- #plot_geneSet_factors(X,ax[1],["GZMA","GZMB","PRF1",], False )
47- plot_geneSetScore (X ,ax [1 ],immune_suppressive , False )
48- plot_geneSetScoreDot (X ,ax [2 ],immune_suppressive , False )
49- plot_geneSetScore (X ,ax [3 ],immune_activating , False )
50-
51-
52-
53- return f
38+
39+ immune_suppressive = [
40+ "FOXP3" ,
41+ "TIGIT" ,
42+ "ICOS" ,
43+ "IL2RA" ,
44+ "PDCD1" ,
45+ "TGFB1" ,
46+ "SOCS3" ,
47+ "PD1" ,
48+ "LAG3" ,
49+ "TNFRSF18" ,
50+ "CTLA4" ,
51+ ]
52+ immune_activating = ["GZMA" , "GZMAB" , "PRF1" ]
53+ plot_geneSet_factors (X , ax [0 ], immune_suppressive , False )
54+ # plot_geneSet_factors(X,ax[1],["GZMA","GZMB","PRF1",], False )
55+ plot_geneSetScore (X , ax [1 ], immune_suppressive , False )
56+ plot_geneSetScoreDot (X , ax [2 ], immune_suppressive , False )
57+ plot_geneSetScore (X , ax [3 ], immune_activating , False )
58+
59+ return f
0 commit comments