diff --git a/pyproject.toml b/pyproject.toml index 0018048..99abd4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,14 @@ requires = [ "hatchling" ] [project] name = "flowsom" -version = "0.2.2" +version = "0.2.3" description = "The complete FlowSOM package known from R, now available in Python!" readme = "README.md" license = { file = "LICENSE" } maintainers = [ { name = "Artuur Couckuyt", email = "Artuur.Couckuyt@ugent.be" }, { name = "Benjamin Rombaut", email = "Benjamin.Rombaut@ugent.be" }, + { name = "Robbe Fonteyn", email = "Robbe.Fonteyn@ugent.be" }, { name = "Yvan Saeys", email = "Yvan.Saeys@UGent.be" }, { name = "Sofie Van Gassen", email = "Sofie.VanGassen@UGent.be" }, ] diff --git a/src/flowsom/pp/fcs_functions.py b/src/flowsom/pp/fcs_functions.py index d594e12..d04f863 100644 --- a/src/flowsom/pp/fcs_functions.py +++ b/src/flowsom/pp/fcs_functions.py @@ -9,11 +9,11 @@ from flowsom.tl import get_markers -def aggregate_flowframes(filenames, c_total, channels=None, keep_order=False): +def aggregate_flowframes(files, c_total, channels=None, keep_order=False): """Aggregate multiple FCS files together. - :param filenames: An array containing full paths to the FCS files - :type filenames: np.array + :param files: An array/list containing full paths to the FCS files or fcs files as anndata objects + :type files: np.array :param c_total: Total number of cells to write to the output file :type c_total: int :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): new file. Default = False. :type silent: boolean. """ - nFiles = len(filenames) + nFiles = len(files) cFile = int(np.ceil(c_total / nFiles)) flow_frame = [] - for i, file_path in enumerate(filenames): - f = read_FCS(file_path) + for i, f in enumerate(files): + if not isinstance(f, ad.AnnData): + f = read_FCS(f) + if channels is not None: f = f[:, list(get_markers(f, channels).keys())] cPerFile = min([f.X.shape[0], cFile])