single cell rna sequencing data analysis practical exercises · case, update your gitrepo with...

18
Single cell RNA sequencing data analysis Practical exercises Åsa Björklund [email protected]

Upload: others

Post on 13-May-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

SinglecellRNAsequencingdataanalysisPracticalexercises

Åsa Bjö[email protected]

Page 2: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Practicalonzoom

• Workingroupsof5,theideaisthatyoucanhelpeachotheroutanddiscussresults.

• Onezoombreakoutroompergroup,youshouldhavealreadybeenassignedtoagroupinslack.Pleasestayonlineinthebreakoutroomforyourgroup.

• Cometomainroomforquestionortellusonslackanwecancometoyourbreakoutroom.

• Wehavesomeextraroomswherewecansitwithastudentiftherearespecificquestions.

Page 3: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

https://nbisweden.github.io/workshop-scRNAseq/exercises

Page 4: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

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

Page 5: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Seuratobject

https://github.com/satijalab/seurat/wiki/Seurat

Page 6: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

SingleCellExperiment (SCE)objects

https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html

Page 7: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

AnnData (Scanpy)objets

https://anndata.readthedocs.io/en/latest/anndata.AnnData.html

Page 8: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Whattochose?

• Itisrecommendedthatyougothroughallthestepswithonepipelineaseachexercisedependsonsavedobjectsfromthepreviousstep.

• Everyoneworksinverydifferentpace.Focusononeofthepipelinesfirst.Ifyouhavetimeleftover,youcanalsotryouttheotherones.

Page 9: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Thedatasets– Covid-19PBMCs

• Elderlypatientsusuallydevelopseverelunginflammationandlungdisfunction.

• Manycelltypesorchestratetheimmuneresponsetothevirus.

• Theirrelativecontributionatthesingle-cellresolutionisstillunclear

GOAL:Whichcelltypesandgenesarealteredwhencomparingbloodimmunecellsfromhealty vsdisease?

Page 10: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Thedatasets– Covid-19PBMCs

• Datafrompaper:”Immunophenotyping ofCOVID-19andinfluenzahighlightstheroleoftypeIinterferonsindevelopmentofsevereCOVID-19”Leeetal.SciImmuno

• Wehaveselected3controlsand3severecovidsamplesandsubsampledto1500cellspersubjectforcomputationalspeed/memory.

• STandtrajectorylabwillbewithotherdatasets.

Page 11: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Installationofallpackages

• Wehavecreatedaconda environmentforthecoursethatshouldcontainallpackagesyouneedfortheexercises

• However,forslingshottrajectoryinferencelab,thereisanadditionalconda environmentthatneedstobeinstalled.

• IfyouchosetoinsteadworkwithstandardRinstallations,youcanusethelistofrequiredpackagesintheenvironmentfileandinstallthemonyourown.

Page 12: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Whyconda?

• OfteneasierinstallationscomparedtotraditionalRinstallationforpackageswithC-compilationetc.

• Goodwaytomanagedifferentversionsofpackagesindifferentprojects.

• Thereareotherwaysofmanagingpackages.E.gpackratforR,pyenv forpythonetc.

Page 13: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Thecode:

• AllcodefortheexercisesisavailableasR-markdowndocuments,orjupyter notebooks,inthefolder:workshop-scRNAseq/labs/compiled/

• Pleasereporttousifyoufindanyerrorsinthecode!– Slackchannel#exercises– AnIssueonthegithub page.

• Wemayfindbugsandupdatethecode– inthatcase,updateyourgit repowithcommand”gitpull”

Page 14: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Reproduciblecoding

• Youshouldalwaysbeabletofindandrecreatetheresults.– Scriptsshouldbeabletorunfrominputfilestocreatetheoutput.

– NeverworkwithsavedRsessions!

• Nameyourscriptswithrelevantnamessoyoucanfindthem2yearslaterJ

• Alwaysbackupcode– goodideatousegithub thatalsogivesyouversioncontrol.

Page 15: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

MemoryissuesinR

• scRNAseq datasetsareoftenlarge,thinkabouthowyoucode.Avoidduplicatingobjects!

• Removeunusedmatricesandclearmemorywithgc().

• MostpackagesstorescRNAseq assparsematrices,willrequirepackageMatrixorsimilarformanystandardmatrixoperations.

• IfyoustillhaveissueswithmemoryinR,testsettinge.g.R_MAX_VSIZE=70Gb inthe.Renviron file.Defaultis16Gb.

Page 16: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Troubleshooting

• Slackchannel- #exercises

• Itisimportantthatyoulearnhowtotroubleshootyourselves.– Lookatyourerrormessages,perhapstheansweristhere?– Ifnot– Googleisyourbestfriend!ForumslikeSeqanswers,Stackexchange,Bioconductorsupportforum,specificforums(orgithub issues)foreachpackagemayhavetheanswer.

• TAsaretheretoansweranyquestionsandgivesuggestions,butwemaynotalwayshavetheanswer.

Page 17: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

https://nbisweden.github.io/single-cell-pbl/glossary_of_terms_single_cell.html

Page 18: Single cell RNA sequencing data analysis Practical exercises · case, update your gitrepo with command ”git ... pbl/glossary_of_terms_single_cell.html. Rmarkdowndemonstration. Title:

Rmarkdown demonstration