Practicalonzoom
• Workingroupsof5,theideaisthatyoucanhelpeachotheroutanddiscussresults.
• Onezoombreakoutroompergroup,youshouldhavealreadybeenassignedtoagroupinslack.Pleasestayonlineinthebreakoutroomforyourgroup.
• Cometomainroomforquestionortellusonslackanwecancometoyourbreakoutroom.
• Wehavesomeextraroomswherewecansitwithastudentiftherearespecificquestions.
https://nbisweden.github.io/workshop-scRNAseq/exercises
Threemainpipelinesforanalysing singlecelldata:• Seurat:
• Rbased,centeredaroundSeuratobjects.• Mainlydevelopedfordropletbaseddata• Easytouse,recommendedforRbeginners• Cons:usesaLOTofmemory
• Scran:• Rbased,centeredaroundSingleCellExperiment objects• Hasmoredifferentstatisticalmethods• Canhandlespike-ins• Cons:MorecomplicatedthanSeurattorun.
• Scanpy:• Pythonbased• Handleslargedatasetsbetter.• Cons:Requiresquitesomepythonknowledge.DoesnotyethaveallthefunctionalityoftheRbasedtools
Seuratobject
https://github.com/satijalab/seurat/wiki/Seurat
SingleCellExperiment (SCE)objects
https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html
AnnData (Scanpy)objets
https://anndata.readthedocs.io/en/latest/anndata.AnnData.html
Whattochose?
• Itisrecommendedthatyougothroughallthestepswithonepipelineaseachexercisedependsonsavedobjectsfromthepreviousstep.
• Everyoneworksinverydifferentpace.Focusononeofthepipelinesfirst.Ifyouhavetimeleftover,youcanalsotryouttheotherones.
Thedatasets– Covid-19PBMCs
• Elderlypatientsusuallydevelopseverelunginflammationandlungdisfunction.
• Manycelltypesorchestratetheimmuneresponsetothevirus.
• Theirrelativecontributionatthesingle-cellresolutionisstillunclear
GOAL:Whichcelltypesandgenesarealteredwhencomparingbloodimmunecellsfromhealty vsdisease?
Thedatasets– Covid-19PBMCs
• Datafrompaper:”Immunophenotyping ofCOVID-19andinfluenzahighlightstheroleoftypeIinterferonsindevelopmentofsevereCOVID-19”Leeetal.SciImmuno
• Wehaveselected3controlsand3severecovidsamplesandsubsampledto1500cellspersubjectforcomputationalspeed/memory.
• STandtrajectorylabwillbewithotherdatasets.
Installationofallpackages
• Wehavecreatedaconda environmentforthecoursethatshouldcontainallpackagesyouneedfortheexercises
• However,forslingshottrajectoryinferencelab,thereisanadditionalconda environmentthatneedstobeinstalled.
• IfyouchosetoinsteadworkwithstandardRinstallations,youcanusethelistofrequiredpackagesintheenvironmentfileandinstallthemonyourown.
Whyconda?
• OfteneasierinstallationscomparedtotraditionalRinstallationforpackageswithC-compilationetc.
• Goodwaytomanagedifferentversionsofpackagesindifferentprojects.
• Thereareotherwaysofmanagingpackages.E.gpackratforR,pyenv forpythonetc.
Thecode:
• AllcodefortheexercisesisavailableasR-markdowndocuments,orjupyter notebooks,inthefolder:workshop-scRNAseq/labs/compiled/
• Pleasereporttousifyoufindanyerrorsinthecode!– Slackchannel#exercises– AnIssueonthegithub page.
• Wemayfindbugsandupdatethecode– inthatcase,updateyourgit repowithcommand”gitpull”
Reproduciblecoding
• Youshouldalwaysbeabletofindandrecreatetheresults.– Scriptsshouldbeabletorunfrominputfilestocreatetheoutput.
– NeverworkwithsavedRsessions!
• Nameyourscriptswithrelevantnamessoyoucanfindthem2yearslaterJ
• Alwaysbackupcode– goodideatousegithub thatalsogivesyouversioncontrol.
MemoryissuesinR
• scRNAseq datasetsareoftenlarge,thinkabouthowyoucode.Avoidduplicatingobjects!
• Removeunusedmatricesandclearmemorywithgc().
• MostpackagesstorescRNAseq assparsematrices,willrequirepackageMatrixorsimilarformanystandardmatrixoperations.
• IfyoustillhaveissueswithmemoryinR,testsettinge.g.R_MAX_VSIZE=70Gb inthe.Renviron file.Defaultis16Gb.
Troubleshooting
• Slackchannel- #exercises
• Itisimportantthatyoulearnhowtotroubleshootyourselves.– Lookatyourerrormessages,perhapstheansweristhere?– Ifnot– Googleisyourbestfriend!ForumslikeSeqanswers,Stackexchange,Bioconductorsupportforum,specificforums(orgithub issues)foreachpackagemayhavetheanswer.
• TAsaretheretoansweranyquestionsandgivesuggestions,butwemaynotalwayshavetheanswer.
https://nbisweden.github.io/single-cell-pbl/glossary_of_terms_single_cell.html
Rmarkdown demonstration