Skip to content

Commit

Permalink
🎨 sections and views improved
Browse files Browse the repository at this point in the history
  • Loading branch information
enryH committed Nov 28, 2024
1 parent f1aeb4a commit 7909c07
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 15 deletions.
61 changes: 51 additions & 10 deletions docs/api_examples/ANCOVA_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Filtering data"
"## Filtering data"
]
},
{
Expand All @@ -128,14 +128,6 @@
"If data is already filtered and/or imputed, skip this step."
]
},
{
"cell_type": "markdown",
"id": "406f9363",
"metadata": {},
"source": [
"## Filtering features"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -485,7 +477,56 @@
},
"outputs": [],
"source": [
"anova.iloc[:, 2:7]"
"view = anova.iloc[:, 2:7]\n",
"viewed_cols = view.columns.to_list()\n",
"view"
]
},
{
"cell_type": "markdown",
"id": "3d362360",
"metadata": {},
"source": [
"Test results"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2e2cf127",
"metadata": {
"tags": [
"hide-input"
]
},
"outputs": [],
"source": [
"regex_filter = \"pval|padj|reject|stat|FC\"\n",
"view = anova.filter(regex=regex_filter)\n",
"viewed_cols.extend(view.columns)\n",
"view"
]
},
{
"cell_type": "markdown",
"id": "d02676e9",
"metadata": {},
"source": [
"Other information"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4c8f516b",
"metadata": {
"tags": [
"hide-input"
]
},
"outputs": [],
"source": [
"anova.drop(columns=viewed_cols)"
]
},
{
Expand Down
24 changes: 19 additions & 5 deletions docs/api_examples/ANCOVA_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,11 @@
omics

# %% [markdown]
# ### Filtering data
# ## Filtering data

# %% [markdown]
# If data is already filtered and/or imputed, skip this step.

# %% [markdown]
# ## Filtering features

# %% tags=["hide-input"]
M_before = omics.shape[1]
omics = omics.dropna(thresh=int(len(omics) * freq_cutoff), axis=1)
Expand Down Expand Up @@ -224,7 +221,24 @@
# view averages per protein group

# %% tags=["hide-input"]
anova.iloc[:, 2:7]
view = anova.iloc[:, 2:7]
viewed_cols = view.columns.to_list()
view

# %% [markdown]
# Test results

# %% tags=["hide-input"]
regex_filter = "pval|padj|reject|stat|FC"
view = anova.filter(regex=regex_filter)
viewed_cols.extend(view.columns)
view

# %% [markdown]
# Other information

# %% tags=["hide-input"]
anova.drop(columns=viewed_cols)

# %% [markdown]
# ## Comparing ANOVA and ANCOVA results
Expand Down

0 comments on commit 7909c07

Please sign in to comment.