npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@amazyyy/fcs

v0.2.2

Published

Flow Cytometry Standard (FCS) file reader that works with IE<=8

Downloads

8

Readme

Build Status License NPM Downloads Known Vulnerabilities Coverage Status

fcs

Javascript / 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.

basic usage

  1. Get the FCS file into a Buffer
  2. Create a new FCS(theBuffer, options)

e.g. to read from a file asynchronously

    var FCS = require('fcs');
    FS.readFile(filename, function(err, databuf) {
        if (err) {
            console.error(err);
            }
            else {
           var fcs = new FCS(options, databuf);
           // do something with fcs
            }
   });

see fcscli.js or fcshttp.js in the examples folder for usage examples

options (default in bold)

  • dataFormat: 'asNumber', 'asString', 'asBoth', or 'asNone'
  • groupBy: 'byEvent', 'byParameter'
  • decimalsToPrint: 2
  • eventsToRead: 1000 // an integer, -1 means "all events"
  • maxPerLine: 10
  • 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.

Any 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...

api

creational

var myFCS = new FCS(options, buffer)

Constructor. Both arguments are optional. If buffer is present it will be read, otherwise you need to call readBuffer() or readStreamAsync() later

myFCS.options(options)

Set or add options.

myFCS.readBuffer(buffer, moreOptions)

Read data from buffer. moreOptions are optional. Hopefully by now you've set them all! :-)

myFCS.readStreamAsync(readStream, moreOptions, callback)

Reads data asynchronously from a readStream. moreOptions is optional. When complete, calls callback(err, fcs).

myFCS.prepareWriteableStream(callback, readableStream)

The readableStream arg is optional. Creates a writeableStream ready to parse an FCS format file. e.g.

var fws = fcs.prepareWriteableStream(callback, readableStream);
readableStream.pipe(fws);

When piping is complete, will call callback(err, fcs).

retrieving the data

get(segment, keywords...)

segment should be one of ('text', 'analysis', or, more rarely, 'header', 'meta'). If no keywords are provided, returns that entire segment otherwise, returns a single value, stopping at the first match to the keyword. Returns null if none were found.

getText(keywords...)

Equivalent to get('text', keywords) e.g. `text('$P3N') might return 'FL1-H'

get$PnX(x)

Return an array of all N keywords for that P.X combination. The 0th value will be empty. e.g. `get$PnX('N') might return ['', 'FSC, 'SSC', 'FL1-H', ...]

getAnalysis(keyword, additionalKeywords...)

Equivalent to get('analysis', keywords)

getNumericData(oneBasedIndex)

Returns an array of Numbers for the respective event or parameter, iff you requested numeric data.

getStringData(oneBasedIndex)

Returns an array of Strings for the respective event or parameter, iff you requested string data.

getOnly(onlys)

Returns a subset of the JSON, based upon onlys, an array of dot delimited Strings e.g. getOnlys(['meta','text.$P1N') would return all of meta, plus parameter 1 name

fields

.header

Holds the HEADER segment (first 256 bytes). The version is header.FCSVersion

.text

Holds all the TEXT segment

.analysis

Holds all the ANALYSIS segment. If none, is an empty object {}

.meta

Holds all the options, plus a bit more

Todos and Gotchas official bugs here

  • doesn't handle $BEGINSTEXT, $ENDSTEXT
  • could do more with Millipore's XML ANALYSIS

Changelog

  • v0.1.0 17 Nov 2018 partly converted to use ES6 features