API Reference#

class DataFrame(data=None, index: Axes | None = None, columns: Axes | None = None, dtype: Dtype | None = None, copy: bool | None = None)[source]#
classmethod from_fcs(filepath_or_buffer: Union[str, fcsy._typing.ReadFcsBuffer], channel_type: str = 'short')[source]#

Read dataframe from fcs.

Parameters
  • filepath_or_buffer (str or file-like object) – str or file-like object. String, or file-like object implementing a read() function. The string could be a s3 url with the format: s3://{bucket}/{key}.

  • channel_type (str, optional) – {“short”, “long”, “multi”}, defaults to “short”. “short” and “long” refer to short ($PnN) and long ($PnS) name of parameter n, respectively. See FCS3.1 data standard for detailed explanation.

Returns

the dataframe contains the fcs channels and data

Return type

DataFrame

to_fcs(filepath_or_buffer: Union[str, fcsy._typing.WriteFcsBuffer])[source]#

write fcs.

Parameters

filepath_or_buffer – String, or file-like object implementing a write() function. The string could be a s3 url with the format: s3://{bucket}/{key}.

read_channels(filepath_or_buffer: Union[str, fcsy._typing.ReadFcsBuffer], channel_type: str = 'short') Union[list, pandas.core.indexes.multi.MultiIndex][source]#

Read fcs channels.

Parameters
  • filepath_or_buffer (str or file-like object) – String, or file-like object implementing a read() function. The string could be a s3 url with the format: s3://{bucket}/{key}.

  • channel_type (str, optional) – {“short”, “long”, “multi”}, defaults to “short”. “short” and “long” refer to short ($PnN) and long ($PnS) name of parameter n, respectively. See FCS3.1 data standard for detailed explanation.

Returns

list of the channels

Return type

Union[list, pd.MultiIndex]

read_events_num(filepath_or_buffer: Union[str, fcsy._typing.ReadFcsBuffer]) int[source]#

Read fcs events number.

Parameters

filepath_or_buffer – str or file-like object String, or file-like object implementing a read() function. The string could be a s3 url with the format: s3://{bucket}/{key}.

Returns

the events number

Return type

int

rename_channels(filepath_or_buffer: Union[str, _io.BufferedRandom], channels: dict, channel_type: str, allow_rewrite: bool = False) None[source]#

Rename fcs channels.

Parameters
  • filepath_or_buffer (str or file-like object) – String, or file-like object implementing both read() and write() functions. S3 url is not supported.

  • channels (dict) – A mapper from old names to new names.

  • channel_type (str) – {“short”, “long”}. “short” and “long” refer to short ($PnN) and long ($PnS) name of parameter n, respectively. See FCS3.1 data standard for detailed explanation.

  • allow_rewrite (bool) –

    Allow rewriting the whole file if channel only editing is not feasible. It can be one of the following:

    • The new channel names are too long causing Text Segment overlap with Data Segment.

    • filepath_or_buffer is s3 url.