title: "Group 17" output: rmarkdown::pdf_document vignette: > %\VignetteIndexEntry{vignette} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8}
library(group17)
This package is builed around the central dogma of Molecular Biology, which describes the transfer of sequential information from DNA, RNA to Amino Acids (Crick, 1970). With the package you are able to generate and translate DNA, RNA and Amino-Acid Sequences. Further it enables you to perform basic statistic on those sequences.
The R-package group17
can be found on Github.
To install group17
from GitHub repository run the code below:
library(devtools) # install package from github devtools::install_github("rforbiodatascience22/group_17_package")
library(group17)
data = get(load("/cloud/project/data/rna_codons.rda")) data
To form a string of DNA base "A", "T", "G", "C" by random nucleotide selection following target length(size), default is 1.
form_dna <- function(size = 1){ random_dna1 <- sample(c("A", "T", "G", "C"), size = size, replace = TRUE) random_dna2 <- paste0(random_dna1, collapse = "") return(random_dna2) }
To convert DNA base, "T" into "U" and getting mRNA as character.
transcribe <- function(DNA_seq){ mRNA <- gsub("T", "U", DNA_seq) return(mRNA) }
To convert mRNA sequence composing of "A", "T", "G", "C" to condon like "AUGC"as character.
get_codons <- function(mRNA_seq, start = 1){ mRNA_sequences <- nchar(mRNA_seq) codons <- substring(mRNA_seq, first = seq(from = start, to = mRNA_seq_len-3+1, by = 3), last = seq(from = 3+start-1, to = mRNA_seq_len, by = 3)) return(codons) }
To use the data table "codonTable" to translate codons into amino acids and then return it as a sting.
translate <- function(codons){ amino_acid <- paste0(codon_table[codons], collapse = "") return(amino_acid) }
To plot the occurence of Bases in a DNA, RNA or Amino Acid Sequence use plot_base_occurence()
seq <- "ACGTCCCCGGGT" plot_base_occurrence(sequence = seq)
plot_base_occurrence <- function(sequence){ unique_bases <- sequence %>% stringr::str_split(pattern = stringr::boundary("character"), simplify = TRUE) %>% as.character() %>% unique() counts <- sapply(unique_bases, function(count_occurence) stringr::str_count(string = sequence, pattern = count_occurence)) %>% as.data.frame() colnames(counts) <- c("Counts") counts[["Base"]] <- rownames(counts) plot <- counts %>% ggplot2::ggplot(ggplot2::aes(x = Base, y = Counts, fill = Base)) + ggplot2::geom_col() + ggplot2::theme_bw() return(plot) }
sessionInfo()
CRICK, F. Central Dogma of Molecular Biology. Nature 227, 561–563 (1970). https://doi.org/10.1038/227561a0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.