88from flowsom .io import read_FCS
99from flowsom .tl import get_markers
1010
11-
12- def aggregate_flowframes (filenames , c_total , channels = None , keep_order = False ):
11+ def aggregate_flowframes (files , c_total , channels = None , keep_order = False ):
1312 """Aggregate multiple FCS files together.
1413
15- :param filenames : An array containing full paths to the FCS files
16- :type filenames : np.array
14+ :param files : An array/list containing full paths to the FCS files or fcs files as anndata objects
15+ :type files : np.array
1716 :param c_total: Total number of cells to write to the output file
1817 :type c_total: int
1918 :param channels: Channels/markers to keep in the aggregate. Default None
@@ -26,12 +25,15 @@ def aggregate_flowframes(filenames, c_total, channels=None, keep_order=False):
2625 new file. Default = False.
2726 :type silent: boolean.
2827 """
29- nFiles = len (filenames )
28+ nFiles = len (files )
3029 cFile = int (np .ceil (c_total / nFiles ))
3130
3231 flow_frame = []
33- for i , file_path in enumerate (filenames ):
34- f = read_FCS (file_path )
32+ for i , f in enumerate (files ):
33+
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