Transcript here

cytutorial
2015
You should use the mouse to click
on the slide and the buttons.
Don’t use the keyboard arrows!
* for Phenograph instructions check your cyt folder for a .ppt on meta-clustering.
Click or more information
Loading
Data
About
Data
Transformation
Getting
Started
Subsampling
Data
Visualize
Data
More Features:
Merge
Gates
Set
Difference
Compare
Maps
Clustering
Wanderlust
Open
Ended
Action
PCA
Create
Gates
ViSNE
About cyt
cyt
• cyt is an interactive open source tool for analyzing and
visualizing of cytof and flow data.
• It provides functionality such as gating, clustering,
dimensionality reduction and comparing expression
across samples.
• System requirements:
o MatLab 2010b or higher on Windows or Mac OS X.
o Parallel computing toolbox.
• For users in Mac OS X:
if Right-click doesn’t work use ‘Ctrl’+click.
Go
Back
Getting Started
Install cyt
•
Go to:
http://www.c2b2.columbia.edu/danapeerlab/html/cyt-download.html
•
Register and download the software.
•
Unzip “cyt.zip” to a folder of your choice.
The path should not contain spaces. For example:
/usr/myname/documents/MATLAB/cyt
•
You might wish to copy the FCS files (there are example FCS files
(data files) on the website on the cyt download page) to that
folder as well. Alternatively, you can load them into cyt from a
different folder.
Launch cyt
• Launch Matlab, and navigate to cyt’s folder.
• Right-click on cyt’s folder 
Add to Path 
Selected Folders and Subfolders.
• Run the script “run_cyt.m” by typing “cyt” on the
Commend Window or using the “Run” button
.
Loading Data
cyt file format
• cyt is using FCS file (Flow Cytometry Data File Format
Standards) as input and output.
• FCS files provides the specifications needed to
completely describe Flow and Mass Cytometry
data sets within the confines of the file containing
the experimental data.
• The premise of cyt is that the FCS file that the user
insert is legal.
Loading data to cyt
• In the “Gates” panel, you can load and export FCS
files, rearrange the order of FCS files and gates,
remove gates, and transform the data using
hyperbolic arcsin (
).
• Click the load button (
) to load a FCS file.
Loading data to cyt
• Click on a file’s name and click “Add” to add it to
the selected items list.
Loading data to cyt
• Click “Done” and the file will be loaded.
Go
Back
cyt Main Screen
• You will be greeted by the following:
Go
Back
Data
Transformation
Transformation of data
• A first (OPTIONAL) step when working with CyTOF
data is to transform it using hyperbolic arcsin.
• Choose the wanted gate, click the graph icon (
)
at the top left or right click on the gate and choose
“Transform”.
Transformation of data
• Select the the CyTOF channels.
• You can uncheck the viSNE
channels
(if
necessary)
by
pressing Ctrl and clicking on the
channel names.
• Next, press ‘OK’ and the data
will be transformed.
Go
Back
Subsample Data
Subsampling Massive Data
• It is possible to create subsamples of the Cytof data.
• You can do that in case the data is too big and it is
a limiting factor for running different features.
• The subsampling is random.
• You can find out the size of your sample on the
bottom right of screen.
Subsampling Massive Data
• Choose the wanted gate for subsampling by right
click on it and choosing “Subsample”.
Subsampling Massive Data
• Choose the size of the sample and click “OK”:
• Enter a name for the new gate being created and
click “OK”:
• The new gate will show up in the “Gates” panel.
Go
Back
Visualize Data
Visualizing of data
• You can now visualize intensities of one channel
over another (for example visualize CD20 over viSNE
channels).
• Choosing the wanted gate from the ‘Gates’ panel
and channel fro, the ‘Channels’ panel.
Visualizing of data
• Choose one of the visualizing option to continue:
Histograms
Scatter
Plot
Plot
Histogram
By Gates
Plot
Plot
Along Time
Go
Back
Histogram Plot
• First, choose a gate then choose a channel.
• Select ‘Histogram’ from the combo box under the
channel list and click ‘Plot’:
Histogram Plot
• You can also choose more than one channel.
• Select ‘Histogram’ from the combo box under the
channel list and click ‘Plot’:
Histogram Plot
• If you choose couple of gates and then choosing a
channel or couple of channels, cyt will group the
data together if more than one gate is chosen.
Histogram By Gates Plot
• Choose a gate and then channel or couple of
channels.
• Select ‘Histogram by Gates’ from the combo box
under the channel list and click ‘Plot’.
Histogram By Gates Plot
• When you choose couple of gates and then
channel or couple of channels.
• Select ‘Histogram by Gates’ from the combo box
under the channel list and click ‘Plot’, you will see
different groups.
Scatter Plot
• When you choose two channels you can select
‘scatter’ from the combo box under the channel list
and click ‘Plot’:
Scatter Plot - Color
• You can now color code cells by channel intensities
by picking the channel under the ‘Color’ panel at
the bottom. For example, scroll down and pick
CD20:
Scatter Plot – Color Scale
• You can now change the ‘color scale’ by choosing
the minimum and the maximum range and pressing
‘Plot’ again:
Scatter Plot
• cyt allowing visualization of 3D data. Pick all three
channels that you wish to visualize and click Plot.
cyt will retain the CD20 color coding:
Scatter Plot
• Finally, you can rotate the 3D view using the rotate
tool from the top bar (the circular arrow).
Scatter Plot
• You can choose the axis range of the plot:
Scatter Plot– Log
• If you choose not to use transformation on the data
it is possible to do that manually and not
permanenty when visualizing the data.
• Click on the ‘Log’ check box:
Scatter Plot– Dots Size
• You can change the visualize size of the dots (cells):
Scatter Plot– Dots Size
• And then you will get:
Scatter Plot– Legend
• When you are using Scatter Plot on different gates
you can check the ‘Legend’ box to add the labels
of what gate does each dot belong:
Scatter Plot – KNN
• You can show the nearest neighbors by using the
‘KNN’ feature:
Scatter Plot – KNN
• Choose a K from the ‘KNN’ combo box:
Scatter Plot
• The K nearest neighbors will show up on the scatter
plot:
Plot Along Time
• When you choose a channel in a specific gate you
can select ‘Plot along time’ from the combo box
under the channel list and click ‘Plot’.
• Then, choose other channel to compare to, in the
‘X Axis’ panel.
Merge Gates
Merge Gates
• You can choose different gates from the ‘Gates’
panel, Right-click on one of them and selecting
‘Merge’.
Merge Gates
• Choose a new name for the new gate and click
‘OK’:
• The new merged gate will show up in the ‘Gates’
panel:
Go
Back
Set Difference
Set Difference of Gates
• The set difference GateA\GateB is defined by:
GateA \ GateB = {x : x ∈ GateA ∧ x ∉ GateB}
(x : x in A and x not in B)
• Choose 2 gates from ‘Gates’
panel, Right-click on them
and select ‘Set Difference’:
Set Difference of Gates
• Choose a new name for the new gate and click
‘OK’:
• The new “diffed” gate will show up in the ‘Gates’
panel:
Set Difference Example
sample
\
sample2
=
Go
Back
viSNE
viSNE
• New
high-dimensional,
single-cell
technologies
offer
unprecedented resolution in the analysis of heterogeneous
tissues.
• viSNE allows one to map high-dimensional cytometry data
onto two dimensions, yet conserve the high-dimensional
structure of the data. viSNE plots individual cells in a visual
similar to a scatter plot, while using all pairwise distances in
high dimension to determine each cell's location in the plot.
Dimensionality
reduction
viSNE
• To generate a viSNE map, select the set of channels
you would like to create the viSNE map for, from
‘Gates’ panel, and use Right-click to open the
context menu and select the ‘tSNE’ option’.
• Please wait for the two new
channels will show up at bottom
of the ‘Channels’ panel:
tSNE1 and tSNE2.
o (100k points takes approx. 5 min.)
viSNE
• To visualize the reduced dimension you can use the
‘Scatter Plot’.
• Reminder: Choose the
new channels, select
‘scatter’ from the combo
box under the channel
list and click ‘Plot’:
Go
Back
Wanderlust
Wanderlust
• A graph-based trajectory detection algorithm that receives
multi-parameter single-cell events as input and maps them
onto a one-dimensional developmental trajectory. Cells are
ordered along a trajectory that represents their most likely
placement along a developmental continuum.
Dimensionality
reduction
Wanderlust
• Use cyt for trajectory detection (i.e. find a progression
component).
• Choose a gate from ‘Gates’ panel, In the Channels list
box, select the set of channels
for whom you would like to
trace their progression and use
Right-click on a channel
and select ‘Wanderlust’.
• You will be greeted by a dialog
to select parameters.
Wanderlust
•
First, gate a small population of
cells that you would like wanderlust
to ‘start’ from (starting points).
These would be the ‘youngest’
cells
if
you
were
tracing
development along features.
•
Select
K\L
neighbors,
metric,
number of graphs and press ‘Run’.
•
Three new channels will show up at the bottom of the ‘Channels’ panel,
two temporary channels and Wanderlust output.
Visualizing Wanderlust
• In the ‘Channels’ listbox, select the channels you would like to
view along Wanderlust. Now select ‘Plot along time’ in the
combo box beneath the channel list and click ‘plot’. You will
see something like the following:
•
Select the Wanderlust
channel for ‘X Axis’.
‘Rank X’ sorts the values
in the Wanderlust
channels and ignores
the actual values or
distances between the
cells.
Go
Back
PCA
PCA
• Principal component analysis, is a statistical procedure that
uses an orthogonal transformation to convert a set of
observations of possibly correlated variables into a set of
values of linearly uncorrelated variables called principal
components. From Wikipedia, the free encyclopedia.
Dimensionality
reduction
PCA
• Choose a gate from ‘Gates’ panel, and wanted channels
from ‘Channels’ panel. Right-click on a channel and select
‘PCA’.
• Five new channels will show up at
the bottom of the ‘Channels’
panel, three temporary channels
and two PCA outputs.
PCA
• Choose the new PCA channels, select ‘Scatter’ from the
combo box under the channel list and click ‘Plot’:
Go
Back
Clustering
Clustering
• Is the task of grouping a set of objects in such a way
that objects in the same group (called a cluster) are
more similar (in some sense or another) to each
other than to those in other groups (clusters).
Wikipedia, the free encyclopedia.
• Choose an Algorithm:
From
Clustering
• Use can see an example of the different clusters
between those two algorithms:
Go
Back
K-Means
K-Means
• k-means clustering is a method of vector quantization,
originally from signal processing, that is popular for cluster
analysis in data mining. k-means clustering aims to partition n
observations into k clusters in which each observation belongs
to the cluster with the nearest mean, serving as a prototype of
the cluster. From Wikipedia, the free encyclopedia.
K-Means
• You can choose a gate from ‘Gates’ panel, and
wanted channels from ‘Channels’ panel. Right-click on
a channel and select ‘K-Means’.
K-Means
• Choose K, the number of clusters and
click ‘OK’:
• Couple of new channels will show up
at bottom of the ‘Channels’ panel, the
last on is the K-Means output.
K-Means
• To visualize K-means, you can choose a twodimensional scatter plot and use K-Means output as
the color in the ‘Color’ panel.
• For example:
K-Means
• You can add density by checking the ‘Density’
button:
EMGM
EMGM
• Expectation-Maximization (EM) algorithm is an iterative
method for finding maximum likelihood or maximum a
posteriori (MAP) estimates of parameters in statistical
models, where the model depends on unobserved
latent variables. From Wikipedia, the free encyclopedia.
• EMGM is a function tries to obtain the maximum
likelihood estimation of Gaussian mixture model by
expectation maximization (EM) algorithm.
EMGM
• There is couple of ways to use EMGM function. It works on
low and high dimensional data.
• You can choose a gate from ‘Gates’ panel, and
wanted channels from ‘Channels’ panel.
• Right-click on a channel
and select ‘EMGM’.
EMGM
• Choose K, the number of clusters and
click ‘OK’:
• Couple of new channels will show up
at bottom of the ‘Channels’ panel, the
last on is the EMGM output.
EMGM
• To visualize EMGM, you can choose a twodimensional scatter plot and use EMGM output as
the color in the ‘Color’ panel.
• For example:
EMGM
• You can add density by checking the ‘Density’
button:
Import
Channels
Import Channels
• This function allows you to add channels to the
data.
• It’s importing one Vector in a Matlab file (*.mat)
and adding it to the bottom of the ‘Channels’
panel.
• It is possible to make the new channel a new gate
in ‘Gate from Channel’.
Import Channels
• Right-click on one channel (it doesn’t matter which one)
and choose ‘Import Channel’.
• Open a MAY-file (*.mat) and press
‘Open’.
• A new channel will show up at the
bottom of the ‘Channels’ panel with the name
of the file that you choose.
Go
Back
Create Gate
Gate Creation
•
There a few ways to create new Gates:
Gate From
Channels
Slice To
Gates
Rectangular
Selection
Polygona
l
Selection
Go
Back
Gate From Channels
• You can choose a specific channel and creating a
new gate with value
changes on this channel.
• Select the ‘Gate from
Channel’ after Right-Clicking
on it.
Gate From Channels
• You can choose the new Value of the data and
press ‘Gate’.
Gate From Channels
• A new gate will show up in the ‘Gates’ panel.
• You can Right-Click and change the name of the
gate.
Slice To Gates
• Choose a gate from the ‘Gates’ panel.
• Choose a channel from the ‘Cannels’ panel that
you want to create new gates
from it.
• Right-click on the selected
channel and select ‘Slice to
Gates”.
Slice To Gates
• Choose the number of gates that you want to
create from the chosen channel.
• Choose the overlap of the data (0.5 is non-overlap).
• Press ‘Slice’.
Visualize Slice To Gates
• Choose the new gates, wanted channels for a
scatter plot and press ‘Plot’.
• In the ‘Color’ panel choose ‘Gates’.
Rectangular Selection
• Click the ‘gate by selecting a rectangular region
from plot’ button (
) on the top of the screen.
• Click and drag on the plot to create the
rectangular reign.
• Enter a new name
and press ‘OK’.
Polygonal Selection
• Click the ‘gate by selecting a polygonal region
from plot’ button (
) on the top of the screen.
• Click on the plot to create the polygonal reign.
• Double-click on the starting point to finish the
selection.
• Enter a new name
and press ‘OK’.
Comparing
Maps
Importing Data
Step 1
Performing transformation
and subsampling
Step 2
Creating
different
maps for
comparison
Step 3
Comparing maps
Right click on the specific gate
Choosing maps and clicking on “Compute”
Step 4
Comparing different maps
Step 5
Scatter plots
Comparing different maps
Step 5
Scatter plots
Comparing different maps
Step 5
Scatter plots
Comparing different maps
Step 5
Scatter plots
Comparing the same map
Step 5
Scatter plots
Comparing different maps
Scatter plot
Step 5
Comparing different maps
Scatter plot
Step 5
How does it work exactly
• For each two maps chosen by the user, the new function
calculates the q value of every two points (cells) in the map.
• The calculation performs for each index i, j. A qji is
computed using the Student-t distribution of the Euclidean
distance between the points in the following way:
• After calculating the q values, the function computes the
Jensen–Shannon divergence between them.
Go
Back
Open Ended
Action
Open Ended Action
• You can add your code to cyt.
• In cyt.m, look for the ‘openEndedAction’ function
and you can write your own code in this function.
• By Right-clicking on a gate from the ‘Gate’ panel
and selecting ‘Open ended action’, you can run
your code on the Cytof data.
Go
Back