Bioconductor
By: Kamil Szymkowski
Tags: Bioinformatics, Covid 19, Dna Sequencing, R, Bioconductor

Getting familiar with the Bioconductor packages for analysis of genomic data.

Bioconductor provides tools for the analysis and comprehension of high-throughput genomic data. Bioconductor uses the R statistical programming language, and is open source and open development. It has two releases each year, and an active user community. -Biocondutor.org

What does “genomic” mean in “genomic data”?

Genomics is an interdisciplinary field of biology focusing on the structure, function, evolution, mapping, and editing of genomes. -Wikipedia

Genomics vs Genetics

A genome is an organism’s complete set of DNA, including all of its genes. In contrast to genetics, which refers to the study of individual genes and their roles in inheritance, genomics aims at the collective characterization and quantification of all of an organism’s genes, their interrelations and influence on the organism. -Wikipedia

Okay, … so it’s about data output from the sequencing of DNA.

What is DNA?

DNA consists of a linear string of nucleotides, or bases, for simplicity, referred to by the first letters of their chemical names — A, T, C and G. -National Human Genome Research Institute

What is DNA sequencing?

The process of deducing the order of nucleotides in DNA is called DNA sequencing. Since the DNA sequence confers information that the cell uses to make RNA molecules and proteins, establishing the sequence of DNA is key for understanding how genomes work. The technology for DNA sequencing was made faster and less expensive as a part of the Human Genome Project. And recent developments have profoundly increased the efficiency of DNA sequencing even further. -National Human Genome Research Institute

What is high-throughput genomic data?

High-throughput sequencing, also known as next-generation sequencing (NGS), is the comprehensive term used to describe technologies that sequence DNA and RNA in a rapid and cost-effective manner. -Science Direct

Alright, now I’m eager to see a sample of genomic data that can be fed into Bioconductor packages’ functions.

The downloaded data is in the form of 22 text files, each representing genome sequenced from the virus that causes COVID-19 known as SARS-CoV-2.

A single text file contains rows of letters representing the order of nucleotides in the DNA sample.

What is the nucleic acid sequence?

A nucleic acid sequence is a succession of bases signified by a series of a set of five different letters that indicate the order of nucleotides forming alleles within a DNA (using GACT) or RNA (GACU) molecule. […] The possible letters are A, C, G, and T, representing the four nucleotide bases of a DNA strand — adenine, cytosine, guanine, thymine — covalently linked to a phosphodiester backbone. […] In biological systems, nucleic acids contain information which is used by a living cell to construct specific proteins. The sequence of nucleobases on a nucleic acid strand is translated by cell machinery into a sequence of amino acids making up a protein strand. Each group of three bases, called a codon, corresponds to a single amino acid, and there is a specific genetic code by which each possible combination of three bases corresponds to a specific amino acid. -Wikipedia

Getting started with a virus genome as opposed to the human genome has its advantages. The length of the DNA of a virus is many orders of magnitude smaller than the human DNA. Hence, no need for big data computing.

Perfect, I have the data now, it’s a good first step, … but I don’t know what inferences one can make about it. Looking into the capabilities of Biconductor packages could definitely inform me.

An overview of Biconductor’s packages:

www.bioconductor.org is a CRAN equivalent for packages that address the analysis of genomic data.

Bioconductor packages are broadly defined by three main package types: Software, Experiment Data, and Annotation. 1. Most packages contributed by users are software packages. Software packages provide implementation of algorithms (e.g. statistical analysis), access to resources (e.g. biomart, or NCBI) or visualizations (e.g. volcano plots, pathways plots). Instructions for creating Software packages can be found here: Package guidelines. 2. Annotation packages are database-like packages that provide information linking identifiers (e.g., Entrez gene names or Affymetrix probe ids) to other information (e.g., chromosomal location, Gene Ontology category). It is also encouraged to utilize AnnotationHub for storage and access to large raw data files and their conversion to standard R formats. Instructions for adding data to AnnotationHub and designing a annotation package to use AnnotationHub can be found here: Creating AnnotationHub Packages. 3. Experiment data packages provide data sets that are used, often by software packages, to illustrate particular analyses. These packages contain curated data from an experiment, teaching course or publication and in most cases contain a single data set. It is also encouraged to utilize ExperimentHub for storage and access to larger data files. ExperimentHub is also particularly useful for hosting collections of related data sets. Instructions for adding data to ExperimentHub and designing an experiment data package to use ExperimentHub can be found here: Creating ExperimentHub Packages.

There is currently a total of 3371 packages on Bioconductor.org …

This handy diagram found on Bioconductor.org shows which are the commonly used packages for the analysis of genomic data at successive stages of the process.

It appears that the starting point ought to be the Biostrings package.

In our mini Covid project, the following packages will be used:

# Packages ####

library(Biostrings) # Fast computing of strings

library(readr) # Reading a .txt file

library(stringr) # Removing line breaks

library(ggplot2) # Used for data visualisation

library(tidyr) # Data manipulation

library(magrittr) # The pipe operator (%>%).

Each text file is read into R with read_file() function from readr package, then the presence of line break encodings …

necessitates the removal of such fragments from the string with the str_replace_all() function from stringr package. Finally, sequences of characters end up in the DNAString() function from Biostrings the package that stores the strings of characters in a computing-efficient form.

# Data ####

LC528232 <- read_file("covid/LC528232.txt")

LC528232 <- str_replace_all(LC528232, "[\r

]" , "")

LC528232 = DNAString(LC528232) LC528233 <- read_file("covid/LC528233.txt")

LC528233 <- str_replace_all(LC528233, "[\r

]" , "")

LC528233 = DNAString(LC528233) # repeated for all 22 files ...

A vector of sample names will come in handy in the later creation of data frames, so it’s created with the following line:

sample_names <- c("LC528232", "LC528233", "LC529905", "LC534418", "LC534419", "LR757995", "LR757996", "LR757998", "MN908947", "MN938384", "MN975262", "MN985325", "MN988668", "MN988669", "MN988713", "MN994467", "MN994468", "MN996527", "MN996529", "MN996530", "MN996531", "MN997409")

All the DNAString containers are grouped together with the help of the DNAStringSet() function. That is being done for convenience to apply operations on all sequences together as opposed to separately.

all_samples <- c(paste(LC528232), paste(LC528233), paste(LC529905), paste(LC534418), paste(LC534419), paste(LR757995), paste(LR757996), paste(LR757998), paste(MN908947), paste(MN938384), paste(MN975262), paste(MN985325), paste(MN988668), paste(MN988669), paste(MN988713), paste(MN994467), paste(MN994468), paste(MN996527), paste(MN996529), paste(MN996530), paste(MN996531), paste(MN997409)) all_samples <- DNAStringSet(all_samples) names(all_samples) = sample_names

The set of DNA sequences is now called all_samples