From 8a37d15847d530ef96091848b4232653b4ee1942 Mon Sep 17 00:00:00 2001 From: Altana Namsaraeva <99650244+namsaraeva@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:27:51 +0100 Subject: [PATCH] 1st attempt to fix rendering --- pertpy/tools/_augur.py | 12 ------------ pertpy/tools/_coda/_base_coda.py | 8 ++++---- pertpy/tools/_dialogue.py | 4 ++-- pertpy/tools/_enrichment.py | 4 ++-- pertpy/tools/_milo.py | 4 ++-- pertpy/tools/_mixscape.py | 10 +++++----- 6 files changed, 15 insertions(+), 27 deletions(-) diff --git a/pertpy/tools/_augur.py b/pertpy/tools/_augur.py index f6ac00b6..38889f0e 100644 --- a/pertpy/tools/_augur.py +++ b/pertpy/tools/_augur.py @@ -998,9 +998,6 @@ def plot_dp_scatter( >>> pvals = ag_rfc.predict_differential_prioritization(augur_results1=results_15, augur_results2=results_48, \ permuted_results1=results_15_permute, permuted_results2=results_48_permute) >>> ag_rfc.plot_dp_scatter(pvals) - - Preview: - # TODO: add preview """ x = results["mean_augur_score1"] y = results["mean_augur_score2"] @@ -1056,9 +1053,6 @@ def plot_important_features( >>> loaded_data = ag_rfc.load(adata) >>> v_adata, v_results = ag_rfc.predict(loaded_data, subsample_size=20, select_variance_features=True, n_threads=4) >>> ag_rfc.plot_important_features(v_results) - - Preview: - # TODO: add preview """ if isinstance(data, AnnData): results = data.uns[key] @@ -1109,9 +1103,6 @@ def plot_lollipop( >>> loaded_data = ag_rfc.load(adata) >>> v_adata, v_results = ag_rfc.predict(loaded_data, subsample_size=20, select_variance_features=True, n_threads=4) >>> ag_rfc.plot_lollipop(v_results) - - Preview: - # TODO: add preview """ if isinstance(data, AnnData): results = data.uns[key] @@ -1160,9 +1151,6 @@ def plot_scatterplot( >>> h_adata, h_results = ag_rfc.predict(loaded_data, subsample_size=20, n_threads=4) >>> v_adata, v_results = ag_rfc.predict(loaded_data, subsample_size=20, select_variance_features=True, n_threads=4) >>> ag_rfc.plot_scatterplot(v_results, h_results) - - Preview: - # TODO: add preview """ cell_types = results1["summary_metrics"].columns diff --git a/pertpy/tools/_coda/_base_coda.py b/pertpy/tools/_coda/_base_coda.py index 4bb42433..b7aeed9c 100644 --- a/pertpy/tools/_coda/_base_coda.py +++ b/pertpy/tools/_coda/_base_coda.py @@ -1227,7 +1227,7 @@ def plot_stacked_barplot( # pragma: no cover >>> sccoda.plot_stacked_barplot(mdata, feature_name="samples") Preview: - .. image:: ../_static/docstring_previews/sccoda_stacked_barplot.png + .. image:: /_static/docstring_previews/sccoda_stacked_barplot.png """ if isinstance(data, MuData): data = data[modality_key] @@ -1332,7 +1332,7 @@ def plot_effects_barplot( # pragma: no cover >>> sccoda.plot_effects_barplot(mdata) Preview: - .. image:: ../_static/docstring_previews/sccoda_effects_barplot.png + .. image:: /_static/docstring_previews/sccoda_effects_barplot.png """ if args_barplot is None: args_barplot = {} @@ -1515,7 +1515,7 @@ def plot_boxplots( # pragma: no cover >>> sccoda.plot_boxplots(mdata, feature_name="condition", add_dots=True) Preview: - .. image:: ../_static/docstring_previews/sccoda_boxplots.png + .. image:: /_static/docstring_previews/sccoda_boxplots.png """ if args_boxplot is None: args_boxplot = {} @@ -1734,7 +1734,7 @@ def plot_rel_abundance_dispersion_plot( # pragma: no cover >>> sccoda.plot_rel_abundance_dispersion_plot(mdata) Preview: - .. image:: ../_static/docstring_previews/sccoda_rel_abundance_dispersion_plot.png + .. image:: /_static/docstring_previews/sccoda_rel_abundance_dispersion_plot.png """ if isinstance(data, MuData): data = data[modality_key] diff --git a/pertpy/tools/_dialogue.py b/pertpy/tools/_dialogue.py index 18934bcc..c6e9f9cb 100644 --- a/pertpy/tools/_dialogue.py +++ b/pertpy/tools/_dialogue.py @@ -1093,7 +1093,7 @@ def plot_split_violins( >>> dl.plot_split_violins(adata, split_key='gender', celltype_key='cell.subtypes') Preview: - .. image:: ../_static/docstring_previews/dialogue_violin.png + .. image:: /_static/docstring_previews/dialogue_violin.png """ df = sc.get.obs_df(adata, [celltype_key, mcp, split_key]) if split_which is None: @@ -1136,7 +1136,7 @@ def plot_pairplot( >>> dl.plot_pairplot(adata, celltype_key="cell.subtypes", color="gender", sample_id="clinical.status") Preview: - .. image:: ../_static/docstring_previews/dialogue_pairplot.png + .. image:: /_static/docstring_previews/dialogue_pairplot.png """ mean_mcps = adata.obs.groupby([sample_id, celltype_key])[mcp].mean() mean_mcps = mean_mcps.reset_index() diff --git a/pertpy/tools/_enrichment.py b/pertpy/tools/_enrichment.py index 21b8601d..f713af4d 100644 --- a/pertpy/tools/_enrichment.py +++ b/pertpy/tools/_enrichment.py @@ -326,7 +326,7 @@ def plot_dotplot( >>> pt_enrichment.plot_dotplot(adata, categories=["B01", "B02", "B03"], groupby="louvain") Preview: - .. image:: ../_static/docstring_previews/enrichment_dotplot.png + .. image:: /_static/docstring_previews/enrichment_dotplot.png """ if categories is not None: if isinstance(categories, str): @@ -403,7 +403,7 @@ def plot_gsea( >>> pt_enrichment.plot_gsea(adata, enrichment, interactive_plot=True) Preview: - .. image:: ../_static/docstring_previews/enrichment_gsea.png + .. image:: /_static/docstring_previews/enrichment_gsea.png """ for cluster in enrichment: fig = blitzgsea.plot.top_table( diff --git a/pertpy/tools/_milo.py b/pertpy/tools/_milo.py index 9b3a3225..8a911005 100644 --- a/pertpy/tools/_milo.py +++ b/pertpy/tools/_milo.py @@ -736,7 +736,7 @@ def plot_nhood_graph( >>> milo.plot_nhood_graph(mdata) Preview: - .. image:: ../_static/docstring_previews/milo_nhood_graph.png + .. image:: /_static/docstring_previews/milo_nhood_graph.png """ nhood_adata = mdata["milo"].T.copy() @@ -809,7 +809,7 @@ def plot_nhood( >>> milo.plot_nhood(mdata, ix=0) Preview: - .. image:: ../_static/docstring_previews/milo_nhood.png + .. image:: /_static/docstring_previews/milo_nhood.png """ mdata[feature_key].obs["Nhood"] = mdata[feature_key].obsm["nhoods"][:, ix].toarray().ravel() sc.pl.embedding( diff --git a/pertpy/tools/_mixscape.py b/pertpy/tools/_mixscape.py index 93dae15f..f4d2b348 100644 --- a/pertpy/tools/_mixscape.py +++ b/pertpy/tools/_mixscape.py @@ -535,7 +535,7 @@ def plot_barplot( # pragma: no cover >>> ms_pt.plot_barplot(mdata['rna'], guide_rna_column='NT') Preview: - .. image:: ../_static/docstring_previews/mixscape_barplot.png + .. image:: /_static/docstring_previews/mixscape_barplot.png """ if mixscape_class_global not in adata.obs: raise ValueError("Please run the `mixscape` function first.") @@ -642,7 +642,7 @@ def plot_heatmap( # pragma: no cover >>> ms_pt.plot_heatmap(adata = mdata['rna'], labels='gene_target', target_gene='IFNGR2', layer='X_pert', control='NT') Preview: - .. image:: ../_static/docstring_previews/mixscape_heatmap.png + .. image:: /_static/docstring_previews/mixscape_heatmap.png """ if "mixscape_class" not in adata.obs: raise ValueError("Please run `pt.tl.mixscape` first.") @@ -706,7 +706,7 @@ def plot_perturbscore( # pragma: no cover >>> ms_pt.plot_perturbscore(adata = mdata['rna'], labels='gene_target', target_gene='IFNGR2', color = 'orange') Preview: - .. image:: ../_static/docstring_previews/mixscape_perturbscore.png + .. image:: /_static/docstring_previews/mixscape_perturbscore.png """ if "mixscape" not in adata.uns: raise ValueError("Please run the `mixscape` function first.") @@ -875,7 +875,7 @@ def plot_violin( # pragma: no cover >>> ms_pt.plot_violin(adata = mdata['rna'], target_gene_idents=['NT', 'IFNGR2 NP', 'IFNGR2 KO'], groupby='mixscape_class') Preview: - .. image:: ../_static/docstring_previews/mixscape_violin.png + .. image:: /_static/docstring_previews/mixscape_violin.png """ if isinstance(target_gene_idents, str): mixscape_class_mask = adata.obs[groupby] == target_gene_idents @@ -1057,7 +1057,7 @@ def plot_lda( # pragma: no cover >>> ms_pt.plot_lda(adata=mdata['rna'], control='NT') Preview: - .. image:: ../_static/docstring_previews/mixscape_lda.png + .. image:: /_static/docstring_previews/mixscape_lda.png """ if mixscape_class not in adata.obs: raise ValueError(f'Did not find `.obs["{mixscape_class!r}"]`. Please run the `mixscape` function first.')