Writer Functions#

The following are functions which write FCS files.

pyreflow.api.fcs_write_datasets(path, datasets, delim=30, big_other=False, compute_crc=False, override_fil=False, allow_over_bitmask='false', disallow_over_range='false', row_buffer_size=28000)#

Write multiple datasets to path.

The resulting file will include HEADER, TEXT, DATA, ANALYSIS, and OTHER as present in this class.

Parameters:
  • path (Path) – Path to be written.

  • datasets (list[CoreDataset2_0 | CoreDataset3_0 | CoreDataset3_1 | CoreDataset3_2]) – datasets to write

  • delim (int) – Delimiter to use when writing TEXT. Defaults to 30.

  • big_other (bool) – If True use 20 chars for OTHER segment offsets, and 8 otherwise. Defaults to False.

  • compute_crc (bool) – If True compute the CRC when writing. Defaults to False.

  • override_fil (bool) – If True, replace $FIL with the name of the output path. Defaults to False.

  • allow_over_bitmask (TriFlag) – Choose how to report integer event values in DATA which exceed bitmask. If "false", raise EventDataError. If "true", throw warning. If "silent", do nothing. Defaults to "false".

  • disallow_over_range (TriFlag) – Choose how to report event values in DATA which exceed $PnR. If "false", throw warning. If "true", raise EventDataError. If "silent", do nothing. Defaults to "false".

  • row_buffer_size (int) – Set the size in bytes for the internal buffer used to write DATA. This is a performance parameter that balances read syscalls (too low) and cache misses (too high). It should generally be 90% of the CPU’s L1D cache size. Defaults to 28000.

Returns:

the value of $NEXTDATA as written in the last dataset if written

Return type:

int | None

Raises:
  • ConfigError – if delim is not between 1 and 126

  • OverflowError – If TEXT (all versions), DATA (2.0 only), or ANALYSIS (2.0 only) end offset is greater than 99,999,999 bytes

  • OverflowError – If any OTHER end offsets are greater than 99,999,999 and big_other is False