Summary

Load packages

library( "Seurat" )
library( "scater" )

Load data

sce <- readRDS( "/home/idies/workspace/practical_genomics/day1/retina.rds" )
sce <- as.SingleCellExperiment( sce )

Check data

sce

Explore data

plotUMAP – metadata

plotUMAP( sce, colour_by="cell_type" )

plotUMAP – gene

plotUMAP( sce, colour_by="RHO" )

plotExpression – distribution

plotExpression( sce, "RHO", "cell_type" ) +
  theme( axis.text.x=element_text( angle=90 ) )

Task 1: Plot metadata

  • Here are the available metadata categories
colnames( colData(sce) )
  • Modify plotUMAP() to colour_by a different category
plotUMAP( sce, colour_by="" )
  • Repeat to find one or two patterns you find interesting
plotUMAP()

Task 2: Plot gene

  • Use this chunk to check the spelling of your gene of interest
goi <- "RHO"
table( goi %in% rownames(sce) )
  • Modify plotUMAP() to plot your gene of interest
plotUMAP( sce, colour_by="RHO" )
  • Repeat to find one or two patterns you find interesting

Task 3: Plot distributions

  • Modify plotExpression() to compare expression across different categories
plotExpression( sce, "RHO", "libraryID" ) +
  theme( axis.text.x=element_text( angle=90 ) )
  • Replace libraryID with your category to tabulate how many cells are in your category
table( colData(sce)$libraryID )
  • Repeat to find one or two patterns you find interesting

Document software

sessionInfo()
LS0tCnRpdGxlIDogIkRheSAxIC8vIEV4ZXJjaXNlIDEgLy8gUmV0aW5hIERhdGFzZXQiCmF1dGhvcjogIiIKZGF0ZSAgOiAiMDQgT2N0b2JlciAyMDIxIgpvdXRwdXQ6IAogIGh0bWxfbm90ZWJvb2s6CiAgICB0b2M6IHRydWUKICAgIHRvY19mbG9hdDogdHJ1ZQotLS0KCiMgU3VtbWFyeQoKLSBQdWJsaXNoZWQgYXMgW1ZvaWd0IGV0IGFsLiwgMjAxOV0oaHR0cHM6Ly9wdWJtZWQuZ292LzMxMDc1MjI0LykKCiMgTG9hZCBwYWNrYWdlcwoKYGBge3IgbWVzc2FnZT1GQUxTRX0KbGlicmFyeSggIlNldXJhdCIgKQpsaWJyYXJ5KCAic2NhdGVyIiApCmBgYAoKIyBMb2FkIGRhd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