Module: FCSParse

Defined in:
lib/fcsparse.rb,
lib/fcsparse/fcsconst.rb,
lib/fcsparse/fcsevent.rb

Overview

Contains all classes and constants for parsing FCS v3.x formatted files.

Defined Under Namespace

Classes: FCSEvent, FCSFile, FCSParam

Constant Summary

H_VersionStart =

byte offsets to the start and end of the version string

0
H_VersionEnd =
5
H_OffsetBlockLength =

length of the block specifying the offsets of text, data, analysis sections

8
H_TextBlockOffsetStart =

offsets to the start and end of the text section offset

10
H_TextBlockOffsetEnd =
18
H_DataBlockOffsetStart =

offsets to the start and end of the data section offset

26
H_DataBlockOffsetEnd =
34
H_AnalysisBlockOffsetStart =

offsets to the start and end of the analysis section offset

42
H_AnalysisBlockOffsetEnd =
50
T_SupplTextStartKeyword =

keyword specifying offset to supplementary text section

:$BEGINSTEXT
T_SupplTextEndKeyword =
:$ENDSTEXT
T_AnalysisStartKeyword =

keyword specifying offset to analysis section

:$BEGINANALYSIS
T_AnalysisEndKeyword =
:$BEGINANALYSIS
T_DataStartKeyword =

keyword specifying offset to data section

:$BEGINDATA
T_DataEndKeyword =
:$ENDDATA
T_ModeKeyword =

keyword specifying the data mode

:$MODE
T_DatatypeKeyword =

keyword specifying the data type (e.g. integer, float, etc)

:$DATATYPE
T_ByteorderKeyword =

keyword specifying byte order and value when little endian

:$BYTEORD
T_LittleEndianByteorder =
"1,2,3,4"
T_ParameterCountKeyword =

keyword specifying the number of parameters measured per event

:$PAR
T_EventCountKeyword =

keyword specifying total number of events

:$TOT
T_ParameterNameKeywordRegex =

regular expressions matching names and ranges of all parameters

/P(\d+)N/
T_ParameterRangeKeywordRegex =
/P(\d+)R/

Class Method Summary (collapse)

Class Method Details

+ (Object) process_file(filename, data_header_row = true)

Processes a specified FCS-formatted file, and writes human-readable output to disk in the format specified by FCSParse::FCSFile#write_metadata_and_data.

the data file should have a header row with the name of each column’s parameter. Defaults to true.

Parameters:

  • filename (String)

    the filename of the FCS-encoded file (with path as required to locate it)

  • data_header_row (Boolean) (defaults to: true)

    an optional parameter specifying whether



345
346
347
348
349
350
351
352
353
# File 'lib/fcsparse.rb', line 345

def self.process_file(filename, data_header_row = true)
  
  fcsfile = FCSFile.new_from_file(filename)
  fcsfile.parse
  fcsfile.(data_header_row)
  
  nil
  
end