Skip to content

Commit af62abe

Browse files
committed
ruff format
1 parent f93781e commit af62abe

File tree

7 files changed

+38
-13
lines changed

7 files changed

+38
-13
lines changed

pf2rnaseq/figures/commonFuncs/plotFactors.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ def plot_condition_factors(
1818
cond_group_labels: pd.Series | None = None,
1919
groupConditions=False,
2020
cond="Condition",
21-
log_scale=True
21+
log_scale=True,
2222
):
2323
"""Plots Pf2 condition factors"""
2424
pd.set_option("display.max_rows", None)
2525
yt = pd.Series(np.unique(data.obs[cond]))
2626
X = np.array(data.uns["Pf2_A"])
2727
if log_scale:
2828
X = np.log10(X)
29-
29+
3030
X -= np.median(X, axis=0)
31-
X /= np.std(X, axis=0)+1e-3
32-
ind = reorder_table(X+1e-3)
31+
X /= np.std(X, axis=0) + 1e-3
32+
ind = reorder_table(X + 1e-3)
3333

3434
X = X[ind]
3535
yt = yt.iloc[ind]

pf2rnaseq/figures/figureHeiserCompPac.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Weighted projections per component in PaCMAP and boxplot of cell types
33
"""
44

5-
65
import numpy as np
76

87
from ..factorization import correct_conditions, pf2

pf2rnaseq/figures/figureParseFactorsDeconv.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def makeFigure():
3737

3838
W, H = deconvolution_cytokine(X.uns["Pf2_A"], alpha=1e-1, max_iter=5000)
3939

40-
4140
# Get cytokine names in correct order
4241
samples_df = samples_only(X)
4342

@@ -51,7 +50,7 @@ def makeFigure():
5150
samples_df["cytokine"],
5251
groupConditions=True,
5352
cond="cytokine",
54-
log_scale=False
53+
log_scale=False,
5554
)
5655
ax[0].set_title("Deconvolved matrix (H)", fontsize=12, fontweight="bold")
5756

@@ -61,7 +60,7 @@ def makeFigure():
6160
samples_df["cytokine"],
6261
groupConditions=True,
6362
cond="cytokine",
64-
log_scale=False
63+
log_scale=False,
6564
)
6665
ax[1].set_title("Original Effects (A)", fontsize=12, fontweight="bold")
6766

pf2rnaseq/imports.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ def import_Parse(geneThreshold=0.1, doublet=False) -> anndata.AnnData:
9292
X = anndata.read_h5ad("/home/nicoleb/Pf2-scRNAseq-1/pf2rnaseq/Parse_Donor11.h5ad")
9393
if doublet:
9494
doubletDF = pd.read_csv(
95-
path_here / "pf2rnaseq/Data/DN11Doublets.csv.gz",
96-
index_col=0
97-
)
95+
path_here / "pf2rnaseq/Data/DN11Doublets.csv.gz", index_col=0
96+
)
9897
X.obs = X.obs.join(doubletDF.reindex(X.obs.index))
9998
singlet_mask = X.obs["doublet"] == 0
10099
X = X[singlet_mask, :].copy()

pf2rnaseq/top_bot_genes_export.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
exports csv of top 30 and bottom 30 genes per component
33
"""
44

5-
65
import numpy as np
76
import pandas as pd
87
from anndata import read_h5ad

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dev = [
3636
"pytest>=8.0",
3737
"pytest-cov>=6.0",
3838
"pyright>=1.1",
39+
"ruff>=0.14.4",
3940
]
4041

4142
[project.scripts]

uv.lock

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)