[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73GN33AE6BW60PVH54EB8DR":3,"skill-same:01M73GN33AE6BW60PVH54EB8DR":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73GN33AE6BW60PVH54EB8DR","flowio-flow-cytometry",null,"Parse\u002Fwrite FCS (Flow Cytometry) files v2.0-3.1. Events as NumPy, channel metadata, multi-dataset files, CSV\u002FFCS export. Use FlowKit for gating\u002Fcompensation.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"BSD-3-Clause","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fflowio-flow-cytometry\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: flowio-flow-cytometry\ndescription: \"Parse\u002Fwrite FCS (Flow Cytometry) files v2.0-3.1. Events as NumPy, channel metadata, multi-dataset files, CSV\u002FFCS export. Use FlowKit for gating\u002Fcompensation.\"\nlicense: BSD-3-Clause\n---\n\n# FlowIO — Flow Cytometry File Handler\n\n## Overview\n\nFlowIO is a lightweight Python library for reading and writing Flow Cytometry Standard (FCS) files. It parses FCS metadata, extracts event data as NumPy arrays, and creates new FCS files. Supports FCS versions 2.0, 3.0, and 3.1. Minimal dependencies — ideal for data pipelines and preprocessing before advanced analysis.\n\n## When to Use\n\n- Parsing FCS files to extract event data as NumPy arrays\n- Reading channel metadata (names, ranges, types) from FCS files\n- Converting flow cytometry data to pandas DataFrames or CSV\n- Creating new FCS files from NumPy arrays or processed data\n- Handling multi-dataset FCS files (separating combined datasets)\n- Batch processing directories of FCS files\n- Preprocessing flow cytometry data before downstream analysis\n- For **compensation, gating, and FlowJo workspace support**, use FlowKit instead\n- For **advanced cytometry visualization** (density plots, gating plots), use matplotlib or plotly\n\n## Prerequisites\n\n```bash\npip install flowio numpy pandas\n```\n\nRequires Python 3.9+. No compiled dependencies — installs on any platform.\n\n## Quick Start\n\n```python\nfrom flowio import FlowData\n\nflow = FlowData(\"experiment.fcs\")\nprint(f\"Events: {flow.event_count}, Channels: {flow.channel_count}\")\nprint(f\"Channels: {flow.pnn_labels}\")\n\nevents = flow.as_array()  # Shape: (n_events, n_channels)\nprint(f\"Data shape: {events.shape}\")\n```\n\n## Core API\n\n### 1. Reading FCS Files\n\nThe `FlowData` class is the primary interface for reading FCS files.\n\n```python\nfrom flowio import FlowData\n\n# Standard reading\nflow = FlowData(\"sample.fcs\")\nprint(f\"Version: {flow.version}\")          # '3.0', '3.1', etc.\nprint(f\"Events: {flow.event_count}\")\nprint(f\"Channels: {flow.channel_count}\")\n\n# Event data\nevents = flow.as_array()                   # Preprocessed (gain, log scaling)\nraw = flow.as_array(preprocess=False)      # Raw values\nprint(f\"Shape: {events.shape}\")            # (n_events, n_channels)\n\n# Memory-efficient: metadata only (skip DATA segment)\nflow_meta = FlowData(\"sample.fcs\", only_text=True)\nprint(f\"Instrument: {flow_meta.text.get('$CYT', 'Unknown')}\")\n\n# Handle problematic files\nflow = FlowData(\"bad.fcs\", ignore_offset_discrepancy=True)\nflow = FlowData(\"bad.fcs\", use_header_offsets=True)\n\n# Exclude null channels\nflow = FlowData(\"sample.fcs\", null_channel_list=[\"Time\", \"Null\"])\n```\n\n### 2. Channel Metadata\n\nExtract channel names, types, and ranges from FCS files.\n\n```python\nflow = FlowData(\"sample.fcs\")\n\n# Channel names\npnn = flow.pnn_labels   # Short names: ['FSC-A', 'SSC-A', 'FL1-A', ...]\npns = flow.pns_labels   # Descriptive: ['Forward Scatter', 'Side Scatter', 'FITC', ...]\npnr = flow.pnr_values   # Range\u002Fmax values per channel\n\n# Channel type indices\nscatter_idx = flow.scatter_indices   # [0, 1] — FSC, SSC\nfluoro_idx = flow.fluoro_indices     # [2, 3, 4] — fluorescence channels\ntime_idx = flow.time_index           # Time channel index (or None)\n\n# Access by type\nevents = flow.as_array()\nscatter_data = events[:, scatter_idx]\nfluoro_data = events[:, fluoro_idx]\n\n# Full metadata (TEXT segment dictionary)\ntext = flow.text\nprint(f\"Date: {text.get('$DATE', 'N\u002FA')}\")\nprint(f\"Instrument: {text.get('$CYT', 'N\u002FA')}\")\n```\n\n### 3. Creating FCS Files\n\nGenerate new FCS files from NumPy arrays.\n\n```python\nimport numpy as np\nfrom flowio import create_fcs\n\n# Basic creation\nevents = np.random.rand(10000, 5) * 1000\nchannels = [\"FSC-A\", \"SSC-A\", \"FL1-A\", \"FL2-A\", \"Time\"]\ncreate_fcs(\"output.fcs\", events, channels)\n\n# With descriptive names and metadata\ncreate_fcs(\n    \"output.fcs\",\n    events,\n    channels,\n    opt_channel_names=[\"Forward Scatter\", \"Side Scatter\", \"FITC\", \"PE\", \"Time\"],\n    metadata={\"$SRC\": \"Python pipeline\", \"$DATE\": \"17-FEB-2026\", \"$CYT\": \"Synthetic\"},\n)\n# Output: FCS 3.1, single-precision float\n```\n\n### 4. Multi-Dataset FCS Files\n\nHandle FCS files containing multiple datasets.\n\n```python\nfrom flowio import FlowData, read_multiple_data_sets, MultipleDataSetsError\n\n# Detect multi-dataset files\ntry:\n    flow = FlowData(\"sample.fcs\")\nexcept MultipleDataSetsError:\n    datasets = read_multiple_data_sets(\"sample.fcs\")\n    print(f\"Found {len(datasets)} datasets\")\n    for i, ds in enumerate(datasets):\n        print(f\"Dataset {i}: {ds.event_count} events, {ds.channel_count} channels\")\n        events = ds.as_array()\n\n# Read specific dataset by offset\nfirst = FlowData(\"multi.fcs\", nextdata_offset=0)\nnext_offset = int(first.text.get(\"$NEXTDATA\", \"0\"))\nif next_offset > 0:\n    second = FlowData(\"multi.fcs\", nextdata_offset=next_offset)\n```\n\n### 5. Modifying and Re-Exporting\n\nRead, modify, and save FCS data.\n\n```python\nfrom flowio import FlowData, create_fcs\n\n# Read original\nflow = FlowData(\"original.fcs\")\nevents = flow.as_array(preprocess=False)  # Use raw for modification\n\n# Filter events (e.g., threshold on FSC)\nmask = events[:, 0] > 500\nfiltered = events[mask]\nprint(f\"Before: {len(events)}, After: {len(filtered)}\")\n\n# Save filtered data as new FCS\ncreate_fcs(\n    \"filtered.fcs\",\n    filtered,\n    flow.pnn_labels,\n    opt_channel_names=flow.pns_labels,\n    metadata={**flow.text, \"$SRC\": \"Filtered\"},\n)\n\n# Or write with updated metadata (no event modification)\nflow.write_fcs(\"updated.fcs\", metadata={\"$SRC\": \"Updated\"})\n```\n\n## Key Concepts\n\n### FCS File Structure\n\nFCS files consist of four segments:\n\n| Segment | Content | FlowData attribute |\n|---------|---------|-------------------|\n| HEADER | Version, byte offsets | `flow.header` |\n| TEXT | Key-value metadata (`$DATE`, `$CYT`, channel names) | `flow.text` |\n| DATA | Event data (binary\u002Ffloat) | `flow.events` (bytes), `flow.as_array()` |\n| ANALYSIS | Optional processed results | `flow.analysis` |\n\n### Preprocessing (as_array)\n\nWhen `preprocess=True` (default), FlowIO applies:\n1. **Gain scaling**: Multiply by PnG gain values\n2. **Log transform**: Apply PnE exponential transform if present (`value = a × 10^(b × raw)`)\n3. **Time scaling**: Convert time channel to proper units\n\nUse `preprocess=False` when you need raw values for modification or custom transforms.\n\n## Common Workflows\n\n### Workflow: Batch FCS Summary\n\n```python\nfrom pathlib import Path\nfrom flowio import FlowData\nimport pandas as pd\n\nfcs_files = list(Path(\"data\u002F\").glob(\"*.fcs\"))\nsummaries = []\nfor f in fcs_files:\n    try:\n        flow = FlowData(str(f), only_text=True)\n        summaries.append({\n            \"file\": f.name, \"version\": flow.version,\n            \"events\": flow.event_count, \"channels\": flow.channel_count,\n            \"date\": flow.text.get(\"$DATE\", \"N\u002FA\"),\n        })\n    except Exception as e:\n        print(f\"Error: {f.name}: {e}\")\n\ndf = pd.DataFrame(summaries)\nprint(df)\n```\n\n### Workflow: FCS to DataFrame with Channel Statistics\n\n```python\nfrom flowio import FlowData\nimport pandas as pd\nimport numpy as np\n\nflow = FlowData(\"sample.fcs\")\ndf = pd.DataFrame(flow.as_array(), columns=flow.pnn_labels)\n\n# Per-channel statistics\nfor col in df.columns:\n    print(f\"{col}: mean={df[col].mean():.1f}, median={df[col].median():.1f}, std={df[col].std():.1f}\")\n\n# Export\ndf.to_csv(\"output.csv\", index=False)\nprint(f\"Exported {len(df)} events, {len(df.columns)} channels\")\n```\n\n## Key Parameters\n\n| Parameter | Function | Default | Options | Effect |\n|-----------|----------|---------|---------|--------|\n| `preprocess` | `as_array()` | `True` | `True`\u002F`False` | Apply gain\u002Flog scaling |\n| `only_text` | `FlowData()` | `False` | `True`\u002F`False` | Skip DATA segment (metadata only) |\n| `ignore_offset_discrepancy` | `FlowData()` | `False` | `True`\u002F`False` | Tolerate HEADER\u002FTEXT offset mismatch |\n| `use_header_offsets` | `FlowData()` | `False` | `True`\u002F`False` | Prefer HEADER over TEXT offsets |\n| `ignore_offset_error` | `FlowData()` | `False` | `True`\u002F`False` | Skip all offset validation |\n| `null_channel_list` | `FlowData()` | `None` | List of names | Exclude channels during parsing |\n| `nextdata_offset` | `FlowData()` | `None` | byte offset | Read specific dataset in multi-dataset files |\n| `opt_channel_names` | `create_fcs()` | `None` | List of names | Descriptive channel names (PnS) |\n| `metadata` | `create_fcs()` | `None` | Dict | Custom TEXT segment key-value pairs |\n\n## Best Practices\n\n1. **Use `only_text=True` for metadata scanning**: When processing many files, skip DATA segment parsing for 10-100x speedup.\n\n2. **Use `preprocess=False` for data modification**: Always work with raw values when filtering\u002Fmodifying events, then re-export. Preprocessing is irreversible.\n\n3. **Anti-pattern — modifying `flow.events` directly**: FlowIO does not support in-place event modification. Extract with `as_array()`, modify, then `create_fcs()` to save.\n\n4. **Preserve metadata on re-export**: Pass `flow.text` as metadata to `create_fcs()` to retain original acquisition info.\n\n5. **Check for multi-dataset files**: Catch `MultipleDataSetsError` and use `read_multiple_data_sets()` — some instruments write multiple acquisitions into one file.\n\n## Common Recipes\n\n### Recipe: Extract Fluorescence Channels Only\n\n```python\nfrom flowio import FlowData\nimport numpy as np\n\nflow = FlowData(\"sample.fcs\")\nevents = flow.as_array()\nfluoro = events[:, flow.fluoro_indices]\nnames = [flow.pnn_labels[i] for i in flow.fluoro_indices]\nprint(f\"Fluorescence channels: {names}, shape: {fluoro.shape}\")\n```\n\n### Recipe: File Inspection Report\n\n```python\nfrom flowio import FlowData\n\nflow = FlowData(\"unknown.fcs\")\nprint(f\"Version: {flow.version} | Events: {flow.event_count:,} | Channels: {flow.channel_count}\")\nfor i, (pnn, pns) in enumerate(zip(flow.pnn_labels, flow.pns_labels)):\n    ctype = \"scatter\" if i in flow.scatter_indices else \"fluoro\" if i in flow.fluoro_indices else \"time\" if i == flow.time_index else \"other\"\n    print(f\"  [{i}] {pnn:10s} | {pns:30s} | {ctype}\")\nfor key in [\"$DATE\", \"$CYT\", \"$INST\", \"$SRC\"]:\n    print(f\"  {key}: {flow.text.get(key, 'N\u002FA')}\")\n```\n\n### Recipe: Normalize Events to [0, 1] Range\n\nWhen to use: Prepare fluorescence channels for machine learning or cross-sample comparison.\n\n```python\nfrom flowio import FlowData\nimport numpy as np\n\nflow = FlowData(\"sample.fcs\")\nevents = flow.as_array()\n\n# Normalize each fluorescence channel to [0, 1]\nfluoro_idx = flow.fluoro_indices\nfluoro = events[:, fluoro_idx]\npnr = np.array(flow.pnr_values)[fluoro_idx]  # Per-channel max range\nnormalized = fluoro \u002F pnr\nprint(f\"Normalized shape: {normalized.shape}, range: [{normalized.min():.3f}, {normalized.max():.3f}]\")\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `DataOffsetDiscrepancyError` | HEADER\u002FTEXT offset mismatch | Use `ignore_offset_discrepancy=True` |\n| `MultipleDataSetsError` | File contains multiple datasets | Use `read_multiple_data_sets()` instead |\n| `FCSParsingError` | Corrupt or non-standard FCS file | Try `ignore_offset_error=True`; verify file is valid FCS |\n| Out of memory on large files | Millions of events loaded at once | Use `only_text=True` for metadata; process in chunks by channel |\n| Unexpected channel count | Null\u002Fpadding channels in file | Use `null_channel_list=[\"Time\", \"Null\"]` to exclude |\n| Modified data has wrong values | Applied preprocessing before modification | Use `preprocess=False` for raw data when modifying events |\n| Channel names missing (empty PnS) | Instrument didn't set descriptive names | Use `pnn_labels` (short names) instead; PnS is optional in FCS spec |\n\n## Related Skills\n\n- **matplotlib-scientific-plotting** — create scatter plots, density plots, and histograms from extracted cytometry data\n- **scikit-learn-machine-learning** — clustering and dimensionality reduction on cytometry event data\n\n## References\n\n- [FlowIO documentation](https:\u002F\u002Fgithub.com\u002Fwhitews\u002FFlowIO) — official GitHub repository and API\n- [FCS file format specification](https:\u002F\u002Fwww.isac-net.org\u002Fpage\u002FData-Standards) — ISAC data standards for flow cytometry\n- Spidlen et al. (2010) \"Data File Standard for Flow Cytometry, Version FCS 3.1\" — Cytometry Part A\n","# FlowIO — Flow Cytometry File Handler\n\n## Overview\n\nFlowIO is a lightweight Python library for reading and writing Flow Cytometry Standard (FCS) files. It parses FCS metadata, extracts event data as NumPy arrays, and creates new FCS files. Supports FCS versions 2.0, 3.0, and 3.1. Minimal dependencies — ideal for data pipelines and preprocessing before advanced analysis.\n\n## When to Use\n\n- Parsing FCS files to extract event data as NumPy arrays\n- Reading channel metadata (names, ranges, types) from FCS files\n- Converting flow cytometry data to pandas DataFrames or CSV\n- Creating new FCS files from NumPy arrays or processed data\n- Handling multi-dataset FCS files (separating combined datasets)\n- Batch processing directories of FCS files\n- Preprocessing flow cytometry data before downstream analysis\n- For **compensation, gating, and FlowJo workspace support**, use FlowKit instead\n- For **advanced cytometry visualization** (density plots, gating plots), use matplotlib or plotly\n\n## Prerequisites\n\n```bash\npip install flowio numpy pandas\n```\n\nRequires Python 3.9+. No compiled dependencies — installs on any platform.\n\n## Quick Start\n\n```python\nfrom flowio import FlowData\n\nflow = FlowData(\"experiment.fcs\")\nprint(f\"Events: {flow.event_count}, Channels: {flow.channel_count}\")\nprint(f\"Channels: {flow.pnn_labels}\")\n\nevents = flow.as_array()  # Shape: (n_events, n_channels)\nprint(f\"Data shape: {events.shape}\")\n```\n\n## Core API\n\n### 1. Reading FCS Files\n\nThe `FlowData` class is the primary interface for reading FCS files.\n\n```python\nfrom flowio import FlowData\n\n# Standard reading\nflow = FlowData(\"sample.fcs\")\nprint(f\"Version: {flow.version}\")          # '3.0', '3.1', etc.\nprint(f\"Events: {flow.event_count}\")\nprint(f\"Channels: {flow.channel_count}\")\n\n# Event data\nevents = flow.as_array()                   # Preprocessed (gain, log scaling)\nraw = flow.as_array(preprocess=False)      # Raw values\nprint(f\"Shape: {events.shape}\")            # (n_events, n_channels)\n\n# Memory-efficient: metadata only (skip DATA segment)\nflow_meta = FlowData(\"sample.fcs\", only_text=True)\nprint(f\"Instrument: {flow_meta.text.get('$CYT', 'Unknown')}\")\n\n# Handle problematic files\nflow = FlowData(\"bad.fcs\", ignore_offset_discrepancy=True)\nflow = FlowData(\"bad.fcs\", use_header_offsets=True)\n\n# Exclude null channels\nflow = FlowData(\"sample.fcs\", null_channel_list=[\"Time\", \"Null\"])\n```\n\n### 2. Channel Metadata\n\nExtract channel names, types, and ranges from FCS files.\n\n```python\nflow = FlowData(\"sample.fcs\")\n\n# Channel names\npnn = flow.pnn_labels   # Short names: ['FSC-A', 'SSC-A', 'FL1-A', ...]\npns = flow.pns_labels   # Descriptive: ['Forward Scatter', 'Side Scatter', 'FITC', ...]\npnr = flow.pnr_values   # Range\u002Fmax values per channel\n\n# Channel type indices\nscatter_idx = flow.scatter_indices   # [0, 1] — FSC, SSC\nfluoro_idx = flow.fluoro_indices     # [2, 3, 4] — fluorescence channels\ntime_idx = flow.time_index           # Time channel index (or None)\n\n# Access by type\nevents = flow.as_array()\nscatter_data = events[:, scatter_idx]\nfluoro_data = events[:, fluoro_idx]\n\n# Full metadata (TEXT segment dictionary)\ntext = flow.text\nprint(f\"Date: {text.get('$DATE', 'N\u002FA')}\")\nprint(f\"Instrument: {text.get('$CYT', 'N\u002FA')}\")\n```\n\n### 3. Creating FCS Files\n\nGenerate new FCS files from NumPy arrays.\n\n```python\nimport numpy as np\nfrom flowio import create_fcs\n\n# Basic creation\nevents = np.random.rand(10000, 5) * 1000\nchannels = [\"FSC-A\", \"SSC-A\", \"FL1-A\", \"FL2-A\", \"Time\"]\ncreate_fcs(\"output.fcs\", events, channels)\n\n# With descriptive names and metadata\ncreate_fcs(\n    \"output.fcs\",\n    events,\n    channels,\n    opt_channel_names=[\"Forward Scatter\", \"Side Scatter\", \"FITC\", \"PE\", \"Time\"],\n    metadata={\"$SRC\": \"Python pipeline\", \"$DATE\": \"17-FEB-2026\", \"$CYT\": \"Synthetic\"},\n)\n# Output: FCS 3.1, single-precision float\n```\n\n### 4. Multi-Dataset FCS Files\n\nHandle FCS files containing multiple datasets.\n\n```python\nfrom flowio import FlowData, read_multiple_data_sets, MultipleDataSetsError\n\n# Detect multi-dataset files\ntry:\n    flow = FlowData(\"sample.fcs\")\nexcept MultipleDataSetsError:\n    datasets = read_multiple_data_sets(\"sample.fcs\")\n    print(f\"Found {len(datasets)} datasets\")\n    for i, ds in enumerate(datasets):\n        print(f\"Dataset {i}: {ds.event_count} events, {ds.channel_count} channels\")\n        events = ds.as_array()\n\n# Read specific dataset by offset\nfirst = FlowData(\"multi.fcs\", nextdata_offset=0)\nnext_offset = int(first.text.get(\"$NEXTDATA\", \"0\"))\nif next_offset > 0:\n    second = FlowData(\"multi.fcs\", nextdata_offset=next_offset)\n```\n\n### 5. Modifying and Re-Exporting\n\nRead, modify, and save FCS data.\n\n```python\nfrom flowio import FlowData, create_fcs\n\n# Read original\nflow = FlowData(\"original.fcs\")\nevents = flow.as_array(preprocess=False)  # Use raw for modification\n\n# Filter events (e.g., threshold on FSC)\nmask = events[:, 0] > 500\nfiltered = events[mask]\nprint(f\"Before: {len(events)}, After: {len(filtered)}\")\n\n# Save filtered data as new FCS\ncreate_fcs(\n    \"filtered.fcs\",\n    filtered,\n    flow.pnn_labels,\n    opt_channel_names=flow.pns_labels,\n    metadata={**flow.text, \"$SRC\": \"Filtered\"},\n)\n\n# Or write with updated metadata (no event modification)\nflow.write_fcs(\"updated.fcs\", metadata={\"$SRC\": \"Updated\"})\n```\n\n## Key Concepts\n\n### FCS File Structure\n\nFCS files consist of four segments:\n\n| Segment | Content | FlowData attribute |\n|---------|---------|-------------------|\n| HEADER | Version, byte offsets | `flow.header` |\n| TEXT | Key-value metadata (`$DATE`, `$CYT`, channel names) | `flow.text` |\n| DATA | Event data (binary\u002Ffloat) | `flow.events` (bytes), `flow.as_array()` |\n| ANALYSIS | Optional processed results | `flow.analysis` |\n\n### Preprocessing (as_array)\n\nWhen `preprocess=True` (default), FlowIO applies:\n1. **Gain scaling**: Multiply by PnG gain values\n2. **Log transform**: Apply PnE exponential transform if present (`value = a × 10^(b × raw)`)\n3. **Time scaling**: Convert time channel to proper units\n\nUse `preprocess=False` when you need raw values for modification or custom transforms.\n\n## Common Workflows\n\n### Workflow: Batch FCS Summary\n\n```python\nfrom pathlib import Path\nfrom flowio import FlowData\nimport pandas as pd\n\nfcs_files = list(Path(\"data\u002F\").glob(\"*.fcs\"))\nsummaries = []\nfor f in fcs_files:\n    try:\n        flow = FlowData(str(f), only_text=True)\n        summaries.append({\n            \"file\": f.name, \"version\": flow.version,\n            \"events\": flow.event_count, \"channels\": flow.channel_count,\n            \"date\": flow.text.get(\"$DATE\", \"N\u002FA\"),\n        })\n    except Exception as e:\n        print(f\"Error: {f.name}: {e}\")\n\ndf = pd.DataFrame(summaries)\nprint(df)\n```\n\n### Workflow: FCS to DataFrame with Channel Statistics\n\n```python\nfrom flowio import FlowData\nimport pandas as pd\nimport numpy as np\n\nflow = FlowData(\"sample.fcs\")\ndf = pd.DataFrame(flow.as_array(), columns=flow.pnn_labels)\n\n# Per-channel statistics\nfor col in df.columns:\n    print(f\"{col}: mean={df[col].mean():.1f}, median={df[col].median():.1f}, std={df[col].std():.1f}\")\n\n# Export\ndf.to_csv(\"output.csv\", index=False)\nprint(f\"Exported {len(df)} events, {len(df.columns)} channels\")\n```\n\n## Key Parameters\n\n| Parameter | Function | Default | Options | Effect |\n|-----------|----------|---------|---------|--------|\n| `preprocess` | `as_array()` | `True` | `True`\u002F`False` | Apply gain\u002Flog scaling |\n| `only_text` | `FlowData()` | `False` | `True`\u002F`False` | Skip DATA segment (metadata only) |\n| `ignore_offset_discrepancy` | `FlowData()` | `False` | `True`\u002F`False` | Tolerate HEADER\u002FTEXT offset mismatch |\n| `use_header_offsets` | `FlowData()` | `False` | `True`\u002F`False` | Prefer HEADER over TEXT offsets |\n| `ignore_offset_error` | `FlowData()` | `False` | `True`\u002F`False` | Skip all offset validation |\n| `null_channel_list` | `FlowData()` | `None` | List of names | Exclude channels during parsing |\n| `nextdata_offset` | `FlowData()` | `None` | byte offset | Read specific dataset in multi-dataset files |\n| `opt_channel_names` | `create_fcs()` | `None` | List of names | Descriptive channel names (PnS) |\n| `metadata` | `create_fcs()` | `None` | Dict | Custom TEXT segment key-value pairs |\n\n## Best Practices\n\n1. **Use `only_text=True` for metadata scanning**: When processing many files, skip DATA segment parsing for 10-100x speedup.\n\n2. **Use `preprocess=False` for data modification**: Always work with raw values when filtering\u002Fmodifying events, then re-export. Preprocessing is irreversible.\n\n3. **Anti-pattern — modifying `flow.events` directly**: FlowIO does not support in-place event modification. Extract with `as_array()`, modify, then `create_fcs()` to save.\n\n4. **Preserve metadata on re-export**: Pass `flow.text` as metadata to `create_fcs()` to retain original acquisition info.\n\n5. **Check for multi-dataset files**: Catch `MultipleDataSetsError` and use `read_multiple_data_sets()` — some instruments write multiple acquisitions into one file.\n\n## Common Recipes\n\n### Recipe: Extract Fluorescence Channels Only\n\n```python\nfrom flowio import FlowData\nimport numpy as np\n\nflow = FlowData(\"sample.fcs\")\nevents = flow.as_array()\nfluoro = events[:, flow.fluoro_indices]\nnames = [flow.pnn_labels[i] for i in flow.fluoro_indices]\nprint(f\"Fluorescence channels: {names}, shape: {fluoro.shape}\")\n```\n\n### Recipe: File Inspection Report\n\n```python\nfrom flowio import FlowData\n\nflow = FlowData(\"unknown.fcs\")\nprint(f\"Version: {flow.version} | Events: {flow.event_count:,} | Channels: {flow.channel_count}\")\nfor i, (pnn, pns) in enumerate(zip(flow.pnn_labels, flow.pns_labels)):\n    ctype = \"scatter\" if i in flow.scatter_indices else \"fluoro\" if i in flow.fluoro_indices else \"time\" if i == flow.time_index else \"other\"\n    print(f\"  [{i}] {pnn:10s} | {pns:30s} | {ctype}\")\nfor key in [\"$DATE\", \"$CYT\", \"$INST\", \"$SRC\"]:\n    print(f\"  {key}: {flow.text.get(key, 'N\u002FA')}\")\n```\n\n### Recipe: Normalize Events to [0, 1] Range\n\nWhen to use: Prepare fluorescence channels for machine learning or cross-sample comparison.\n\n```python\nfrom flowio import FlowData\nimport numpy as np\n\nflow = FlowData(\"sample.fcs\")\nevents = flow.as_array()\n\n# Normalize each fluorescence channel to [0, 1]\nfluoro_idx = flow.fluoro_indices\nfluoro = events[:, fluoro_idx]\npnr = np.array(flow.pnr_values)[fluoro_idx]  # Per-channel max range\nnormalized = fluoro \u002F pnr\nprint(f\"Normalized shape: {normalized.shape}, range: [{normalized.min():.3f}, {normalized.max():.3f}]\")\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| `DataOffsetDiscrepancyError` | HEADER\u002FTEXT offset mismatch | Use `ignore_offset_discrepancy=True` |\n| `MultipleDataSetsError` | File contains multiple datasets | Use `read_multiple_data_sets()` instead |\n| `FCSParsingError` | Corrupt or non-standard FCS file | Try `ignore_offset_error=True`; verify file is valid FCS |\n| Out of memory on large files | Millions of events loaded at once | Use `only_text=True` for metadata; process in chunks by channel |\n| Unexpected channel count | Null\u002Fpadding channels in file | Use `null_channel_list=[\"Time\", \"Null\"]` to exclude |\n| Modified data has wrong values | Applied preprocessing before modification | Use `preprocess=False` for raw data when modifying events |\n| Channel names missing (empty PnS) | Instrument didn't set descriptive names | Use `pnn_labels` (short names) instead; PnS is optional in FCS spec |\n\n## Related Skills\n\n- **matplotlib-scientific-plotting** — create scatter plots, density plots, and histograms from extracted cytometry data\n- **scikit-learn-machine-learning** — clustering and dimensionality reduction on cytometry event data\n\n## References\n\n- [FlowIO documentation](https:\u002F\u002Fgithub.com\u002Fwhitews\u002FFlowIO) — official GitHub repository and API\n- [FCS file format specification](https:\u002F\u002Fwww.isac-net.org\u002Fpage\u002FData-Standards) — ISAC data standards for flow cytometry\n- Spidlen et al. (2010) \"Data File Standard for Flow Cytometry, Version FCS 3.1\" — Cytometry Part A\n",{"name":5,"license":15,"description":7},"master","63f17866001c5ca854bf2fa0b678ce277133de5b","skills\u002Fawesome-skills\u002Fflowio-flow-cytometry",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill flowio-flow-cytometry",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill flowio-flow-cytometry",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill flowio-flow-cytometry","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fflowio-flow-cytometry\u002FSKILL.md",true,[],[49,58,65,72,79,86],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":57},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":57},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":57},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":57},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":57},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":57},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]