Skip to content

Commit

Permalink
1st attempt to fix rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
namsaraeva committed Feb 5, 2024
1 parent f2241ef commit 8a37d15
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
12 changes: 0 additions & 12 deletions pertpy/tools/_augur.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions pertpy/tools/_coda/_base_coda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions pertpy/tools/_dialogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions pertpy/tools/_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions pertpy/tools/_milo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions pertpy/tools/_mixscape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down Expand Up @@ -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.")
Expand Down Expand Up @@ -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.")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.')
Expand Down

0 comments on commit 8a37d15

Please sign in to comment.