Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage scanpy plots #23

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

ralatsdc
Copy link

@ralatsdc ralatsdc commented Jan 8, 2025

No description provided.

ralatsdc and others added 28 commits July 24, 2024 20:08
@@ -0,0 +1,455 @@
#!/usr/bin/env python
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a script I use for demonstrating how to run NSForest using Nextflow

markers_dict = dict(zip(df_results["clusterName"], df_results["NSForest_markers"]))
on_target_ratio = calculate_fraction.markers_onTarget(adata, cluster_header, markers_dict, medians_header, save_supplementary = save_supplementary, output_folder = output_folder, outputfilename_prefix = outputfilename_prefix)
df_results = df_results.merge(on_target_ratio, on = "clusterName", how = "left")
if not df_results.empty:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encountered an error when df_results as empty

@@ -45,7 +45,7 @@ def scatter_w_clusterSize(df, col, save = False, output_folder = "", outputfilen
col: str
Column in `df` to plot against "clusterSize".
save: bool (default: False)
Whether to save html file.
Whether to save plot as an SVG file.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need SVG plots in order to make the plots interactive in the user interface

@@ -64,37 +64,39 @@ def scatter_w_clusterSize(df, col, save = False, output_folder = "", outputfilen
fig.write_html(filename)
return fig

def dotplot(adata, markers, cluster_header, gene_symbols = None, dendrogram = True, save = False, output_folder = "", outputfilename_suffix = ""):
def dotplot(adata, markers, cluster_header, gene_symbols = None, dendrogram = True, save = False, show = False, output_folder = "", outputfilename_suffix = ""):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plots of interest use scanpy, which allows setting of save and show separately. Show is helpful when interactive, but problematic when running non-interactively, for example, in Nextflow. Allowing save to be optional just seems sensible and consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants