{"id":16485354,"url":"https://github.com/morganconrad/fcs","last_synced_at":"2025-03-21T07:31:05.650Z","repository":{"id":57233782,"uuid":"14265479","full_name":"MorganConrad/fcs","owner":"MorganConrad","description":"Javascript / node.js code to read FCS flow cytometry data","archived":false,"fork":false,"pushed_at":"2023-06-19T22:22:23.000Z","size":862,"stargazers_count":17,"open_issues_count":2,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-26T09:41:24.469Z","etag":null,"topics":["fcs","flow-cytometry","javascript","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MorganConrad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-11-09T21:32:11.000Z","updated_at":"2023-06-05T19:49:48.000Z","dependencies_parsed_at":"2022-08-31T14:11:40.512Z","dependency_job_id":"6d4e295f-65e8-4911-85e5-e1361f3207eb","html_url":"https://github.com/MorganConrad/fcs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffcs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffcs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffcs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Ffcs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MorganConrad","download_url":"https://codeload.github.com/MorganConrad/fcs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244119802,"owners_count":20401052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fcs","flow-cytometry","javascript","nodejs"],"created_at":"2024-10-11T13:25:32.831Z","updated_at":"2025-03-21T07:31:05.078Z","avatar_url":"https://github.com/MorganConrad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/MorganConrad/fcs.png)](http://travis-ci.org/MorganConrad/fcs)\n[![License](http://img.shields.io/badge/license-MIT-A31F34.svg)](https://github.com/MorganConrad/fcs)\n[![NPM Downloads](http://img.shields.io/npm/dm/fcs.svg)](https://www.npmjs.org/package/fcs)\n[![Known Vulnerabilities](https://snyk.io/test/npm/fcs/badge.svg)](https://snyk.io/test/npm/fcs)\n[![Coverage Status](https://coveralls.io/repos/github/MorganConrad/fcs/badge.svg)](https://coveralls.io/github/MorganConrad/fcs)\n\n# fcs\n\nJavascript / node.js code to read FCS flow cytometry data.  Will read all of the HEADER, TEXT, and ANALYSIS segments into key/value pairs.  Reads raw (likely uncompensated) data as well, either into numeric arrays for further analysis, or as Strings for quickly scanning the data.\n\n## basic usage\n\n1. Get the FCS file into a Buffer\n2. Create a new FCS(theBuffer, options)\n\ne.g. to read from a file asynchronously\n\n```javascript\n    var FCS = require('fcs');\n    FS.readFile(filename, function(err, databuf) {\n        if (err) {\n            console.error(err);\n            }\n            else {\n           var fcs = new FCS(options, databuf);\n           // do something with fcs\n            }\n   });\n```\n\n### see fcscli.js or fcshttp.js in the examples folder for usage examples\n\n## options (default in bold)\n\n* dataFormat:   'asNumber', '**asString**', 'asBoth', or 'asNone'\n* groupBy:       '**byEvent**', 'byParameter'\n* decimalsToPrint: **2**\n* eventsToRead:    **1000**   // an integer, -1 means \"all events\"\n* maxPerLine:      **10**\n* eventSkip:   **0**  if eventsToRead is less than the events in the file, this allows you to more randomly sample.  A value of 'true' has them equally distributed.  0 means read the first events from the file.\n\nAny additional options are ignored, but will be printed under a \"meta\" segment in the JSON.  For example, you might want to include a date, your laboratory, etc...\n\n# api\n\n## creational\n\n### var myFCS = new FCS(options, buffer)\nConstructor.  Both arguments are optional.\nIf buffer is present it will be read, otherwise you need to call **readBuffer()** or **readStreamAsync()** later\n\n### myFCS.options(options)\nSet or add options.\n\n### myFCS.readBuffer(buffer, moreOptions)\nRead data from buffer.  moreOptions are optional.  Hopefully by now you've set them all! :-)\n\n### myFCS.readStreamAsync(readStream, moreOptions, callback)\nReads data asynchronously from a readStream.  moreOptions is optional.  When complete, calls `callback(err, fcs)`.\n\n### myFCS.prepareWriteableStream(callback, readableStream)\nThe readableStream arg is optional.  Creates a writeableStream ready to parse an FCS format file.  e.g.\n\n    var fws = fcs.prepareWriteableStream(callback, readableStream);\n    readableStream.pipe(fws);\n\nWhen piping is complete, will call `callback(err, fcs)`.\n\n## retrieving the data\n\n### get(segment, keywords...)\nsegment should be one of  ('text', 'analysis', or, more rarely, 'header', 'meta').\nIf no keywords are provided, returns that entire segment\notherwise, returns a single value, stopping at the first match to the keyword.\nReturns null if none were found.\n\n### getText(keywords...)\nEquivalent to get('text', keywords)\n  *e.g.* `text('$P3N') might return 'FL1-H'\n\n### get$PnX(x)\nReturn an array of all N keywords for that P.X combination.  The 0th value will be empty.\n  *e.g.* `get$PnX('N') might return ['', 'FSC, 'SSC', 'FL1-H', ...]\n\n### getAnalysis(keyword, additionalKeywords...)\nEquivalent to get('analysis', keywords)\n\n### getNumericData(oneBasedIndex)\nReturns an array of Numbers for the respective event or parameter, iff you requested numeric data.\n\n### getStringData(oneBasedIndex)\nReturns an array of Strings for the respective event or parameter, iff you requested string data.\n\n### getOnly(onlys)\nReturns a subset of the JSON, based upon onlys, an array of dot delimited Strings\n  *e.g.* getOnlys(['meta','text.$P1N') would return all of meta, plus parameter 1 name\n\n## fields\n\n### .header\n  Holds the HEADER segment (first 256 bytes).  The version is header.FCSVersion\n\n### .text\n  Holds all the TEXT segment\n\n### .analysis\n  Holds all the ANALYSIS segment.  If none, is an empty object {}\n\n### .meta\n  Holds all the options, plus a bit more\n\n## Todos and Gotchas [official bugs here](https://github.com/MorganConrad/fcs/issues)\n\n - doesn't handle $BEGINSTEXT, $ENDSTEXT\n - could do more with Millipore's XML ANALYSIS\n\n## Changelog\n\n - v0.1.0  17 Nov 2018 partly converted to use ES6 features\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Ffcs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorganconrad%2Ffcs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Ffcs/lists"}