Skip to content

Commit 7c10d68

Browse files
authored
Merge pull request #26 from saeyslab/aggregate_flowframes_testing + specify higher version of pyflowsom for testing
Update aggregate_flowframes to work with list of flowframes and pin pyflowsom >=0.1.5 to avoid build error in CI
2 parents d8cb6a5 + c84d883 commit 7c10d68

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ requires = [ "hatchling" ]
44

55
[project]
66
name = "flowsom"
7-
version = "0.2.2"
7+
version = "0.2.3"
88
description = "The complete FlowSOM package known from R, now available in Python!"
99
readme = "README.md"
1010
license = { file = "LICENSE" }
1111
maintainers = [
1212
{ name = "Artuur Couckuyt", email = "[email protected]" },
1313
{ name = "Benjamin Rombaut", email = "[email protected]" },
14+
{ name = "Robbe Fonteyn", email = "[email protected]" },
1415
{ name = "Yvan Saeys", email = "[email protected]" },
1516
{ name = "Sofie Van Gassen", email = "[email protected]" },
1617
]
@@ -66,7 +67,7 @@ optional-dependencies.doc = [
6667
"sphinxcontrib-bibtex>=1",
6768
"sphinxext-opengraph",
6869
]
69-
optional-dependencies.test = [ "coverage", "pyflowsom", "pytest" ]
70+
optional-dependencies.test = [ "coverage", "pyflowsom>=0.1.5", "pytest" ]
7071
urls.Documentation = "https://flowsom.readthedocs.io/en/latest/"
7172
urls.Home-page = "https://github.com/saeyslab/FlowSOM_Python"
7273
urls.Source = "https://github.com/saeyslab/FlowSOM_Python"

src/flowsom/pp/fcs_functions.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
from flowsom.tl import get_markers
1010

1111

12-
def aggregate_flowframes(filenames, c_total, channels=None, keep_order=False):
12+
def aggregate_flowframes(files, c_total, channels=None, keep_order=False):
1313
"""Aggregate multiple FCS files together.
1414
15-
:param filenames: An array containing full paths to the FCS files
16-
:type filenames: np.array
15+
:param files: An array/list containing full paths to the FCS files or fcs files as anndata objects
16+
:type files: np.array
1717
:param c_total: Total number of cells to write to the output file
1818
:type c_total: int
1919
:param channels: Channels/markers to keep in the aggregate. Default None
@@ -26,12 +26,14 @@ def aggregate_flowframes(filenames, c_total, channels=None, keep_order=False):
2626
new file. Default = False.
2727
:type silent: boolean.
2828
"""
29-
nFiles = len(filenames)
29+
nFiles = len(files)
3030
cFile = int(np.ceil(c_total / nFiles))
3131

3232
flow_frame = []
33-
for i, file_path in enumerate(filenames):
34-
f = read_FCS(file_path)
33+
for i, f in enumerate(files):
34+
if not isinstance(f, ad.AnnData):
35+
f = read_FCS(f)
36+
3537
if channels is not None:
3638
f = f[:, list(get_markers(f, channels).keys())]
3739
cPerFile = min([f.X.shape[0], cFile])

0 commit comments

Comments
 (0)