Giter VIP home page Giter VIP logo

flowspectrum's Introduction

flowSpectrum

An R package to produce full spectrum flow cytometry plots outside the acquisition software.

Author: Christopher Hall, Babraham Institute, UK

Babraham Institute Flow Cytometry Facility

Purpose

The purpose of this package is to produce full spectrum flow cytometry plots outside the acquisition software. There are three styles designed to roughly mimic the output styles of the Bigfoot, Aurora, and R Viridis. The package takes flowFrames and flowSets as produced using the flowCore package.

  • flowSpectrum wiil not work with the Sony SP6800 as it uses a proprietary format that flowCore can't read.

Usage

Quick start

spectralplot(ff)

More information

Load data into R using flowCore either via read.FCS(), read.flowSet(), or read.ncdfFlowSet.

Use the spectralplot() function, choose a style, and choose where to output the resulting image. The default (i.e. just spectralplot(ff)) will produce a viridis plot in the R session.

## install from Github using devtools (or remotes)
devtools::install_github('hally166/flowSpectrum')

## load the package
library(flowSpectrum)

## flowSpectrum has one demo file that can be loaded.  
ff<-read.FCS(system.file("extdata", "PE.fcs", package = "flowSpectrum"))

## create plots using spectralplot(). spectralpolt() will accept a flowFrame or a flowSet
spectralplot(ff, theme='viridis', save=FALSE, bins=512, normalize=FALSE, params=NULL, guessPop=FALSE, unstained=NULL)

PE spectrum

PE normalized spectrum

## if you want flowSpectrum to select only the positive spectrum use guessPop.  I advice using normalize = TRUE as it only selects 200 events.
ff<-read.FCS("C:/sample1.fcs)
ctrl_ff<-read.FCS("C:/unstained.fcs)
spectralplot(ff, normalize=TRUE, guessPop=TRUE, unstained=ctrl_ff)

The theme options are 'viridis', 'bigfoot', and 'aurora'.

The save options are TRUE and FALSE. TRUE will save a PNG into the working directory. FALSE will output to the R session.

Set then granularity of the plot using bins = [a number]. I use something between 256 and 512.

Normalize = TRUE will produce a normalized spectrum based on the max median intensity.

Specify which parameters to plot (in the order specified) using params = [a character vector of parameter names].

Use guessPop = TRUE and normalize = TRUE to select the positive events from a mixed control. Add a file to unstained.

Defaults are: theme='viridis', save=FALSE, bins=512, normalize=FALSE, params=NULL, guessPop=FALSE, unstained=NULL

To use the params argument you must supply a character vector (not a list). For example, to reorder to the same as the source file for the Aurora params <- grep("-W|-H|Time|SC",ff@parameters@data$name,value = TRUE, invert=TRUE)

flowspectrum's People

Contributors

hally166 avatar hrj21 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.