Skip to content

Commit 937a782

Browse files
committed
lint
1 parent cfc4eba commit 937a782

File tree

6 files changed

+27
-31
lines changed

6 files changed

+27
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ and this project adheres to [Semantic Versioning][].
1212

1313
### Added
1414

15-
- Basic tool, preprocessing and plotting functions
15+
- Basic tool, preprocessing and plotting functions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ The complete FlowSOM package known from R, now available in Python!
1313

1414
Please refer to the [documentation][link-docs]. In particular, the following resources are available:
1515

16-
- [Example FlowSOM notebook][link-docs-example]
17-
- [API documentation][link-api]
18-
- [FlowSOM Python Cheatsheet][cheatsheet]
16+
- [Example FlowSOM notebook][link-docs-example]
17+
- [API documentation][link-api]
18+
- [FlowSOM Python Cheatsheet][cheatsheet]
1919

2020
## Installation
2121

docs/api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import flowsom as fs
88

99
The functionality is organised in subpackages:
1010

11-
- `io` for reading and writing FCS files
12-
- `pp` for preprocessing
13-
- `models` for models
14-
- `tl` for tools
15-
- `pl` for plotting
11+
- `io` for reading and writing FCS files
12+
- `pp` for preprocessing
13+
- `models` for models
14+
- `tl` for tools
15+
- `pl` for plotting
1616

1717
The central class is `FlowSOM`, which can be used to read in data and directly perform the FlowSOM algorithm {cite:p}`van_gassen_flowsom_2015`. There is also a convenience function `flowsom_clustering` which performs the same steps but directly on an existing AnnData object. For more low-level control, the `FlowSOMEstimator` class with a scikit-learn Estimator API can be used.
1818

docs/contributing.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ Specify `vX.X.X` as a tag name and create a release. For more information, see [
9999

100100
Please write documentation for new or changed features and use-cases. This project uses [sphinx][] with the following features:
101101

102-
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
103-
- [Numpy-style docstrings][numpydoc] (through the [napoleon][numpydoc-napoleon] extension).
104-
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
105-
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
106-
- Citations (like {cite:p}`van_gassen_flowsom_2015`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
102+
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
103+
- [Numpy-style docstrings][numpydoc] (through the [napoleon][numpydoc-napoleon] extension).
104+
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
105+
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
106+
- Citations (like {cite:p}`van_gassen_flowsom_2015`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
107107

108108
See the [scanpy developer docs](https://scanpy.readthedocs.io/en/latest/dev/documentation.html) for more information
109109
on how to write documentation.
@@ -120,10 +120,10 @@ repository.
120120

121121
#### Hints
122122

123-
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
124-
if you do so can sphinx automatically create a link to the external documentation.
125-
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
126-
the `nitpick_ignore` list in `docs/conf.py`
123+
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
124+
if you do so can sphinx automatically create a link to the external documentation.
125+
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
126+
the `nitpick_ignore` list in `docs/conf.py`
127127

128128
#### Building the docs locally
129129

src/flowsom/io/read_fcs.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def read_FCS(filepath):
1717
f = readfcs.read(filepath, reindex=True)
1818
f.var.n = f.var.n.astype(int)
1919
f.var = f.var.sort_values(by="n")
20-
#f.uns["meta"]["channels"].index = f.uns["meta"]["channels"].index.astype(int)
21-
#f.uns["meta"]["channels"] = f.uns["meta"]["channels"].sort_index()
20+
# f.uns["meta"]["channels"].index = f.uns["meta"]["channels"].index.astype(int)
21+
# f.uns["meta"]["channels"] = f.uns["meta"]["channels"].sort_index()
2222
except ValueError:
2323
f = readfcs.read(filepath, reindex=False)
2424
markers = {
@@ -27,12 +27,10 @@ def read_FCS(filepath):
2727
if re.match("^p[0-9]+s$", string)
2828
}
2929
fluo_channels = list(markers.keys())
30-
non_fluo_channels = {
31-
i: f.var["channel"][i] for i in f.var.index if i not in fluo_channels
32-
}
30+
non_fluo_channels = {i: f.var["channel"][i] for i in f.var.index if i not in fluo_channels}
3331
index_markers = dict(markers, **non_fluo_channels)
3432
f.var.rename(index=index_markers, inplace=True)
35-
#f.uns["meta"]["channels"]["$PnS"] = [index_markers[key] for key in f.uns["meta"]["channels"].index]
33+
# f.uns["meta"]["channels"]["$PnS"] = [index_markers[key] for key in f.uns["meta"]["channels"].index]
3634
return f
3735

3836

src/flowsom/main.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
import copy
4-
53
import anndata as ad
64
import igraph as ig
75
import numpy as np
@@ -425,17 +423,18 @@ def get_cell_data(self):
425423
def get_cluster_data(self):
426424
"""Get the cluster data."""
427425
return self.mudata["cluster_data"]
428-
426+
429427
def copy(self):
430428
"""
431429
Returns a copy of the FlowSOM instance, leveraging MuData's built-in copy method.
432-
433-
Returns:
430+
431+
Returns
432+
-------
434433
FlowSOM: A new instance of FlowSOM with all data copied.
435434
"""
436435
# Create a new instance without calling __init__
437436
fsom_copy = self.__class__.__new__(self.__class__)
438-
437+
439438
# Copy attributes
440439
fsom_copy.cols_to_use = self.cols_to_use
441440
fsom_copy.mad_allowed = self.mad_allowed
@@ -451,7 +450,6 @@ def copy(self):
451450
return fsom_copy
452451

453452

454-
455453
def flowsom_clustering(inp: ad.AnnData, cols_to_use=None, n_clusters=10, xdim=10, ydim=10, **kwargs):
456454
"""Perform FlowSOM clustering on an anndata object and returns the anndata object.
457455

0 commit comments

Comments
 (0)