Table of Contents |
---|
maxLevel | 2 |
---|
minLevel | 2 |
---|
exclude | Additional Assistance |
---|
|
Obtain and add files to the server
Prior to performing t-SNE, it is a good idea to reduce the dimensionality of the data using principal components analysis (PCA).
- Click the Filtered counts data node after the Filter features task
- Select PCA from the Exploratory analysis section of the task menu (Figure 1)
Numbered figure captions |
---|
SubtitleText | Select the PCA task from the Exploratory analysis menu |
---|
AnchorName | Select PCA task |
---|
|
Image Removed
|
- Click Finish to run PCA with default settings (Figure 2)
Note, the default settings include the Split by sample checkbox being selected. This means that the dimensionality reduction will be performed on each sample separately.
Numbered figure captions |
---|
SubtitleText | PCA task set up page with default settings |
---|
AnchorName | PCA task set up |
---|
|
Image Removed
|
PCA task and data nodes will be generated.
- Click the PCA data node
- Select t-SNE from the Exploratory analysis section of the task menu (Figure 3)
Numbered figure captions |
---|
SubtitleText | Invoking t-SNE from the task menu |
---|
AnchorName | Invoking t-SNE |
---|
|
Image Removed
|
- Click Finish from the t-SNE dialog to run t-SNE with the default settings (Figure 4)
Numbered figure captions |
---|
SubtitleText | t-SNE task set up with default settings |
---|
AnchorName | t-SNE task set up |
---|
|
Image Removed
|
Because the upstream PCA task was performed separately for each sample, the t-SNE task will also be performed separately for each sample. t-SNE task and data nodes will be generated (Figure 5).
Numbered figure captions |
---|
SubtitleText | t-SNE task node |
---|
AnchorName | t-SNE task node |
---|
|
Image Removed
|
Once the t-SNE task has completed, we can view the t-SNE plots
- Click the t-SNE node
- Click Task report from the task menu or double click the t-SNE node
The t-SNE will open in a new data viewer session. The t-SNE plot for the first sample in the data set, MGH36 (Figure 6), will open on the canvas. Please note that the appearance of the t-SNE plot may differ each time it is drawn so your t-SNE plots may look different than those shown in this tutorial. However, the cell-to-cell relationships indicated will be the same.
Numbered figure captions |
---|
SubtitleText | Viewing t-SNE plot of a single sample |
---|
AnchorName | Viewing single-sample t-SNE |
---|
|
Image Removed
|
The t-SNE plot is in 3D by default. To change the default, click your avatar in the top right > Settings > My Preferences and edit your graphics preferences and change the default scatter plot format from 3D to 2D.
You can rotate the 3D plot by left-clicking and dragging your mouse. You can zoom in and out using your mouse wheel. The 2D t-SNE is also calculated and you can switch between the 2D and 3D plots on the canvas. We will do this later on in the tutorial.
Each sample has its own plot. We can switch between samples.
- Open the Axes icon on the left under Configure (Figure 7)
- Navigate to Misc
- Select the
Image Removedicon below the Sample name to go to the next sample
The t-SNE plot has switched to show the next sample, MGH42 (Figure 7).
Numbered figure captions |
---|
SubtitleText | Viewing t-SNE plot of MGH42 |
---|
AnchorName | Viewing single-sample t-SNE (2) |
---|
|
Image Removed
|
The goal of this analysis is to compare malignant cells from two different glioma subtypes, astrocytoma and oligodendroglioma. To do this, we need to identify the malignant cells we want to include and which cells are the normal cells we want to exclude.
The t-SNE plot in Partek Flow offers several options for identifying, selecting, and classifying cells. In this tutorial, we will use the expression of known marker genes to identify cell types.
To visualize the expression of a marker gene, we can color cells on the t-SNE plot by their expression level.
- Select any of the count data nodes from Get data on the left (Single cell counts, or any of the Filtered counts, Figure 8)
- Search for the BCAN gene
- Click and drag the BCAN gene onto the plot and drop it over the Green (feature) option
Numbered figure captions |
---|
SubtitleText | Coloring cells by BCAN expression |
---|
AnchorName | Selecting gene |
---|
|
Image Removed
|
The cells will be colored from black to green based on their expression level of BCAN, with cells expressing higher levels more green (Figure 9). BCAN is highly expressed in glioma cells.
Numbered figure captions |
---|
SubtitleText | Cells colored by BCAN expression |
---|
AnchorName | Colored by CD14 |
---|
|
Image Removed
|
In Partek Flow, we can color cells by more than one gene. We will now add a second glioma marker gene, GPM6A.
- Select any of the count data nodes from the Data card on the left (Single cell counts, or any of the Filtered counts)
- Search for the GPM6A gene
- Click and drag the GPM6A gene onto the plot and drop it over the Red (feature) option
Cells expressing GPM6A are now colored red and cells expressing BCAN are colored green. Cells expressing both genes are colored yellow, while cells expressing neither are colored black (Figure 10).
Numbered figure captions |
---|
SubtitleText | Coloring cells by BCAN and GPM6A |
---|
AnchorName | Coloring by two genes |
---|
|
Image Removed
|
Numerical expression levels for each gene can be viewed for individual cells.
- Switch to pointer mode by clicking
Image Removed in the top right corner of the plot - Select a cell by pointing and clicking
The expression level for that cell is displayed on the legend for each gene. Expression values can also be viewed by mousing over a cell (Figure 11).
- Deselect the cell by clicking on any blank space on the plot
Numbered figure captions |
---|
SubtitleText | Viewing expression levels for an individual cell. The dots on the legend indicate the expression level of the selected cell. The expression levels also appear in the label when you mouse over a cell |
---|
AnchorName | Viewing expression levels for a cell |
---|
|
Image Removed
|
Now that cells are colored by the expression of two glioma cell markers, we can classify any cell that expresses these genes as glioma cells. Because t-SNE groups cells that are similar across the high-dimensional gene expression data, we will consider cells that form a group where the majority of cells express BCAN and/or GPM6A as the same cell type, even if they do not express either marker gene.
- Switch to lasso mode by clicking
Image Removed in the top right of the plot - Draw the lasso around the cluster of green, red, and yellow cells and click the circle to close the lasso (Figure 12)
Numbered figure captions |
---|
SubtitleText | Selecting a group of cells using the 3D lasso tool |
---|
AnchorName | Selecting a group of cells |
---|
|
Image Removed
|
Selected cells are shown in bold and unselected cells are dimmed. The number of selected cells is indicated in the figure legend. The cells are plotted on the color scale depending on their relative expression levels of the two marker genes (Figure 13)
Numbered figure captions |
---|
SubtitleText | Viewing expression levels for a group of cells |
---|
AnchorName | Viewing expression levels for a group of cells |
---|
|
Image Removed
|
- Click Classify selection in the Classify icon under Tools
A dialog to give the classification a name will appear.
- Name the classification Glioma
- Click Save (Figure 14)
Numbered figure captions |
---|
SubtitleText | Classifying selection |
---|
AnchorName | Classifying cells |
---|
|
Image Removed
|
Once cells have been classified, the classification is added to Classify. The number of cells belonging to the classification is listed. In MGH42, there are 460 glioma cells (Figure 15).
Numbered figure captions |
---|
SubtitleText | The number of cells in each classification is displayed |
---|
AnchorName | Viewing classifications |
---|
|
Image Removed
|
Classifications made on the t-SNE plot are retained as a draft as part of the data viewer session. In this tutorial, we will classify malignant cells for each sample before we save and apply the classifications, but if necessary, you can save the data viewer session by clicking the
Image Removed Save icon on the left to retain all of the formatting and draft classifications. The data viewer session will be stored under the Data viewer tab and can be re-opened to continue making classifications at a later time.
- Switch to pointer mode by clicking
Image Removed in the top right corner of the plot - Deselect the cells by clicking on any blank space on the plot
- Open Axes and navigate to Sample under Misc
- Select the
Image Removedicon below the sample name to go to the next sample, MGH45 - Rotate the 3D t-SNE plot to get a better view of cells from the green, red, and yellow cluster
- Switch to lasso mode by selecting
Image Removed in the top right corner of the plot - Draw the lasso around the cluster of colored cells and click the circle to close the lasso (Figure 16)
Numbered figure captions |
---|
SubtitleText | Classifying malignant cells in sample MGH45 |
---|
AnchorName | Classifying cells |
---|
|
Image Removed
|
- Select Classify selection in the Classify icon
- Type Glioma or select Glioma from the drop-down list (Figure 17)
- Click Save
Numbered figure captions |
---|
SubtitleText | Adding cells in a second sample to an existing classification |
---|
AnchorName | Classifying cells as an existing classification |
---|
|
Image Removed
|
- Repeat these steps for each of the 6 remaining samples. Remember to go back to the first sample (MGH36) to classify the glioma cells in that samples too.
There should be 5,322 glioma cells in total across all 8 samples.
- The classification name can be edited or deleted (Figure 18).
Numbered figure captions |
---|
SubtitleText | Edit or delete the classification |
---|
AnchorName | Edit or delete the classification |
---|
|
Image Removed
|
With the malignant cells in every sample classified, it is time to save the classifications.
- Click Apply classifications in the Classify icon
- Name the classification attribute Cell type (sample level)
- Click Run (Figure 19)
Numbered figure captions |
---|
SubtitleText | Name the cell-level attribute |
---|
AnchorName | Classifiy attribute name |
---|
|
Image Removed |
The new attribute is stored in the Data tab and is available to any node in the project.
- Click on the Glioma (multi-sample) project name at the top to go back to the Analyses tab
- Your browser may warn you that any unsaved changes to the data viewer session will be lost. Ignore this message and proceed to the Analyses tab
One multi-sample t-SNE plot
For some data sets, cell types can be distinguished when all samples can be visualized together on one t-SNE plot. We will use a t-SNE plot of all samples to classify glioma, microglia, and oligodendrocyte cell types.
- Click on the Glioma (multi-sample) project name at the top to go back to the Analyses tab
- Click the Filtered counts data node after the Filter features task
- Click PCA in the Exploratory analysis section of the task menu
- Uncheck the Split by sample checkbox (Figure 22)
- Click Finish
Numbered figure captions |
---|
SubtitleText | Combine all cells into one plot by unchecking the Split by sample box |
---|
AnchorName | Multi-sample PCA setting |
---|
|
Image Removed
|
The PCA task will run as a new green layer.
- Click the new PCA data node
- Select t-SNE from the Exploratory analysis section of the task menu
- Click Finish to run the t-SNE task with default settings
The t-SNE task will be added to the green layer (Figure 23). Layers are created in Partek Flow when the same task is run on the same data node.
Numbered figure captions |
---|
SubtitleText | Multi-sample PCA and t-SNE tasks are added as a new layer |
---|
AnchorName | PCA and t-SNE task new layer |
---|
|
Image Removed
|
Once the task has completed, we can view the plot.
- Double-click the green t-SNE data node to open the t-SNE scatter plot
- Click and drag the 2D scatter plot icon onto the canvas and replace the 3D scatter plot (Figure 24)
Numbered figure captions |
---|
SubtitleText | Viewing the multi-sample t-SNE plot |
---|
AnchorName | multi-sample t-SNE plot |
---|
|
Image Removed
|
- Search for and select green t-SNE data node (Figure 25)
Numbered figure captions |
---|
SubtitleText | Select the green multi-sample t-SNE data node to draw the 2D t-SNE plot |
---|
AnchorName | Select multi-sample t-SNE data |
---|
|
Image Removed
|
- In the Style icon, choose Sample name from the Color by drop-down list under Color
Viewing the 2D t-SNE plot, while most cells cluster by sample, there are a few clusters with cells from multiple samples (Figure 26).
Numbered figure captions |
---|
SubtitleText | Viewing the multi-sample t-SNE plot in 2D |
---|
AnchorName | Viewing 2D t-SNE |
---|
|
Image Removed
|
Using marker genes, BCAN (glioma), CD14 (microglia), and MAG (oligodendrocytes), we can assess whether these multi-sample clusters belong to our known cell types.
- Select any of the count data nodes from the Data card on the left (Single cell counts, or any of the Filtered counts)
- Search for the BCAN gene
- Click and drag the BCAN gene onto the plot and drop it over the Green (feature) option
- Search for the CD14 gene
- Click and drag the CD14 gene onto the plot and drop it over the Red (feature) option
- Search for the MAG gene
- Click and drag the MAG gene onto the plot and drop it over the Blue (feature) option
After coloring by these marker genes, three cell populations are clearly visible (Figure 27).
Numbered figure captions |
---|
SubtitleText | Overlaying marker gene expression on the multi-sample t-SNE plot |
---|
AnchorName | Overlaying gene expression |
---|
|
Image Removed
|
The red cells are CD14 positive, indicating that they are the microglia from every sample.
- Switch to lasso mode by clicking the
Image Removed icon in the top right of the plot - Draw the lasso around the cluster of red cells and click the circle to close the lasso (Figure 28)
- Open the Classify tool and click Classify selection
- Name the classification Microglia
- Click Save
Numbered figure captions |
---|
SubtitleText | Classifying microglia (red) |
---|
AnchorName | Classifying MOBP + cells |
---|
|
Image Removed
|
The blue cells are MAG positive, indicating that they are the oligodendrocytes from every sample.
- Switch to pointer mode by clicking
Image Removed in the top right corner of the plot - Deselect the cells by clicking on any blank space on the plot
- Switch to lasso mode again by clicking the
Image Removed icon in the top right of the plot - Draw the lasso around the cluster of blue cells and click the circle to close the lasso
- Open the Classify tool and click Classify selection
- Name the classification Oligodendrocytes
- Click Save
Finally, we will classify the BCAN expressing cells on the plot as glioma cells from every sample.
- Switch to pointer mode by clicking
Image Removed in the top right corner of the plot - Deselect the cells by clicking on any blank space on the plot
- Switch to lasso mode again by clicking the
Image Removed icon in the top right of the plot - Draw the lasso around the cluster of green cells and click the circle to close the lasso
- Open the Classify tool and click Classify selection
- Name the classification Glioma
- Click Save
- Switch to pointer mode by clicking
Image Removed in the top right corner of the plot - Deselect the cells by clicking on any blank space on the plot
The number of cells classified as microglia, oligodendrocytes, and glioma are shown in Classify (Figure 29)
Numbered figure captions |
---|
SubtitleText | The number of cells for each cell type |
---|
AnchorName | Number of cells per type |
---|
|
Image Removed
|
- Click Apply classifications in the Classify icon (Figure 30)
Numbered figure captions |
---|
SubtitleText | Apply classifications to the data project |
---|
AnchorName | Apply classifications to the data project |
---|
|
Image Removed
|
- Name the classification attribute Cell type (multi-sample) (Figure 31)
- Click Run
Numbered figure captions |
---|
SubtitleText | Name the cell-level attribute |
---|
AnchorName | Classification attribute name multi-sample |
---|
|
Image Removed
|
The new attribute is now available for downstream analysis.
...
The fastq files are not pre-processed. The steps covered here will show you how to import and pre-process of the Visium Spatial Gene Expression data with brightfield and fluorescence microscope images.
Add files to the project
The sample used for this tutorial can be found in the 10x Genomics Datasets. We will use the Control, replicate 1 mouse brain sample.
- Choose the 10x Genomics Visium fastq import format
- Click Next
Image Added
If you have not transferred files to the server already, click here for more details and choose to Transfer files to the server.
- Select the fastq files in the upload folder used for file transfer (select all sample files at one time; including R1 and R2 for each sample)
- Click Finish
Image Added
The prefix used for R1 and R2 fastq files should match; one sample is shown in this example.
The fastq files will be imported into the project as an Unaligned reads node.
Image Added
Pre-processing the unaligned fastq files with Space Ranger
The unaligned reads must be preprocessed before proceeding with the analysis steps covered here: Spatial data analysis.
- From the unaligned reads node, select Space Ranger from the 10x Genomics drop-down in the toolbox.
Image Added
For more information about Space Ranger click here.
- Specify the type of 10x Visium assay; this tutorial uses the Visium CytAssist gene expression library as the assay type
- If you have not done so already, a Cell Ranger reference should be created
- Specify the Reference assembly
- Select the Image and Probe set files that have already been transferred to the server for all samples
- Choose visium-2-large as the Slide parameter because this Visium CystAssist sample used a 11 x 11 slide capture area
- Click Finish
Image Added
The Space Ranger task output results in a Single cell counts node.
Image Added
Annotate Visium image
The tissue image must be annotated to associate the microscopy image with the expression data.
- Click the newly created Single cell counts data node
- Click the Annotation/Metadata section in the toolbox
- Click Annotate Visium image
- Click on the Browse button to open the file browser and point to the file <project-name>_spatial.zip, created by the Space Ranger task
- Click Finish
Image Added
Select the zipped image folder for each sample. The image zip file should contains 6 files including image files and tissue position text file with a scale factor json file. The setup page shows the sample table (one sample per row).
You can find the location of the <project-name>_spatial.zip file using the following steps. Select the Space Ranger task node (i.e. the rectangle) and then click on the Task Details (toolbox). Click on the Output files link to open the page with the list of files created by the Space Ranger task. Mouse over any of the files to see the directory in which the file is located. The figure below shows the path to the .zip file which is required for Annotate Visium image.
Image Added
Mousing over a file on the Output files page shows a balloon with the file location.
A new data node, Annotated counts, will be generated.
Image Added
The Annotated counts node is Split by sample. This means that any tasks performed from this node will also be split by sample. Invoke tasks from the Single cell counts node to combine samples for analyses.
Annotate Visium image task creates a new node, Annotated counts. Double click on the Annotated counts node to invoke the Data Viewer showing data points overlaid on top of the microscopy image.
Image Added
Data Viewer session as a result of opening an Annotated counts data node. Each data point is a tissue spot.
Proceed with analysis from the Single cell counts node. Click here to learn about viewing the multiple tissue images in the Data Viewer.
...