Skip to content

Commit ee3fb0f

Browse files
committed
update explore_pathomics_trend
1 parent c24bc38 commit ee3fb0f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

04PreneoplasiaEvolution/01PathomicsTrends/explore_pathomics_trend_all.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ def set_args():
3737
"AEC-Contrast", "AEC-Energy", "LYM-Contrast", "LYM-Energy"]
3838
stage_list = ["Normal", "AAH", "AIS", "MIA", "ADC"]
3939
for path_fea in pathomics_lst:
40-
fig, axes = plt.subplots(1, 3, figsize=(18, 5))
40+
fig, axes = plt.subplots(1, 4, figsize=(20, 5))
4141
sns.violinplot(data=fuse_fea_df, x = "Stages", y=path_fea, order=stage_list, orient='v', ax=axes[0])
42+
axes[0].spines[['right', 'top']].set_visible(False)
4243
sns.violinplot(data=fuse_fea_df, x = "Stages", y=path_fea, hue = "Dataset", order=stage_list, orient='v', ax=axes[1])
4344
sns.violinplot(data=fuse_fea_df, x = "Stages", y=path_fea, hue = "Race", order=stage_list, orient='v', ax=axes[2])
45+
sns.violinplot(data=fuse_fea_df, x = "Stages", y=path_fea, hue = "SmokeStatus", order=stage_list, orient='v', ax=axes[3])
4446
# plt.legend(loc = "best")
45-
fig.suptitle("{} Trends Across Cohorts and Races".format(path_fea))
47+
fig.suptitle("{} Trends Comparison on All Data, Three Cohorts, Two Races, and Smoking Status Across Stages".format(path_fea))
48+
for ind in range(1, 4):
49+
axes[ind].spines[['left', 'right', 'top']].set_visible(False)
50+
axes[ind].get_yaxis().set_visible(False)
51+
axes[ind].legend(frameon=False)
52+
plt.tight_layout()
4653
trend_plot_path = os.path.join(path_trend_dir, "{}-Trends{}".format(path_fea, args.plot_format))
4754
plt.savefig(trend_plot_path, transparent=False, dpi=300)

0 commit comments

Comments
 (0)