WPZgithub / CEFCON

Deciphering driver regulators of cell fate decisions from single-cell RNA-seq data
MIT License
20 stars 2 forks source link

How to save results from jupyter? #3

Open River366 opened 7 months ago

River366 commented 7 months ago

Dear author, thanks for your work! However, I meet some questions during use. Would you mind provide some help?

  1. How to save result's fig as PDF or SVG file? Such as these example figs in jupyter notebook? Screenshot from 2024-01-25 13-53-39

  2. How to save detail result from jupyter notebook? Such as, If I hope to check the detail info of every regulon-like gene module. What should I do?

Thanks a lot for your help!

Best regards, HE

Roger-GOAT commented 6 months ago

@WPZgithub same question!

WPZgithub commented 5 months ago

Hi! Sorry for the delayed response.

For the first question: You can save the result image with this function plt.savefig( ) . For example:

current_figure  = plt.gcf()
current_figure .savefig("filename.pdf", dpi=150)

Additionally, I'm considering updating the code soon to allow for image output to a file by setting the parameter accordingly.

For the second question: You can access detailed information about each regulon-like gene module as follows:

RGMs = result.RGMs_AUCell_dict['RGMs'] # A list of all the regulon-like gene modules
regulator_info = RGMs[0].name #  The name of the first regulon-like gene module
gene_members = RGMs[0].gene2weight.keys() # The first regulon-like gene module

By the way, the command-line usage can directly output all the result files.

River366 commented 5 months ago

Dear author, thanks a lot!

LiuCanidk commented 4 months ago

@WPZgithub sorry to interrupt But if I want to save the constructed regulatory network and the driver regulators, how should I do? That is, after time-consuming running of the construction and identification of GRN, I want to save the result and load them locally for the downstream analysis and visualization.