question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Saving for QC and results plots.

See original GitHub issue

Some functions (e.g., cell2location.utils.filtering.filter_genes or RegressionModel.plot_QC) generate plots, but have no way (that I could think of) for saving the plots from a script. Workarounds don’t always work, for example the code below only saves one of the two plots generated when interactively running the code.

fig, ax = plt.subplots()
mod.plot_QC()
# only saves first plot unfortunately
fig.savefig(QC_dir / 'QC_plots_signature_model.png', dpi=300)

Since sometimes running cell2loc interactively is not practical, it would be great to have improved plot saving capabilities! Thank you for your great work!

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yozhikoffcommented, Aug 16, 2022

@yozhikoff what do you think is the best interface for saving plots? File path argument to the function or just making sure that mod.plot_QC() creates only one plot?

@vitkl I would just return a list of Figure objects, so that the user could do whatever is needed - save, modify, add something else.

1reaction
vitklcommented, Aug 16, 2022

Also adding the history plots for completeness:

# plot ELBO loss history during training, removing first 100 epochs from the plot
mod.plot_history(5000)
plt.savefig(f"{scvi_run_name}/training_ELBO_history_minus5k.png",
                   bbox_inches='tight')
plt.close()
mod.plot_history(0)
plt.savefig(f"{scvi_run_name}/training_ELBO_history_all.png",
                   bbox_inches='tight')
plt.close()
Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips to Save Time & Money: Digital Quality Control Inspections
Getting actionable QC inspection results faster can save time, money, and a lot of headaches. It all starts with digital tools for collecting,...
Read more >
How to save results of each step from ChAMP pipeline?
I'm trying to test a pipeline to analyse methylation array data using ChAMP package. I'm following the follow tutorial: https://www.bioconductor ...
Read more >
Dashboard, Reports & Analysis in HP ALM (Quality Center)
User can create graphs or project reports in the Analysis View module. They can also save the graphs and reports in the Analysis...
Read more >
6 Basic Quality Control (QC) and Exploration of scRNA-seq ...
All these normalization functions save the results to the logcounts slot of the SCE object. For downsampling we use our own functions shown...
Read more >
QC/ALM Status Reports and Graphs Sharing Made Easy
We have a way to save you some time! Built-in functionality of QC /ALM allows you to share up to date QC /ALM...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found