CEFCON icon indicating copy to clipboard operation
CEFCON copied to clipboard

How to save results from jupyter?

Open River366 opened this issue 1 year ago • 5 comments

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

River366 avatar Jan 25 '24 05:01 River366

@WPZgithub same question!

Roger-GOAT avatar Feb 28 '24 15:02 Roger-GOAT

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.

WPZgithub avatar Mar 01 '24 13:03 WPZgithub

Dear author, thanks a lot!

River366 avatar Mar 04 '24 08:03 River366

@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.

LiuCanidk avatar Apr 12 '24 07:04 LiuCanidk

@LiuCanidk same question! how to save the result???

Roger-GOAT avatar Oct 02 '24 12:10 Roger-GOAT