4 import matplotlib
as mpl
5 import matplotlib
.pyplot
as plt
6 from matplotlib
.backends
.backend_pdf
import PdfPages
8 mpl
.rc('ps', fonttype
=42, papersize
='figure')
9 mpl
.rc('pdf', fonttype
=42, compression
=9) #pdf.fonttype: 3 # Output Type 3 (Type3) or Type 42 (TrueType)
10 mpl
.rc('figure', figsize
=(129/25.4, 129/25.4), dpi
=600) # autolayout=True
11 mpl
.rc('savefig', dpi
='figure') # bbox='tight'
17 return tuple(s
.split())
19 prefix
= '/share/result/spatial/test_huxs/prj/cmpmethod/testicles2/c2ltest/'
21 diffout
= pd
.read_csv(f
'{prefix}diffout.csv.zst', index_col
=0)
22 diffcorr
=diffout
.corr()
24 # micromamba install zstandard
25 factors
= qw('Elongating Endothelial InnateLymph Leydig Macrophage Myoid SPG STids Scytes Sertoli Unknown')
27 pdf
= PdfPages(f
'{prefix}diffout.pdf')
28 for onefactor
in factors
:
30 colids
.append(f
"{onefactor}_1")
31 colids
.append(f
"{onefactor}_2")
32 onecorr
= diffcorr
[colids
[0]][colids
[1]]
33 print(f
'{onefactor}: {onecorr}')
35 tmpDF
['rank1']=diffout
[colids
[0]].rank()
36 tmpDF
['rank2']=diffout
[colids
[1]].rank()
37 tmpDF
[colids
[0]]=diffout
[colids
[0]]
38 tmpDF
[colids
[1]]=diffout
[colids
[1]]
40 sns
.jointplot(data
=tmpDF
, x
=colids
[0], y
=colids
[1],kind
="scatter",marginal_ticks
=True,s
=1)
41 plt
.suptitle(f
'{onefactor}, Corr: {onecorr}')
45 print(f
'.\n[i]Done.', flush
=True)