Book Image

R Bioinformatics Cookbook - Second Edition

By : Dan MacLean
Book Image

R Bioinformatics Cookbook - Second Edition

By: Dan MacLean

Overview of this book

The updated second edition of R Bioinformatics Cookbook takes a recipe-based approach to show you how to conduct practical research and analysis in computational biology with R. You’ll learn how to create a useful and modular R working environment, along with loading, cleaning, and analyzing data using the most up-to-date Bioconductor, ggplot2, and tidyverse tools. This book will walk you through the Bioconductor tools necessary for you to understand and carry out protocols in RNA-seq and ChIP-seq, phylogenetics, genomics, gene search, gene annotation, statistical analysis, and sequence analysis. As you advance, you'll find out how to use Quarto to create data-rich reports, presentations, and websites, as well as get a clear understanding of how machine learning techniques can be applied in the bioinformatics domain. The concluding chapters will help you develop proficiency in key skills, such as gene annotation analysis and functional programming in purrr and base R. Finally, you'll discover how to use the latest AI tools, including ChatGPT, to generate, edit, and understand R code and draft workflows for complex analyses. By the end of this book, you'll have gained a solid understanding of the skills and techniques needed to become a bioinformatics specialist and efficiently work with large and complex bioinformatics datasets.
Table of Contents (16 chapters)

Extracting information in genomic regions of interest

Often, you’ll want to look in more detail at data that falls into a particular genomic region of interest, whether that be the SNPs and variants in a gene or the genes at a particular locus. This common task is handled extremely well by the powerful GRanges and SummarizedExperiment objects. They are a little fiddly to set up but have very flexible subsetting operations that make the effort well worth it. In this recipe, we’ll look at a few ways to set up these objects and a few ways we can manipulate them to get interesting information.

Getting ready

For this recipe, we’ll need the GenomicRanges, SummarizedExperiment, and rtracklayer Bioconductor packages. We will also use a GFF file of features of the Arabidopsis chromosome 4 and a smaller text version of gene features only. These are both in the rbioinfcookbook package, so we’ll extract them from that.

How to do it…

Extracting information...