R / Bioconductor for High-Throughput Sequence Analysis

[This article was first published on One Tip Per Day, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I would like to recommend a recent workshop material on R/Bioconductor from Marc Carlson et al.

http://www.bioconductor.org/help/course-materials/2013/SeattleMay2013/

PDF: IntermediateSequenceAnalysis2013.pdf
R script: IntermediateSequenceAnalysis2013.R

Here is the TOC list if you want to read more (highlight for suggested reading list):


I R / Bioconductor 5
2 R 6
2.1 Statistical analysis and comprehension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Basics of R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Essential data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.2 S3 (and S4) classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.3 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 In and out of trouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3.1 Warnings, errors, and debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3.2 Effi cient R code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.4 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.5 Help! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3 Bioconductor 25
3.1 High-throughput sequence analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.2 Statistical programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3 Bioconductor packages for high-throughput sequence analysis . . . . . . . . . . . . . . . . . . 28
3.4 S4 Classes and methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.5 Help! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4 Sequencing 32
4.1 Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.2 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2.1 A running example: the pasilla data set . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2.2 Work flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5 Strings and Reads 36
5.1 DNA (and other) Strings with the Biostrings package . . . . . . . . . . . . . . . . . . . . . . 36
5.2 Reads and the ShortRead package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6 Ranges and Alignments 44
6.1 Ranges and the GenomicRanges package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.2 Alignments and the Rsamtools Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7 Strategies for working with large data 54
7.1 Restriction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.2 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7.3 Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.4 Parallel evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.5 And. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
II Diff erential Representation 62
8 RNA-seq Work Flows 63
8.1 Varieties of RNA-seq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.2 Work flows and upstream analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.2.1 Experimental design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.2.2 Wet-lab protocols, sequencing, and alignment . . . . . . . . . . . . . . . . . . . . . . . 64
8.3 Statistical analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.3.1 Summarizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.3.2 Normalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.3.3 Error model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.3.4 Multiple comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.3.5 Bioconductor software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9 Counting RNA-seq reads 68
9.1 `Phenotypic’ data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.2 Alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.2.1 Alignment, subsetting, and access in R . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.2.2 Exploration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.3 Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.4 SummarizedExperiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
9.5 Additional counting and annotation opportunities . . . . . . . . . . . . . . . . . . . . . . . . 77
9.5.1 Counting genes, counting transcripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.5.2 Counting by other means . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.5.3 Using other annotation resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
10 DESeq Work Flow Exercises 79
10.1 Data input and preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.2 Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.3 Independent filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.4 Data quality assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.4.1 Preliminary transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.4.2 Quality assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.5 Frequently asked questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
III Variant Calls 81
11 Variant Work Flows 82
11.1 Variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.1.1 Varieties of variant-related work flows . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.1.2 Work flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.1.3 Bioconductor software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.2 VariantTools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11.2.1 Example data: lung cancer cell lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11.2.2 Calling single-sample variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11.2.3 Additional work flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
12 Working with Called Variants 85
12.1 Variant call format (VCF) fi les with VariantAnnotation . . . . . . . . . . . . . . . . . . . . . 85
12.1.1 Data input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
12.2 SNP Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
12.3 Annotation with ensemblVEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
12.4 Large-scale fi ltering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
IV Annotation and Visualization 95
13 Gene-centric Annotation 96
13.1 Gene-centric annotations with AnnotationDbi . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
13.2 biomaRt and other web-based resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
13.2.1 Using biomaRt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
14 Genomic Annotation 101
14.1 AnnotationHub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
14.2 Whole genome sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
14.3 Gene models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
14.3.1 TxDb.* packages for model organisms . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
14.4 UCSC tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
14.4.1 Easily creating TranscriptDb objects from GTF files . . . . . . . . . . . . . . . . . . . 103
15 Visualizing Sequence Data 108
15.1 Gviz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
15.2 ggbio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
15.3 shiny for easy interactive reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

To leave a comment for the author, please follow the link and comment on their blog: One Tip Per Day.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)